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

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: Fix same-doc navigation + build, add passing tests 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 3c6fa3cce493d873ec05126e24eadf8d1c523db5..c24d74264186ec2c62184bb812033567c33966da 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;
clamy 2016/07/19 13:50:34 Can it be possible for the new frame to be navigat
blundell 2016/07/21 10:02:18 Yes. The flow is this: - FrameLoader::startLoad()
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