summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/service-workers/service-worker/interfaces.https.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/service-workers/service-worker/interfaces.https.html')
-rw-r--r--testing/web-platform/tests/service-workers/service-worker/interfaces.https.html56
1 files changed, 56 insertions, 0 deletions
diff --git a/testing/web-platform/tests/service-workers/service-worker/interfaces.https.html b/testing/web-platform/tests/service-workers/service-worker/interfaces.https.html
new file mode 100644
index 000000000..403a00534
--- /dev/null
+++ b/testing/web-platform/tests/service-workers/service-worker/interfaces.https.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<title>Service Worker: Interfaces</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/interfaces.js"></script>
+<script src="resources/test-helpers.sub.js"></script>
+<script>
+
+test(function() {
+ var EVENT_HANDLER = 'object';
+ verify_interface(
+ 'ServiceWorkerContainer', navigator.serviceWorker,
+ {
+ register: 'function',
+ getRegistration: 'function',
+ oncontrollerchange: EVENT_HANDLER
+ });
+ }, 'Interfaces and attributes of ServiceWorkerContainer');
+
+async_test(function(t) {
+ var EVENT_HANDLER = 'object';
+ var scope = 'resources/scope/interfaces-and-attributes';
+
+ service_worker_unregister_and_register(
+ t, 'resources/empty-worker.js', scope)
+ .then(function(registration) {
+ verify_interface(
+ 'ServiceWorkerRegistration', registration,
+ {
+ installing: 'object',
+ waiting: 'object',
+ active: 'object',
+ scope: 'string',
+ unregister: 'function',
+ onupdatefound: EVENT_HANDLER
+ });
+ verify_interface(
+ 'ServiceWorker', registration.installing,
+ {
+ scriptURL: 'string',
+ state: 'string',
+ onstatechange: EVENT_HANDLER
+ });
+ return registration.unregister();
+ })
+ .then(function() {
+ t.done();
+ })
+ .catch(unreached_rejection(t));
+ }, 'Interfaces and attributes of ServiceWorker');
+
+service_worker_test(
+ 'resources/interfaces-worker.sub.js',
+ 'Interfaces and attributes in ServiceWorkerGlobalScope');
+
+</script>