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

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 review comments 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...
27 // - registration.installing is set.
28 // - registration.{waiting, active} are null.
29 // (http://crbug.com/437677)
30 });
31
32 self.addEventListener('activate', function(e) {
33 assert_equals(
34 self.registration.scope,
35 normalizeURL('scope/registration-attribute'),
36 'On activate event, registration attribute should be set');
37 // FIXME: Verify that...
38 // - registration.{installing, waiting} are null.
39 // - registration.active is set.
40 // (http://crbug.com/437677)
41 });
42
43 self.addEventListener('fetch', function(e) {
44 assert_equals(
45 self.registration.scope,
46 normalizeURL('scope/registration-attribute'),
47 'On fetch event, registration attribute should be set');
48 // FIXME: Verify that...
49 // - registration.{installing, waiting} are null.
50 // - registration.active is set.
51 // (http://crbug.com/437677)
52 e.respondWith(new Response('PASS'));
53 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698