OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <!-- Regression test for https://crbug.com/464876. On a CORS failure, multiple |
| 3 error messages should not be logged, even if preload occurs. --> |
| 4 <head> |
| 5 </head> |
| 6 |
| 7 <script src="/js-test-resources/js-test.js"></script> |
| 8 |
| 9 <script> |
| 10 window.jsTestIsAsync = true; |
| 11 description('Preload of script with CORS failure only shows one error'); |
| 12 |
| 13 var result = "PASS"; |
| 14 |
| 15 var scriptLoad = function() { |
| 16 testFailed('Script loaded.'); |
| 17 }; |
| 18 |
| 19 var scriptError = function() { |
| 20 if (result === 'PASS') |
| 21 testPassed('Script error.'); |
| 22 else |
| 23 testFailed('Script ran.'); |
| 24 finishJSTest(); |
| 25 }; |
| 26 |
| 27 var checkForPreload = function(url) { |
| 28 if (internals.isPreloaded(url)) |
| 29 testPassed("Did preload."); |
| 30 }; |
| 31 </script> |
| 32 |
| 33 <!-- Force a preload --> |
| 34 <script src="http://127.0.0.1:8000/resources/slow-script.pl?delay=100"></script> |
| 35 <script> |
| 36 checkForPreload("http://localhost:8000/security/resources/cors-script.php?delay=
100&cors=false&value=FAIL"); |
| 37 </script> |
| 38 <script crossorigin="anonymous" src="http://localhost:8000/security/resources/co
rs-script.php?delay=100&cors=false&value=FAIL" onload="scriptLoad()" onerror="sc
riptError();"></script> |
OLD | NEW |