OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/shell/browser/layout_test/blink_test_controller.h" | 5 #include "content/shell/browser/layout_test/blink_test_controller.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <iostream> | 9 #include <iostream> |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
12 #include "base/base64.h" | 12 #include "base/base64.h" |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
15 #include "base/location.h" | 15 #include "base/location.h" |
16 #include "base/logging.h" | 16 #include "base/logging.h" |
17 #include "base/run_loop.h" | 17 #include "base/run_loop.h" |
18 #include "base/single_thread_task_runner.h" | 18 #include "base/single_thread_task_runner.h" |
19 #include "base/strings/string_number_conversions.h" | 19 #include "base/strings/string_number_conversions.h" |
20 #include "base/strings/stringprintf.h" | 20 #include "base/strings/stringprintf.h" |
21 #include "base/thread_task_runner_handle.h" | 21 #include "base/thread_task_runner_handle.h" |
22 #include "build/build_config.h" | 22 #include "build/build_config.h" |
| 23 #include "components/test_runner/layout_dump_flags.h" |
23 #include "content/public/browser/devtools_agent_host.h" | 24 #include "content/public/browser/devtools_agent_host.h" |
24 #include "content/public/browser/dom_storage_context.h" | 25 #include "content/public/browser/dom_storage_context.h" |
25 #include "content/public/browser/gpu_data_manager.h" | 26 #include "content/public/browser/gpu_data_manager.h" |
26 #include "content/public/browser/navigation_controller.h" | 27 #include "content/public/browser/navigation_controller.h" |
27 #include "content/public/browser/navigation_entry.h" | 28 #include "content/public/browser/navigation_entry.h" |
28 #include "content/public/browser/notification_service.h" | 29 #include "content/public/browser/notification_service.h" |
29 #include "content/public/browser/notification_types.h" | 30 #include "content/public/browser/notification_types.h" |
30 #include "content/public/browser/render_frame_host.h" | 31 #include "content/public/browser/render_frame_host.h" |
31 #include "content/public/browser/render_process_host.h" | 32 #include "content/public/browser/render_process_host.h" |
32 #include "content/public/browser/render_view_host.h" | 33 #include "content/public/browser/render_view_host.h" |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 printer_->PrintAudioFooter(); | 637 printer_->PrintAudioFooter(); |
637 } | 638 } |
638 | 639 |
639 void BlinkTestController::OnTextDump(const std::string& dump) { | 640 void BlinkTestController::OnTextDump(const std::string& dump) { |
640 printer_->PrintTextHeader(); | 641 printer_->PrintTextHeader(); |
641 printer_->PrintTextBlock(dump); | 642 printer_->PrintTextBlock(dump); |
642 printer_->PrintTextFooter(); | 643 printer_->PrintTextFooter(); |
643 } | 644 } |
644 | 645 |
645 void BlinkTestController::OnInitiateLayoutDump( | 646 void BlinkTestController::OnInitiateLayoutDump( |
646 test_runner::LayoutDumpFlags layout_dump_flags) { | 647 const test_runner::LayoutDumpFlags& layout_dump_flags) { |
647 DCHECK(layout_dump_flags.dump_child_frames); | 648 DCHECK(layout_dump_flags.dump_child_frames()); |
648 pending_layout_dumps_ = main_window_->web_contents()->SendToAllFrames( | 649 pending_layout_dumps_ = main_window_->web_contents()->SendToAllFrames( |
649 new ShellViewMsg_LayoutDumpRequest(MSG_ROUTING_NONE, layout_dump_flags)); | 650 new ShellViewMsg_LayoutDumpRequest(MSG_ROUTING_NONE, layout_dump_flags)); |
650 } | 651 } |
651 | 652 |
652 void BlinkTestController::OnLayoutDumpResponse(RenderFrameHost* sender, | 653 void BlinkTestController::OnLayoutDumpResponse(RenderFrameHost* sender, |
653 const std::string& dump) { | 654 const std::string& dump) { |
654 // Store the result. | 655 // Store the result. |
655 auto pair = frame_to_layout_dump_map_.insert( | 656 auto pair = frame_to_layout_dump_map_.insert( |
656 std::make_pair(sender->GetFrameTreeNodeId(), dump)); | 657 std::make_pair(sender->GetFrameTreeNodeId(), dump)); |
657 bool insertion_took_place = pair.second; | 658 bool insertion_took_place = pair.second; |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 } else { | 854 } else { |
854 printer_->AddErrorMessage(base::StringPrintf( | 855 printer_->AddErrorMessage(base::StringPrintf( |
855 "FAIL: Unexpected sendBluetoothManualChooserEvent() event name '%s'.", | 856 "FAIL: Unexpected sendBluetoothManualChooserEvent() event name '%s'.", |
856 event_name.c_str())); | 857 event_name.c_str())); |
857 return; | 858 return; |
858 } | 859 } |
859 bluetooth_chooser_factory_->SendEvent(event, argument); | 860 bluetooth_chooser_factory_->SendEvent(event, argument); |
860 } | 861 } |
861 | 862 |
862 } // namespace content | 863 } // namespace content |
OLD | NEW |