OLD | NEW |
1 <script src="../../resources/get-host-info.js?pipe=sub"></script> | 1 <script src="../resources/get-host-info.sub.js"></script> |
2 <script src="test-helpers.js"></script> | 2 <script src="test-helpers.sub.js?pipe=sub"></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.py?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); |
11 img.onload = function() { | 11 img.onload = function() { |
12 test2(); | 12 test2(); |
13 }; | 13 }; |
14 img.onerror = function() { | 14 img.onerror = function() { |
(...skipping 19 matching lines...) Expand all Loading... |
34 function test3() { | 34 function test3() { |
35 var img = document.createElement('img'); | 35 var img = document.createElement('img'); |
36 document.body.appendChild(img); | 36 document.body.appendChild(img); |
37 img.onload = function() { | 37 img.onload = function() { |
38 results += 'FAIL(3)'; | 38 results += 'FAIL(3)'; |
39 test4(); | 39 test4(); |
40 }; | 40 }; |
41 img.onerror = function() { | 41 img.onerror = function() { |
42 test4(); | 42 test4(); |
43 }; | 43 }; |
44 img.src = host_info['UNAUTHENTICATED_ORIGIN'] + image_path; | 44 img.src = host_info['HTTP_ORIGIN'] + image_path; |
45 } | 45 } |
46 | 46 |
47 function test4() { | 47 function test4() { |
48 var img = document.createElement('img'); | 48 var img = document.createElement('img'); |
49 document.body.appendChild(img); | 49 document.body.appendChild(img); |
50 img.onload = function() { | 50 img.onload = function() { |
| 51 results += 'FAIL(4)'; |
| 52 test5(); |
| 53 }; |
| 54 img.onerror = function() { |
| 55 test5(); |
| 56 }; |
| 57 img.src = host_info['HTTP_REMOTE_ORIGIN'] + image_path; |
| 58 } |
| 59 |
| 60 function test5() { |
| 61 var img = document.createElement('img'); |
| 62 document.body.appendChild(img); |
| 63 img.onload = function() { |
51 finish(); | 64 finish(); |
52 }; | 65 }; |
53 img.onerror = function() { | 66 img.onerror = function() { |
54 results += 'FAIL(4)'; | 67 results += 'FAIL(5)'; |
55 finish(); | 68 finish(); |
56 }; | 69 }; |
57 img.src = './dummy?generate-png'; | 70 img.src = './dummy?generate-png'; |
58 } | 71 } |
59 | 72 |
60 function finish() { | 73 function finish() { |
61 results += 'finish'; | 74 results += 'finish'; |
62 window.parent.postMessage({results: results}, host_info['HTTPS_ORIGIN']); | 75 window.parent.postMessage({results: results}, host_info['HTTPS_ORIGIN']); |
63 } | 76 } |
64 </script> | 77 </script> |
65 | 78 |
66 <body onload='test1();'> | 79 <body onload='test1();'> |
67 </body> | 80 </body> |
OLD | NEW |