summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/shared-storage/resources
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/shared-storage/resources')
-rw-r--r--testing/web-platform/tests/shared-storage/resources/credentials-test-helper.py6
-rw-r--r--testing/web-platform/tests/shared-storage/resources/verify-length-module.js18
2 files changed, 24 insertions, 0 deletions
diff --git a/testing/web-platform/tests/shared-storage/resources/credentials-test-helper.py b/testing/web-platform/tests/shared-storage/resources/credentials-test-helper.py
index 81a988e358..46fc0ea6fb 100644
--- a/testing/web-platform/tests/shared-storage/resources/credentials-test-helper.py
+++ b/testing/web-platform/tests/shared-storage/resources/credentials-test-helper.py
@@ -13,6 +13,12 @@ def main(request, response):
response.status = 200
response.headers.append(b"Content-Type", b"text/javascript")
+ if b"access_control_allow_credentials_header" in request.GET:
+ response.headers.append(b"Access-Control-Allow-Credentials", request.GET[b"access_control_allow_credentials_header"])
+
+ if b"access_control_allow_origin_header" in request.GET:
+ response.headers.append(b"Access-Control-Allow-Origin", request.GET[b"access_control_allow_origin_header"])
+
if action == b"store-cookie":
cookie = request.headers.get(b"Cookie", b"NO_COOKIE_HEADER")
request.server.stash.put(token, cookie)
diff --git a/testing/web-platform/tests/shared-storage/resources/verify-length-module.js b/testing/web-platform/tests/shared-storage/resources/verify-length-module.js
new file mode 100644
index 0000000000..8ba10fbcb6
--- /dev/null
+++ b/testing/web-platform/tests/shared-storage/resources/verify-length-module.js
@@ -0,0 +1,18 @@
+// Copyright 2024 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+class VerifyLength {
+ async run(urls, data) {
+ if (data && data.hasOwnProperty('expectedLength')) {
+ const expectedLength = data['expectedLength'];
+ const actualLength = await sharedStorage.length();
+ if (actualLength === expectedLength) {
+ return 1;
+ }
+ }
+ return -1;
+ }
+}
+
+register('verify-length', VerifyLength);