Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / serviceworker / resources / fetch-mixed-content-iframe-inscope-to-outscope.html
blob091e8e4065a755e745d1213ddff7841836631e73
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 = '';
8 function test1() {
9 var img = document.createElement('img');
10 document.body.appendChild(img);
11 img.onload = function() {
12 test2();
14 img.onerror = function() {
15 results += 'FAIL(1)';
16 test2();
18 img.src = host_info['HTTPS_ORIGIN'] + image_path;
21 function test2() {
22 var img = document.createElement('img');
23 document.body.appendChild(img);
24 img.onload = function() {
25 test3();
27 img.onerror = function() {
28 results += 'FAIL(2)';
29 test3();
31 img.src = host_info['HTTPS_REMOTE_ORIGIN'] + image_path;
34 function test3() {
35 var img = document.createElement('img');
36 document.body.appendChild(img);
37 img.onload = function() {
38 results += 'FAIL(3)';
39 test4();
41 img.onerror = function() {
42 test4();
44 img.src = host_info['HTTP_ORIGIN'] + image_path;
47 function test4() {
48 var img = document.createElement('img');
49 document.body.appendChild(img);
50 img.onload = function() {
51 results += 'FAIL(4)';
52 test5();
54 img.onerror = function() {
55 test5();
57 img.src = host_info['HTTP_REMOTE_ORIGIN'] + image_path;
60 function test5() {
61 var img = document.createElement('img');
62 document.body.appendChild(img);
63 img.onload = function() {
64 finish();
66 img.onerror = function() {
67 results += 'FAIL(5)';
68 finish();
70 img.src = './dummy?generate-png';
73 function finish() {
74 results += 'finish';
75 window.parent.postMessage({results: results}, host_info['HTTPS_ORIGIN']);
77 </script>
79 <body onload='test1();'>
80 </body>