Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / serviceworker / resources / referer-iframe.html
blob071e084007a1dfc28c06827c59778cbd323995a3
1 <script src="../../resources/get-host-info.js"></script>
2 <script>
3 function check_referer(url, expected_referer) {
4 return fetch(url)
5 .then(function(res) { return res.json(); })
6 .then(function(headers) {
7 if (headers['Referer'] === expected_referer) {
8 return Promise.resolve();
9 } else {
10 return Promise.reject('Referer for ' + url + ' must be ' +
11 expected_referer + ' but got ' +
12 headers['Referer']);
14 });
17 window.addEventListener('message', function(evt) {
18 var host_info = get_host_info();
19 var port = evt.ports[0];
20 check_referer('request-headers.php?ignore=true',
21 host_info['HTTP_ORIGIN'] +
22 '/serviceworker/resources/referer-iframe.html')
23 .then(function() {
24 return check_referer(
25 'request-headers.php',
26 host_info['HTTP_ORIGIN'] +
27 '/serviceworker/resources/referer-iframe.html');
29 .then(function() {
30 return check_referer(
31 'request-headers.php?url=request-headers.php',
32 host_info['HTTP_ORIGIN'] +
33 '/serviceworker/resources/fetch-rewrite-worker.js');
35 .then(function() { port.postMessage({results: 'finish'}); })
36 .catch(function(e) { port.postMessage({results: 'failure:' + e}); });
37 });
38 </script>