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

Side by Side Diff: content/shell/renderer/layout_test/blink_test_runner.cc

Issue 1805243002: Make test_runner::LayoutDumpFlags an internal detail of components/test_runner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-mock-screen-orientation-dep
Patch Set: Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer/layout_test/blink_test_runner.h" 5 #include "content/shell/renderer/layout_test/blink_test_runner.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <clocale> 9 #include <clocale>
10 #include <cmath> 10 #include <cmath>
(...skipping 12 matching lines...) Expand all
23 #include "base/strings/string_util.h" 23 #include "base/strings/string_util.h"
24 #include "base/strings/stringprintf.h" 24 #include "base/strings/stringprintf.h"
25 #include "base/strings/sys_string_conversions.h" 25 #include "base/strings/sys_string_conversions.h"
26 #include "base/strings/utf_string_conversions.h" 26 #include "base/strings/utf_string_conversions.h"
27 #include "base/thread_task_runner_handle.h" 27 #include "base/thread_task_runner_handle.h"
28 #include "base/time/time.h" 28 #include "base/time/time.h"
29 #include "base/values.h" 29 #include "base/values.h"
30 #include "build/build_config.h" 30 #include "build/build_config.h"
31 #include "components/plugins/renderer/plugin_placeholder.h" 31 #include "components/plugins/renderer/plugin_placeholder.h"
32 #include "components/test_runner/gamepad_controller.h" 32 #include "components/test_runner/gamepad_controller.h"
33 #include "components/test_runner/layout_dump.h"
34 #include "components/test_runner/layout_dump_flags.h"
35 #include "components/test_runner/test_interfaces.h" 33 #include "components/test_runner/test_interfaces.h"
36 #include "components/test_runner/web_task.h" 34 #include "components/test_runner/web_task.h"
37 #include "components/test_runner/web_test_interfaces.h" 35 #include "components/test_runner/web_test_interfaces.h"
38 #include "components/test_runner/web_test_proxy.h" 36 #include "components/test_runner/web_test_proxy.h"
39 #include "components/test_runner/web_test_runner.h" 37 #include "components/test_runner/web_test_runner.h"
40 #include "content/public/common/content_switches.h" 38 #include "content/public/common/content_switches.h"
41 #include "content/public/common/url_constants.h" 39 #include "content/public/common/url_constants.h"
42 #include "content/public/common/web_preferences.h" 40 #include "content/public/common/web_preferences.h"
43 #include "content/public/renderer/media_stream_api.h" 41 #include "content/public/renderer/media_stream_api.h"
44 #include "content/public/renderer/render_frame.h" 42 #include "content/public/renderer/render_frame.h"
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 return; 876 return;
879 } 877 }
880 878
881 std::string custom_text_dump; 879 std::string custom_text_dump;
882 if (interfaces->TestRunner()->HasCustomTextDump(&custom_text_dump)) { 880 if (interfaces->TestRunner()->HasCustomTextDump(&custom_text_dump)) {
883 Send(new ShellViewHostMsg_TextDump(routing_id(), custom_text_dump + "\n")); 881 Send(new ShellViewHostMsg_TextDump(routing_id(), custom_text_dump + "\n"));
884 CaptureDumpContinued(); 882 CaptureDumpContinued();
885 return; 883 return;
886 } 884 }
887 885
888 const test_runner::LayoutDumpFlags& layout_dump_flags = 886 if (!interfaces->TestRunner()->IsRecursiveLayoutDumpRequested()) {
889 interfaces->TestRunner()->GetLayoutDumpFlags(); 887 std::string layout_dump = interfaces->TestRunner()->DumpLayout(
890 if (!layout_dump_flags.dump_child_frames()) { 888 render_view()->GetMainRenderFrame()->GetWebFrame());
891 std::string layout_dump = DumpLayout(
892 render_view()->GetMainRenderFrame()->GetWebFrame(), layout_dump_flags);
893 OnLayoutDumpCompleted(layout_dump); 889 OnLayoutDumpCompleted(layout_dump);
894 return; 890 return;
895 } 891 }
896 892
897 Send(new ShellViewHostMsg_InitiateLayoutDump(routing_id())); 893 Send(new ShellViewHostMsg_InitiateLayoutDump(routing_id()));
898 // OnLayoutDumpCompleted will be eventually called by an IPC from the browser. 894 // OnLayoutDumpCompleted will be eventually called by an IPC from the browser.
899 } 895 }
900 896
901 void BlinkTestRunner::OnLayoutDumpCompleted(std::string completed_layout_dump) { 897 void BlinkTestRunner::OnLayoutDumpCompleted(std::string completed_layout_dump) {
902 test_runner::WebTestInterfaces* interfaces = 898 test_runner::WebTestInterfaces* interfaces =
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 get_bluetooth_events_callbacks_.pop_front(); 1026 get_bluetooth_events_callbacks_.pop_front();
1031 callback.Run(events); 1027 callback.Run(events);
1032 } 1028 }
1033 1029
1034 void BlinkTestRunner::ReportLeakDetectionResult( 1030 void BlinkTestRunner::ReportLeakDetectionResult(
1035 const LeakDetectionResult& report) { 1031 const LeakDetectionResult& report) {
1036 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); 1032 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report));
1037 } 1033 }
1038 1034
1039 } // namespace content 1035 } // namespace content
OLDNEW
« no previous file with comments | « components/test_runner/web_test_runner.h ('k') | content/shell/renderer/layout_test/layout_test_render_frame_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698