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 13f30a302d973daf4c7a7e3b3b05c304fc53bff9..34da98a985c218573cc6822b9eda97fe82515d82 100644 |
--- a/content/shell/renderer/layout_test/blink_test_runner.cc |
+++ b/content/shell/renderer/layout_test/blink_test_runner.cc |
@@ -34,6 +34,7 @@ |
#include "components/test_runner/layout_dump_flags.h" |
#include "components/test_runner/mock_screen_orientation_client.h" |
#include "components/test_runner/test_interfaces.h" |
+#include "components/test_runner/tracked_dictionary.h" |
#include "components/test_runner/web_task.h" |
#include "components/test_runner/web_test_interfaces.h" |
#include "components/test_runner/web_test_proxy.h" |
@@ -78,6 +79,7 @@ |
#include "third_party/WebKit/public/web/WebDevToolsAgent.h" |
#include "third_party/WebKit/public/web/WebDocument.h" |
#include "third_party/WebKit/public/web/WebElement.h" |
+#include "third_party/WebKit/public/web/WebFrame.h" |
#include "third_party/WebKit/public/web/WebHistoryItem.h" |
#include "third_party/WebKit/public/web/WebKit.h" |
#include "third_party/WebKit/public/web/WebLeakDetector.h" |
@@ -96,6 +98,7 @@ using blink::WebDeviceOrientationData; |
using blink::WebElement; |
using blink::WebLocalFrame; |
using blink::WebHistoryItem; |
+using blink::WebFrame; |
using blink::WebLocalFrame; |
using blink::WebPoint; |
using blink::WebRect; |
@@ -610,6 +613,34 @@ void BlinkTestRunner::SetLocale(const std::string& locale) { |
setlocale(LC_ALL, locale.c_str()); |
} |
+void BlinkTestRunner::OnLayoutDumpFlagsChanged( |
+ test_runner::LayoutDumpFlags* layout_dump_flags) { |
+ // Ignore changes that happen before we got the initial, accumulated |
+ // layout flag changes in ShellViewMsg_ReplicateTestConfiguration. |
+ if (!is_main_window_) |
+ return; |
+ |
+ const base::DictionaryValue& changed_values = |
+ layout_dump_flags->tracked_dictionary().changed_values(); |
+ |
+ // Message needs to be send via a local frame to eventually reach |
+ // WebContentsObserver via OnMessage(..., RenderFrameHost*) overload - this |
+ // lets BlinkTestController figure out the originator of the message. |
+ RenderFrame* local_frame = nullptr; |
+ for (WebFrame* frame = render_view()->GetWebView()->mainFrame(); frame; |
+ frame = frame->traverseNext(false)) { |
+ if (frame->isWebLocalFrame()) { |
+ local_frame = RenderFrame::FromWebFrame(frame); |
+ break; |
+ } |
+ } |
+ DCHECK(local_frame); |
+ Send(new ShellViewHostMsg_LayoutDumpFlagsChanged(local_frame->GetRoutingID(), |
+ changed_values)); |
+ |
+ layout_dump_flags->tracked_dictionary().ResetChangeTracking(); |
+} |
+ |
void BlinkTestRunner::TestFinished() { |
if (!is_main_window_ || !render_view()->GetMainRenderFrame()) { |
Send(new ShellViewHostMsg_TestFinishedInSecondaryRenderer(routing_id())); |
@@ -896,8 +927,7 @@ void BlinkTestRunner::CaptureDump() { |
return; |
} |
- Send( |
- new ShellViewHostMsg_InitiateLayoutDump(routing_id(), layout_dump_flags)); |
+ Send(new ShellViewHostMsg_InitiateLayoutDump(routing_id())); |
// OnLayoutDumpCompleted will be eventually called by an IPC from the browser. |
} |