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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/update-claim-worker.php

Issue 2245063003: ServiceWorker: Call SyncMatchingRegistration when document_url is changed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate with nhiroki's comments Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/update-claim-worker.php
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/update-claim-worker.php b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/update-claim-worker.php
new file mode 100644
index 0000000000000000000000000000000000000000..9bc49ed7c49995aac448e6e8841006ba01b5535d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/update-claim-worker.php
@@ -0,0 +1,21 @@
+<?php
+header("Cache-Control: no-cache, must-revalidate");
+header("Pragma: no-cache");
+header('Content-Type:application/javascript');
+
+echo '// ', microtime();
+?>
+
+addEventListener('fetch', function(event) {
+ return;
+ });
nhiroki 2016/08/19 14:32:53 Is this noop handler necessary?
shimazu 2016/08/22 02:38:10 Yes, necessary. This is for the browser not to ski
nhiroki 2016/08/22 06:35:49 I may not still understand this. 'install' and 'a
shimazu 2016/08/22 09:29:40 Yes, install and activate will be fired when regis
nhiroki 2016/08/22 12:41:37 I see, thank you for the clarification. Keeping a
nhiroki 2016/08/23 01:31:46 By the way, if this test depends on Chromium-speci
shimazu 2016/08/23 01:53:52 Added a comment. This optimization has been alrea
+
+addEventListener('install', function(event) {
+ console.log('install; skipwaiting');
nhiroki 2016/08/19 14:32:53 Please remove console logs.
shimazu 2016/08/22 02:38:10 Oops, sorry. Done.
+ self.skipWaiting();
nhiroki 2016/08/19 14:32:54 event.waitUntil(self.skipWaiting()); (I'm assumin
+ });
+
+addEventListener('activate', function(event) {
+ console.log('activated; claim will be called');
nhiroki 2016/08/19 14:32:54 ditto.
shimazu 2016/08/22 02:38:10 Done.
+ self.clients.claim();
nhiroki 2016/08/19 14:32:54 event.waitUntil(self.clients.claim());
shimazu 2016/08/22 02:38:10 Done.
+ });

Powered by Google App Engine
This is Rietveld 408576698