summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/shared-storage/resources/verify-length-module.js
diff options
context:
space:
mode:
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);