| 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 23 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['HTTP_ORIGIN'] + image_path; | 44 img.src = host_info['UNAUTHENTICATED_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() { | |
| 64 finish(); | 51 finish(); |
| 65 }; | 52 }; |
| 66 img.onerror = function() { | 53 img.onerror = function() { |
| 67 results += 'FAIL(5)'; | 54 results += 'FAIL(4)'; |
| 68 finish(); | 55 finish(); |
| 69 }; | 56 }; |
| 70 img.src = './dummy?generate-png'; | 57 img.src = './dummy?generate-png'; |
| 71 } | 58 } |
| 72 | 59 |
| 73 function finish() { | 60 function finish() { |
| 74 results += 'finish'; | 61 results += 'finish'; |
| 75 window.parent.postMessage({results: results}, host_info['HTTPS_ORIGIN']); | 62 window.parent.postMessage({results: results}, host_info['HTTPS_ORIGIN']); |
| 76 } | 63 } |
| 77 </script> | 64 </script> |
| 78 | 65 |
| 79 <body onload='test1();'> | 66 <body onload='test1();'> |
| 80 </body> | 67 </body> |
| OLD | NEW |