Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-sync-onerror-not-repeated.html

Issue 1424703007: Upon load failure, remove sync script from pending queue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add release assert Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-sync-onerror-not-repeated-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 <script>
6 function loadScript(url, async, onload, onerror) {
7 var script = document.createElement("script");
8 script.async = async;
9 script.onload = onload;
10 if (onerror)
11 script.onerror = onerror;
12 script.src = url;
13 document.head.appendChild(script);
14 }
15 </script>
16 </head>
17 <body>
18 <script>
19 description("Script that fails to load should not dispatch multiple error events ");
20
21 window.jsTestIsAsync = true;
22
23 if (window.testRunner) {
24 testRunner.dumpAsText();
25 testRunner.waitUntilDone();
26 }
27
28 var numberOfTimesOnErrorHandlerHasRun = 0;
29 function step2() {
30 shouldBeZero("numberOfTimesOnErrorHandlerHasRun");
31 numberOfTimesOnErrorHandlerHasRun++;
32 // Issue another script load so as to have the script runner
33 // revisit its script queue. It must not include the sync script
34 // that triggered the dispatch of an error event and the running of
35 // this handler.
36 loadScript("resources/script-load.js", true, finishJSTest);
37 }
38
39 function unexpectedLoad() {
40 testFailed("Script should not have loaded");
41 finishJSTest();
42 }
43
44 loadScript("non-existing.js", false, unexpectedLoad, step2);
45 </script>
46 </body>
47 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-sync-onerror-not-repeated-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698