Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / serviceworker / resources / fetch-mixed-content-iframe-inscope-to-inscope.html
blob4ba9bc6995b92029e5fdebaa3ab0f54549629c08
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 = './dummy?url=' +
19 encodeURIComponent(host_info['HTTPS_ORIGIN'] + image_path);
22 function test2() {
23 var img = document.createElement('img');
24 document.body.appendChild(img);
25 img.onload = function() {
26 test3();
28 img.onerror = function() {
29 results += 'FAIL(2)';
30 test3();
32 img.src = './dummy?mode=no-cors&url=' +
33 encodeURIComponent(host_info['HTTPS_REMOTE_ORIGIN'] + image_path);
36 function test3() {
37 var img = document.createElement('img');
38 document.body.appendChild(img);
39 img.onload = function() {
40 results += 'FAIL(3)';
41 test4();
43 img.onerror = function() {
44 test4();
46 img.src = './dummy?mode=no-cors&url=' +
47 encodeURIComponent(host_info['HTTP_ORIGIN'] + image_path);
50 function test4() {
51 var img = document.createElement('img');
52 document.body.appendChild(img);
53 img.onload = function() {
54 results += 'FAIL(4)';
55 finish();
57 img.onerror = function() {
58 finish();
60 img.src = './dummy?mode=no-cors&url=' +
61 encodeURIComponent(host_info['HTTP_REMOTE_ORIGIN'] + image_path);
64 function finish() {
65 results += 'finish';
66 window.parent.postMessage({results: results}, host_info['HTTPS_ORIGIN']);
68 </script>
70 <body onload='test1();'>
71 </body>