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..ae7bbb0f359b6d2b74460d8922567039ac07dca8 |
--- /dev/null |
+++ b/LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/resources/registration-attribute-worker.js |
@@ -0,0 +1,47 @@ |
+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. |
+ // FIXME: Verify that registration.{waiting, active} are null. |
+ }); |
+ |
+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. |
+ // FIXME: Verify that registration.active is set. |
kinuko
2015/01/26 03:15:53
When are we going to fix this?
nhiroki
2015/01/26 04:00:38
Following CLs will fix this:
[1] https://coderevie
|
+ }); |
+ |
+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. |
+ // FIXME: Verify that registration.active is set. |
+ e.respondWith(new Response('Hello, world!')); |
falken
2015/01/27 04:08:15
nit: instead of "Hello, world", respond with 'PASS
nhiroki
2015/01/27 07:51:26
Done.
|
+ }); |