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

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

Issue 1332303002: Make registration.update() no longer force bypassing the HTTP cache (1/2) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Create a test file to split tests. Created 5 years, 2 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/resources/update-served-from-cache-worker.php » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <?php 1 <?php
2 // Force the browser to cache this script. update() should always bypass this 2 // update() does not bypass cache so set the max-age to 0 such that update()
3 // cache and fetch a new version. 3 // can find a new version in the network.
4 header('Cache-Control: max-age=86400'); 4 header('Cache-Control: max-age=0');
5 5
6 // Return a different script for each access. 6 // Return a different script for each access.
7 header('Content-Type:application/javascript'); 7 header('Content-Type:application/javascript');
8 echo '// ' . microtime(); 8 echo '// ' . microtime();
9 ?> 9 ?>
10 10
11 importScripts('../../resources/test-helpers.js'); 11 importScripts('../../resources/test-helpers.js');
12 importScripts('../../resources/worker-testharness.js'); 12 importScripts('../../resources/worker-testharness.js');
13 13
14 var events_seen = []; 14 var events_seen = [];
(...skipping 11 matching lines...) Expand all
26 e.respondWith(new Response(events_seen)); 26 e.respondWith(new Response(events_seen));
27 }); 27 });
28 28
29 self.addEventListener('message', function(e) { 29 self.addEventListener('message', function(e) {
30 events_seen.push('message'); 30 events_seen.push('message');
31 self.registration.update(); 31 self.registration.update();
32 }); 32 });
33 33
34 // update() during the script evaluation should be ignored. 34 // update() during the script evaluation should be ignored.
35 self.registration.update(); 35 self.registration.update();
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/resources/update-served-from-cache-worker.php » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698