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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-sync-onerror-not-repeated.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-sync-onerror-not-repeated.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-sync-onerror-not-repeated.html
new file mode 100644
index 0000000000000000000000000000000000000000..d0a65ddeba061657ea45cf6587b878bbec9e8a3c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-sync-onerror-not-repeated.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../../resources/js-test.js"></script>
+<script>
+function loadScript(url, async, onload, onerror) {
+ var script = document.createElement("script");
+ script.async = async;
+ script.onload = onload;
+ if (onerror)
+ script.onerror = onerror;
+ script.src = url;
+ document.head.appendChild(script);
+}
+</script>
+</head>
+<body>
+<script>
+description("Script that fails to load should not dispatch multiple error events");
+
+window.jsTestIsAsync = true;
+
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
+
+var numberOfTimesOnErrorHandlerHasRun = 0;
+function step2() {
+ shouldBeZero("numberOfTimesOnErrorHandlerHasRun");
+ numberOfTimesOnErrorHandlerHasRun++;
+ // Issue another script load so as to have the script runner
+ // revisit its script queue. It must not include the sync script
+ // that triggered the dispatch of an error event and the running of
+ // this handler.
+ loadScript("resources/script-load.js", true, finishJSTest);
+}
+
+function unexpectedLoad() {
+ testFailed("Script should not have loaded");
+ finishJSTest();
+}
+
+loadScript("non-existing.js", false, unexpectedLoad, step2);
+</script>
+</body>
+</html>
« 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