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

Unified Diff: components/test_runner/test_runner.cc

Issue 2147633003: PlzNavigate: Eliminate test_runner bailing out of layout tests too early (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to review Created 4 years, 5 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
Index: components/test_runner/test_runner.cc
diff --git a/components/test_runner/test_runner.cc b/components/test_runner/test_runner.cc
index a410ad41192bcebe663e548c2f35664a0ac67662..e75b5185658c48144582b93fbe12922902b05a0b 100644
--- a/components/test_runner/test_runner.cc
+++ b/components/test_runner/test_runner.cc
@@ -1555,6 +1555,7 @@ TestRunner::TestRunner(TestInterfaces* interfaces)
main_view_(nullptr),
mock_content_settings_client_(
new MockContentSettingsClient(&layout_test_runtime_flags_)),
+ is_navigating_(false),
credential_manager_client_(new MockCredentialManagerClient),
mock_screen_orientation_client_(new MockScreenOrientationClient),
spellcheck_(new SpellCheckClient(this)),
@@ -1586,6 +1587,7 @@ void TestRunner::SetMainView(WebView* web_view) {
void TestRunner::Reset() {
is_web_platform_tests_mode_ = false;
+ is_navigating_ = false;
top_loading_frame_ = nullptr;
layout_test_runtime_flags_.Reset();
mock_screen_orientation_client_->ResetData();
@@ -1837,6 +1839,7 @@ bool TestRunner::IsFramePartOfMainTestWindow(blink::WebFrame* frame) const {
}
bool TestRunner::tryToSetTopLoadingFrame(WebFrame* frame) {
+ is_navigating_ = false;
if (!IsFramePartOfMainTestWindow(frame))
return false;
@@ -1850,6 +1853,7 @@ bool TestRunner::tryToSetTopLoadingFrame(WebFrame* frame) {
}
bool TestRunner::tryToClearTopLoadingFrame(WebFrame* frame) {
+ is_navigating_ = false;
if (!IsFramePartOfMainTestWindow(frame))
return false;
@@ -2735,8 +2739,9 @@ void TestRunner::CheckResponseMimeType() {
void TestRunner::NotifyDone() {
if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() &&
- work_queue_.is_empty())
+ !is_navigating_ && work_queue_.is_empty()) {
delegate_->TestFinished();
+ }
layout_test_runtime_flags_.set_wait_until_done(false);
OnLayoutTestRuntimeFlagsChanged();
}

Powered by Google App Engine
This is Rietveld 408576698