aboutsummaryrefslogtreecommitdiffstats
path: root/tests/wpt/tests/fedcm/support/account_picture_get_count.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/wpt/tests/fedcm/support/account_picture_get_count.py')
-rw-r--r--tests/wpt/tests/fedcm/support/account_picture_get_count.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/wpt/tests/fedcm/support/account_picture_get_count.py b/tests/wpt/tests/fedcm/support/account_picture_get_count.py
new file mode 100644
index 00000000000..91c3601fbdc
--- /dev/null
+++ b/tests/wpt/tests/fedcm/support/account_picture_get_count.py
@@ -0,0 +1,13 @@
+import importlib
+keys = importlib.import_module("fedcm.support.keys")
+
+def main(request, response):
+ account_picture_url = "/fedcm/support/account_picture.py"
+
+ counter = request.server.stash.take(keys.ACCOUNT_PICTURE_COUNTER_KEY, account_picture_url)
+ try:
+ counter = counter.decode()
+ except (UnicodeDecodeError, AttributeError):
+ counter = 0
+
+ return str(counter)