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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/misc/script-sync-slow-scripts-onerror.html

Issue 1449413002: Deflake http/tests/misc/script-sync-slow-scripts-onerror.html (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: third_party/WebKit/LayoutTests/http/tests/misc/script-sync-slow-scripts-onerror.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/misc/script-sync-slow-scripts-onerror.html b/third_party/WebKit/LayoutTests/http/tests/misc/script-sync-slow-scripts-onerror.html
index 31138b6df7b4337eaa221b2988ff43d70e5a7e50..e2108459781ddd87b9e6fc0459f594d4c9d1b9db 100644
--- a/third_party/WebKit/LayoutTests/http/tests/misc/script-sync-slow-scripts-onerror.html
+++ b/third_party/WebKit/LayoutTests/http/tests/misc/script-sync-slow-scripts-onerror.html
@@ -25,22 +25,27 @@ if (window.testRunner) {
testRunner.waitUntilDone();
}
-var firstOnErrorHandlerHasRun = false;
+var firstOnErrorHandlerCount = 0;
+var secondOnErrorHandlerCount = 0;
+function verifyAndFinish() {
+ shouldBe("firstOnErrorHandlerCount", "1");
+ shouldBe("secondOnErrorHandlerCount", "1");
+ finishJSTest();
+};
+
function failedFirst() {
- shouldBeFalse("firstOnErrorHandlerHasRun");
- firstOnErrorHandlerHasRun = true;
+ firstOnErrorHandlerCount++;
// Issue another script load so as to have the script runner
// revisit its script queue. This should not result in this
// onerror handler running again.
- loadScript("resources/success.js?1", true);
+ var continuation = secondOnErrorHandlerCount ? verifyAndFinish : undefined;
+ loadScript("resources/success.js?1", true, continuation);
}
-var secondOnErrorHandlerHasRun = false;
function failedSecond() {
- shouldBeTrue("firstOnErrorHandlerHasRun");
- shouldBeFalse("secondOnErrorHandlerHasRun");
- secondOnErrorHandlerHasRun = true;
- loadScript("resources/success.js?2", true, finishJSTest);
+ secondOnErrorHandlerCount++;
+ var continuation = firstOnErrorHandlerCount ? verifyAndFinish : undefined;
+ loadScript("resources/success.js?2", true, continuation);
}
function unexpectedLoad() {

Powered by Google App Engine
This is Rietveld 408576698