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

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: Rebase Created 4 years, 4 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 | « components/test_runner/test_runner.h ('k') | components/test_runner/web_frame_test_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/test_runner/test_runner.cc
diff --git a/components/test_runner/test_runner.cc b/components/test_runner/test_runner.cc
index cf41203f1ffe0ada8dd76989f7c8387154cd1e84..0b4792783a76db8a77643d477b6c39464f0505f7 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_)),
+ will_navigate_(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;
+ will_navigate_ = false;
top_loading_frame_ = nullptr;
layout_test_runtime_flags_.Reset();
mock_screen_orientation_client_->ResetData();
@@ -1836,7 +1838,13 @@ bool TestRunner::IsFramePartOfMainTestWindow(blink::WebFrame* frame) const {
return test_is_running_ && frame->top()->view() == main_view_;
}
+void TestRunner::OnNavigationBegin(WebFrame* frame) {
+ if (IsFramePartOfMainTestWindow(frame))
+ will_navigate_ = true;
+}
+
bool TestRunner::tryToSetTopLoadingFrame(WebFrame* frame) {
+ will_navigate_ = false;
if (!IsFramePartOfMainTestWindow(frame))
return false;
@@ -1850,6 +1858,7 @@ bool TestRunner::tryToSetTopLoadingFrame(WebFrame* frame) {
}
bool TestRunner::tryToClearTopLoadingFrame(WebFrame* frame) {
+ will_navigate_ = false;
if (!IsFramePartOfMainTestWindow(frame))
return false;
@@ -2735,7 +2744,7 @@ void TestRunner::CheckResponseMimeType() {
void TestRunner::NotifyDone() {
if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() &&
- work_queue_.is_empty())
+ !will_navigate_ && work_queue_.is_empty())
delegate_->TestFinished();
layout_test_runtime_flags_.set_wait_until_done(false);
OnLayoutTestRuntimeFlagsChanged();
« no previous file with comments | « components/test_runner/test_runner.h ('k') | components/test_runner/web_frame_test_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698