Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / serviceworker / resources / fetch-csp-iframe.html
blob0beea19f76385b99c88429dfd8d730e33978760f
1 <script src="../../resources/get-host-info.js"></script>
2 <script src="test-helpers.js?pipe=sub"></script>
3 <script>
4 var image_path = base_path() + 'fetch-access-control.php?PNGIMAGE';
5 var host_info = get_host_info();
6 var results = '';
7 var port = undefined;
9 var meta = document.createElement('meta');
10 meta.setAttribute('http-equiv', 'Content-Security-Policy');
11 meta.setAttribute('content', 'img-src ' + host_info['HTTP_ORIGIN'] +
12 '; script-src \'unsafe-inline\'');
13 document.head.appendChild(meta);
15 function test1() {
16 var img = document.createElement('img');
17 document.body.appendChild(img);
18 img.onload = function() {
19 test2();
21 img.onerror = function() {
22 results += 'FAIL(1)';
23 test2();
25 img.src = host_info['HTTP_ORIGIN'] + image_path;
28 function test2() {
29 var img = document.createElement('img');
30 document.body.appendChild(img);
31 img.onload = function() {
32 results += 'FAIL(2)';
33 test3();
35 img.onerror = function() {
36 test3();
38 img.src = host_info['HTTP_REMOTE_ORIGIN'] + image_path;
41 function test3() {
42 var img = document.createElement('img');
43 document.body.appendChild(img);
44 img.onload = function() {
45 test4();
47 img.onerror = function() {
48 results += 'FAIL(3)';
49 test4();
51 img.src = './dummy?url=' +
52 encodeURIComponent(host_info['HTTP_ORIGIN'] + image_path);
55 function test4() {
56 var img = document.createElement('img');
57 document.body.appendChild(img);
58 img.onload = function() {
59 results += 'FAIL(4)';
60 finish();
62 img.onerror = function() {
63 finish();
65 img.src = './dummy?mode=no-cors&url=' +
66 encodeURIComponent(host_info['HTTP_REMOTE_ORIGIN'] + image_path);
69 function finish() {
70 results += 'finish';
71 port.postMessage({results: results});
74 window.addEventListener('message', function(evt) {
75 port = evt.ports[0];
76 test1();
77 }, false);
78 </script>