| Index: content/shell/browser/layout_test/blink_test_controller.cc
|
| diff --git a/content/shell/browser/layout_test/blink_test_controller.cc b/content/shell/browser/layout_test/blink_test_controller.cc
|
| index 803041c0dd22052a70345e1cfb13a85d66b0666b..486e512a59b26ec70d4c038186cc19aab33fa364 100644
|
| --- a/content/shell/browser/layout_test/blink_test_controller.cc
|
| +++ b/content/shell/browser/layout_test/blink_test_controller.cc
|
| @@ -7,6 +7,7 @@
|
| #include <stddef.h>
|
|
|
| #include <iostream>
|
| +#include <set>
|
| #include <utility>
|
|
|
| #include "base/base64.h"
|
| @@ -269,6 +270,7 @@ bool BlinkTestController::PrepareForLayoutTest(
|
| printer_->reset();
|
| frame_to_layout_dump_map_.clear();
|
| render_process_host_observer_.RemoveAll();
|
| + accumulated_layout_dump_flags_changes_.Clear();
|
| ShellBrowserContext* browser_context =
|
| ShellContentBrowserClient::Get()->browser_context();
|
| if (test_url.spec().find("compositing/") != std::string::npos)
|
| @@ -404,6 +406,8 @@ bool BlinkTestController::OnMessageReceived(const IPC::Message& message) {
|
| IPC_MESSAGE_HANDLER(ShellViewHostMsg_TextDump, OnTextDump)
|
| IPC_MESSAGE_HANDLER(ShellViewHostMsg_InitiateLayoutDump,
|
| OnInitiateLayoutDump)
|
| + IPC_MESSAGE_HANDLER(ShellViewHostMsg_LayoutDumpFlagsChanged,
|
| + OnLayoutDumpFlagsChanged)
|
| IPC_MESSAGE_HANDLER(ShellViewHostMsg_ImageDump, OnImageDump)
|
| IPC_MESSAGE_HANDLER(ShellViewHostMsg_AudioDump, OnAudioDump)
|
| IPC_MESSAGE_HANDLER(ShellViewHostMsg_OverridePreferences,
|
| @@ -601,7 +605,7 @@ void BlinkTestController::HandleNewRenderFrameHost(RenderFrameHost* frame) {
|
| new ShellViewMsg_SetTestConfiguration(frame->GetRoutingID(), params));
|
| } else {
|
| frame->Send(new ShellViewMsg_ReplicateTestConfiguration(
|
| - frame->GetRoutingID(), params));
|
| + frame->GetRoutingID(), params, accumulated_layout_dump_flags_changes_));
|
| }
|
| }
|
|
|
| @@ -667,11 +671,31 @@ void BlinkTestController::OnTextDump(const std::string& dump) {
|
| printer_->PrintTextFooter();
|
| }
|
|
|
| -void BlinkTestController::OnInitiateLayoutDump(
|
| - const test_runner::LayoutDumpFlags& layout_dump_flags) {
|
| - DCHECK(layout_dump_flags.dump_child_frames());
|
| +void BlinkTestController::OnInitiateLayoutDump() {
|
| pending_layout_dumps_ = main_window_->web_contents()->SendToAllFrames(
|
| - new ShellViewMsg_LayoutDumpRequest(MSG_ROUTING_NONE, layout_dump_flags));
|
| + new ShellViewMsg_LayoutDumpRequest(MSG_ROUTING_NONE));
|
| +}
|
| +
|
| +void BlinkTestController::OnLayoutDumpFlagsChanged(
|
| + const base::DictionaryValue& changed_layout_dump_flags,
|
| + const std::string& change_originator_guid) {
|
| + accumulated_layout_dump_flags_changes_.MergeDictionary(
|
| + &changed_layout_dump_flags);
|
| +
|
| + std::set<int> already_covered_process_ids;
|
| + for (RenderFrameHost* frame : main_window_->web_contents()->GetAllFrames()) {
|
| + // TODO(lukasza): Skip original sender of the change notification.
|
| + // Note - this is not just perf optimization - we also don't want to
|
| + // clobber changes that might have happened in the original sender
|
| + // since it sent the notification.
|
| + bool inserted =
|
| + already_covered_process_ids.insert(frame->GetProcess()->GetID()).second;
|
| + if (inserted) {
|
| + frame->Send(new ShellViewMsg_ReplicateLayoutDumpFlagsChanges(
|
| + frame->GetRoutingID(), changed_layout_dump_flags,
|
| + change_originator_guid));
|
| + }
|
| + }
|
| }
|
|
|
| void BlinkTestController::OnLayoutDumpResponse(RenderFrameHost* sender,
|
|
|