Index: LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/resources/registration-attribute-worker.js |
diff --git a/LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/resources/registration-attribute-worker.js b/LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/resources/registration-attribute-worker.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..236a27891506f4b661a1d50c5de539bc285a4fbb |
--- /dev/null |
+++ b/LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/resources/registration-attribute-worker.js |
@@ -0,0 +1,53 @@ |
+importScripts('../../resources/test-helpers.js'); |
+importScripts('../../resources/worker-testharness.js'); |
+ |
+assert_equals( |
+ self.registration.scope, |
+ normalizeURL('scope/registration-attribute'), |
+ 'On worker script evaluation, registration attribute should be set'); |
+assert_equals( |
+ self.registration.installing, |
+ null, |
+ 'On worker script evaluation, installing worker should be null'); |
+assert_equals( |
+ self.registration.waiting, |
+ null, |
+ 'On worker script evaluation, waiting worker should be null'); |
+assert_equals( |
+ self.registration.active, |
+ null, |
+ 'On worker script evaluation, active worker should be null'); |
+ |
+self.addEventListener('install', function(e) { |
+ assert_equals( |
+ self.registration.scope, |
+ normalizeURL('scope/registration-attribute'), |
+ 'On install event, registration attribute should be set'); |
+ // FIXME: Verify that... |
+ // - registration.installing is set. |
+ // - registration.{waiting, active} are null. |
+ // (http://crbug.com/437677) |
+ }); |
+ |
+self.addEventListener('activate', function(e) { |
+ assert_equals( |
+ self.registration.scope, |
+ normalizeURL('scope/registration-attribute'), |
+ 'On activate event, registration attribute should be set'); |
+ // FIXME: Verify that... |
+ // - registration.{installing, waiting} are null. |
+ // - registration.active is set. |
+ // (http://crbug.com/437677) |
+ }); |
+ |
+self.addEventListener('fetch', function(e) { |
+ assert_equals( |
+ self.registration.scope, |
+ normalizeURL('scope/registration-attribute'), |
+ 'On fetch event, registration attribute should be set'); |
+ // FIXME: Verify that... |
+ // - registration.{installing, waiting} are null. |
+ // - registration.active is set. |
+ // (http://crbug.com/437677) |
+ e.respondWith(new Response('PASS')); |
+ }); |