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

Side by Side Diff: LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/resources/update-worker.php

Issue 1177563005: ServiceWorker: Implement ServiceWorkerRegistration.update() (3) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@implement_update_1
Patch Set: incorporate falken@'s comments Created 5 years, 6 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/update.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 <?php
2 // Force the browser to cache this script. update() should always bypass this
3 // cache and fetch a new version.
4 header('Cache-Control: max-age=86400');
5
6 // Return a different script for each access.
7 header('Content-Type:application/javascript');
8 echo '// ' . microtime();
9 ?>
10
11 importScripts('../../resources/test-helpers.js');
12 importScripts('../../resources/worker-testharness.js');
13
14 var events_seen = [];
15
16 self.registration.addEventListener('updatefound', function() {
17 events_seen.push('updatefound');
18 });
19
20 self.addEventListener('activate', function(e) {
21 events_seen.push('activate');
22 });
23
24 self.addEventListener('fetch', function(e) {
25 events_seen.push('fetch');
26 e.respondWith(new Response(events_seen));
27 });
28
29 self.addEventListener('message', function(e) {
30 events_seen.push('message');
31 self.registration.update();
32 });
33
34 // update() during the script evaluation should be ignored.
35 self.registration.update();
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/update.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698