OLD | NEW |
1 <script src="../../resources/get-host-info.js?pipe=sub"></script> | 1 <script src="../../resources/get-host-info.js?pipe=sub"></script> |
2 <script src="test-helpers.js"></script> | 2 <script src="test-helpers.js"></script> |
3 <script> | 3 <script> |
4 var image_path = base_path() + 'fetch-access-control.php?PNGIMAGE'; | 4 var image_path = base_path() + 'fetch-access-control.php?PNGIMAGE'; |
5 var host_info = get_host_info(); | 5 var host_info = get_host_info(); |
6 var results = ''; | 6 var results = ''; |
7 | 7 |
8 function test1() { | 8 function test1() { |
9 var img = document.createElement('img'); | 9 var img = document.createElement('img'); |
10 document.body.appendChild(img); | 10 document.body.appendChild(img); |
(...skipping 20 matching lines...) Expand all Loading... |
31 }; | 31 }; |
32 img.src = './dummy?mode=no-cors&url=' + | 32 img.src = './dummy?mode=no-cors&url=' + |
33 encodeURIComponent(host_info['HTTPS_REMOTE_ORIGIN'] + image_path); | 33 encodeURIComponent(host_info['HTTPS_REMOTE_ORIGIN'] + image_path); |
34 } | 34 } |
35 | 35 |
36 function test3() { | 36 function test3() { |
37 var img = document.createElement('img'); | 37 var img = document.createElement('img'); |
38 document.body.appendChild(img); | 38 document.body.appendChild(img); |
39 img.onload = function() { | 39 img.onload = function() { |
40 results += 'FAIL(3)'; | 40 results += 'FAIL(3)'; |
41 test4(); | |
42 }; | |
43 img.onerror = function() { | |
44 test4(); | |
45 }; | |
46 img.src = './dummy?mode=no-cors&url=' + | |
47 encodeURIComponent(host_info['HTTP_ORIGIN'] + image_path); | |
48 } | |
49 | |
50 function test4() { | |
51 var img = document.createElement('img'); | |
52 document.body.appendChild(img); | |
53 img.onload = function() { | |
54 results += 'FAIL(4)'; | |
55 finish(); | 41 finish(); |
56 }; | 42 }; |
57 img.onerror = function() { | 43 img.onerror = function() { |
58 finish(); | 44 finish(); |
59 }; | 45 }; |
60 img.src = './dummy?mode=no-cors&url=' + | 46 img.src = './dummy?mode=no-cors&url=' + |
61 encodeURIComponent(host_info['HTTP_REMOTE_ORIGIN'] + image_path); | 47 encodeURIComponent(host_info['UNAUTHENTICATED_ORIGIN'] + image_path)
; |
62 } | 48 } |
63 | 49 |
64 function finish() { | 50 function finish() { |
65 results += 'finish'; | 51 results += 'finish'; |
66 window.parent.postMessage({results: results}, host_info['HTTPS_ORIGIN']); | 52 window.parent.postMessage({results: results}, host_info['HTTPS_ORIGIN']); |
67 } | 53 } |
68 </script> | 54 </script> |
69 | 55 |
70 <body onload='test1();'> | 56 <body onload='test1();'> |
71 </body> | 57 </body> |
OLD | NEW |