Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/resources/registration-attribute-worker.js

Issue 822593003: ServiceWorker: Expose registration within ServiceWorkerGlobalScope [3/3] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@expose_swreg
Patch Set: address falken@'s comment Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 importScripts('../../resources/test-helpers.js');
2 importScripts('../../resources/worker-testharness.js');
3
4 assert_equals(
5 self.registration.scope,
6 normalizeURL('scope/registration-attribute'),
7 'On worker script evaluation, registration attribute should be set');
8 assert_equals(
9 self.registration.installing,
10 null,
11 'On worker script evaluation, installing worker should be null');
12 assert_equals(
13 self.registration.waiting,
14 null,
15 'On worker script evaluation, waiting worker should be null');
16 assert_equals(
17 self.registration.active,
18 null,
19 'On worker script evaluation, active worker should be null');
20
21 self.addEventListener('install', function(e) {
22 assert_equals(
23 self.registration.scope,
24 normalizeURL('scope/registration-attribute'),
25 'On install event, registration attribute should be set');
26 // FIXME: Verify that registration.installing is set.
27 // FIXME: Verify that registration.{waiting, active} are null.
28 });
29
30 self.addEventListener('activate', function(e) {
31 assert_equals(
32 self.registration.scope,
33 normalizeURL('scope/registration-attribute'),
34 'On activate event, registration attribute should be set');
35 // FIXME: Verify that registration.{installing, waiting} are null.
36 // 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
37 });
38
39 self.addEventListener('fetch', function(e) {
40 assert_equals(
41 self.registration.scope,
42 normalizeURL('scope/registration-attribute'),
43 'On fetch event, registration attribute should be set');
44 // FIXME: Verify that registration.{installing, waiting} are null.
45 // FIXME: Verify that registration.active is set.
46 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.
47 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698