summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/shared-storage/resources/verify-length-module.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /testing/web-platform/tests/shared-storage/resources/verify-length-module.js
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/shared-storage/resources/verify-length-module.js')
-rw-r--r--testing/web-platform/tests/shared-storage/resources/verify-length-module.js18
1 files changed, 18 insertions, 0 deletions
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);