summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/background-sync/idlharness.https.any.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/background-sync/idlharness.https.any.js')
-rw-r--r--testing/web-platform/tests/background-sync/idlharness.https.any.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/testing/web-platform/tests/background-sync/idlharness.https.any.js b/testing/web-platform/tests/background-sync/idlharness.https.any.js
new file mode 100644
index 0000000000..29fb87b826
--- /dev/null
+++ b/testing/web-platform/tests/background-sync/idlharness.https.any.js
@@ -0,0 +1,23 @@
+// META: script=/resources/WebIDLParser.js
+// META: script=/resources/idlharness.js
+// META: timeout=long
+
+'use strict';
+
+// https://wicg.github.io/background-sync/spec/
+
+idl_test(
+ ['background-sync'],
+ ['service-workers', 'html', 'dom'],
+ idlArray => {
+ const isServiceWorker = location.pathname.includes('.serviceworker.');
+ if (isServiceWorker) {
+ idlArray.add_objects({
+ ServiceWorkerGlobalScope: ['self', 'onsync'],
+ ServiceWorkerRegistration: ['registration'],
+ SyncManager: ['registration.sync'],
+ SyncEvent: ['new SyncEvent("tag", "lastChance")'],
+ });
+ }
+}
+);