OLD | NEW |
(Empty) | |
| 1 <script> |
| 2 var img = document.createElement('img'); |
| 3 img.crossOrigin = location.search.match(/crossOrigin=(anonymous|use-credentials)
/)[1]; |
| 4 |
| 5 // After verifying that the image is loaded correctly, we |
| 6 // must also check whether the renderer accepts the resource. |
| 7 // The replies are delayed to allow tests to close the tabs in case |
| 8 // the test failed at an early stage. |
| 9 img.onerror = function() { |
| 10 setTimeout(function() { |
| 11 // Should not happen. Failure is signaled to allow the unit tests to con
tinue |
| 12 // with the next test, the exact value of the next string does not matte
r. |
| 13 new Image().src = '/signal_that_image_failed_to_load'; |
| 14 }, 500); |
| 15 }; |
| 16 img.onload = function() { |
| 17 setTimeout(function() { |
| 18 // Verified in test_blocking.js |
| 19 new Image().src = '/signal_that_image_loaded_successfully'; |
| 20 }, 500); |
| 21 }; |
| 22 |
| 23 img.src = decodeURIComponent(location.search.match(/src=([^&]+)/)[1]); |
| 24 </script> |
OLD | NEW |