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

Side by Side Diff: LayoutTests/http/tests/serviceworker/fetch-request-no-freshness-headers.html

Issue 703813002: [ServiceWorker] Disable the cache revalidation when the page is controlled by the ServiceWorker. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incorporated nhiroki's comment Created 6 years, 1 month 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/empty.js » ('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 <!DOCTYPE html>
2 <title>Service Worker: the headers of FetchEvent shouldn't contain freshness hea ders</title>
3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script>
5 <script src="resources/test-helpers.js?pipe=sub"></script>
6 <script>
7 async_test(function(t) {
8 var SCOPE = 'resources/fetch-request-no-freshness-headers-iframe.html';
9 var SCRIPT = 'resources/fetch-request-no-freshness-headers-worker.js';
10 var worker;
11 service_worker_unregister_and_register(t, SCRIPT, SCOPE)
12 .then(function(registration) {
13 return wait_for_update(t, registration);
14 })
15 .then(function(sw) {
16 worker = sw;
17 return wait_for_state(t, sw, 'activated');
18 })
19 .then(function() { return with_iframe(SCOPE); })
20 .then(function(frame) {
21 return new Promise(function(resolve) {
22 frame.onload = function() {
23 resolve(frame);
24 };
25 frame.contentWindow.location.reload();
26 });
27 })
28 .then(function(frame) {
29 return new Promise(function(resolve) {
30 var channel = new MessageChannel();
31 channel.port1.onmessage = t.step_func(function(msg) {
32 unload_iframe(frame);
33 resolve(msg);
34 });
35 worker.postMessage(
36 {port: channel.port2}, [channel.port2]);
37 });
38 })
39 .then(function(msg) {
40 var freshness_headers = {
41 'if-none-match': true,
42 'if-modified-since': true
43 };
44 msg.data.requests.forEach(t.step_func(function(request) {
45 request.headers.forEach(t.step_func(function(header) {
46 assert_false(
47 !!freshness_headers[header[0]],
48 header[0] + ' header must not be set in the ' +
49 'FetchEvent\'s request. (url = ' + request.url + ')');
50 }));
51 }))
52 service_worker_unregister_and_done(t, SCOPE);
53 })
54 .catch(unreached_rejection(t));
55 }, 'The headers of FetchEvent shouldn\'t contain freshness headers.');
56 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/resources/empty.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698