2 <!-- Regression test for https://crbug.com/464876. On a CORS failure, multiple
3 error messages should not be logged, even if preload occurs. -->
7 <script src=
"/js-test-resources/js-test.js"></script>
10 window
.jsTestIsAsync
= true;
11 description('Preload of script with CORS failure only shows one error');
15 var scriptLoad = function() {
16 testFailed('Script loaded.');
19 var scriptError = function() {
20 if (result
=== 'PASS')
21 testPassed('Script error.');
23 testFailed('Script ran.');
27 var checkForPreload = function(url
) {
28 if (internals
.isPreloaded(url
))
29 testPassed("Did preload.");
33 <!-- Force a preload -->
34 <script src=
"http://127.0.0.1:8000/resources/slow-script.pl?delay=100"></script>
36 checkForPreload("http://localhost:8000/security/resources/cors-script.php?delay=100&cors=false&value=FAIL");
38 <script crossorigin=
"anonymous" src=
"http://localhost:8000/security/resources/cors-script.php?delay=100&cors=false&value=FAIL" onload=
"scriptLoad()" onerror=
"scriptError();"></script>