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

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

Issue 900793002: ServiceWorker: Support SWRegistration.unregister() in SWGlobalScope [2/2] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: update layout tests and header comment Created 5 years, 10 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/unregister.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 function matchQuery(query) {
2 return self.location.href.indexOf(query) != -1;
3 }
4
5 if (matchQuery('?evaluation'))
6 self.registration.unregister();
7
8 self.addEventListener('install', function(e) {
9 if (matchQuery('?install'))
10 self.registration.unregister();
11 });
12
13 self.addEventListener('activate', function(e) {
14 if (matchQuery('?activate'))
15 self.registration.unregister();
16 });
17
18 self.addEventListener('message', function(e) {
19 self.registration.unregister()
20 .then(function(result) {
21 e.data.port.postMessage({result: result});
22 });
23 });
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/unregister.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698