Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / serviceworker / fetch-request-no-freshness-headers.html
blob333953fa769860a59c35200a6adebe2af782f558
1 <!DOCTYPE html>
2 <title>Service Worker: the headers of FetchEvent shouldn't contain freshness headers</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 worker = registration.installing;
14 return wait_for_state(t, worker, 'activated');
16 .then(function() { return with_iframe(SCOPE); })
17 .then(function(frame) {
18 return new Promise(function(resolve) {
19 frame.onload = function() {
20 resolve(frame);
22 frame.contentWindow.location.reload();
23 });
25 .then(function(frame) {
26 return new Promise(function(resolve) {
27 var channel = new MessageChannel();
28 channel.port1.onmessage = t.step_func(function(msg) {
29 frame.remove();
30 resolve(msg);
31 });
32 worker.postMessage(
33 {port: channel.port2}, [channel.port2]);
34 });
36 .then(function(msg) {
37 var freshness_headers = {
38 'if-none-match': true,
39 'if-modified-since': true
41 msg.data.requests.forEach(t.step_func(function(request) {
42 request.headers.forEach(t.step_func(function(header) {
43 assert_false(
44 !!freshness_headers[header[0]],
45 header[0] + ' header must not be set in the ' +
46 'FetchEvent\'s request. (url = ' + request.url + ')');
47 }));
48 }))
49 service_worker_unregister_and_done(t, SCOPE);
51 .catch(unreached_rejection(t));
52 }, 'The headers of FetchEvent shouldn\'t contain freshness headers.');
53 </script>