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

Unified Diff: content/shell/renderer/layout_test/blink_test_runner.cc

Issue 2852753003: Gracefully handle tests finishing simultanously in 2+ secondary windows. (Closed)
Patch Set: Adding regression tests for https://crbug.com/716085#c10. Created 3 years, 8 months 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/http/tests/misc/tests-finishing-simultaneously.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/renderer/layout_test/blink_test_runner.cc
diff --git a/content/shell/renderer/layout_test/blink_test_runner.cc b/content/shell/renderer/layout_test/blink_test_runner.cc
index d9bdf7ef78feee2a9005ee237b5c86aec5ea2f52..22b5710d9c5abbdb8676e1cbd17e1e41986385e4 100644
--- a/content/shell/renderer/layout_test/blink_test_runner.cc
+++ b/content/shell/renderer/layout_test/blink_test_runner.cc
@@ -1032,6 +1032,14 @@ void BlinkTestRunner::OnReset() {
void BlinkTestRunner::OnTestFinishedInSecondaryRenderer() {
DCHECK(is_main_window_ && render_view()->GetMainRenderFrame());
+
+ // Avoid a situation where TestFinished is called twice, because
+ // of a racey test finish in 2 secondary renderers.
+ test_runner::WebTestInterfaces* interfaces =
+ LayoutTestRenderThreadObserver::GetInstance()->test_interfaces();
+ if (!interfaces->TestIsRunning())
+ return;
+
TestFinished();
}
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/misc/tests-finishing-simultaneously.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698