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

Unified Diff: components/test_runner/test_runner.cc

Issue 1908233002: One and only one top-loading-frame across all renderers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@split-setTopLoadingFrame-into-set-and-clear
Patch Set: Comment tweak on |have_top_loading_frame| flag. Created 4 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 | « components/test_runner/layout_test_runtime_flags.cc ('k') | no next file » | 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 b668843775086dfa8b2c64a0961c1fa6a073ae89..2d0597ab35ef5f5941235f9e3da67d9e2a826413 100644
--- a/components/test_runner/test_runner.cc
+++ b/components/test_runner/test_runner.cc
@@ -1832,9 +1832,9 @@ void TestRunner::DumpPixelsAsync(
void TestRunner::ReplicateLayoutTestRuntimeFlagsChanges(
const base::DictionaryValue& changed_values) {
- DCHECK(test_is_running_);
- layout_test_runtime_flags_.tracked_dictionary().ApplyUntrackedChanges(
- changed_values);
+ if (test_is_running_)
+ layout_test_runtime_flags_.tracked_dictionary().ApplyUntrackedChanges(
+ changed_values);
}
bool TestRunner::HasCustomTextDump(std::string* custom_text_dump) const {
@@ -1944,10 +1944,12 @@ bool TestRunner::tryToSetTopLoadingFrame(WebFrame* frame) {
if (!IsFramePartOfMainTestWindow(frame))
return false;
- if (top_loading_frame_)
+ if (top_loading_frame_ || layout_test_runtime_flags_.have_top_loading_frame())
return false;
top_loading_frame_ = frame;
+ layout_test_runtime_flags_.set_have_top_loading_frame(true);
+ OnLayoutTestRuntimeFlagsChanged();
return true;
}
@@ -1959,6 +1961,10 @@ bool TestRunner::tryToClearTopLoadingFrame(WebFrame* frame) {
return false;
top_loading_frame_ = nullptr;
+ DCHECK(layout_test_runtime_flags_.have_top_loading_frame());
+ layout_test_runtime_flags_.set_have_top_loading_frame(false);
+ OnLayoutTestRuntimeFlagsChanged();
+
LocationChangeDone();
return true;
}
@@ -3127,6 +3133,8 @@ void TestRunnerForSpecificView::CapturePixelsAsyncThen(
void TestRunner::OnLayoutTestRuntimeFlagsChanged() {
if (layout_test_runtime_flags_.tracked_dictionary().changed_values().empty())
return;
+ if (!test_is_running_)
+ return;
delegate_->OnLayoutTestRuntimeFlagsChanged(
layout_test_runtime_flags_.tracked_dictionary().changed_values());
« no previous file with comments | « components/test_runner/layout_test_runtime_flags.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698