| OLD | NEW |
| 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 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <clocale> | 10 #include <clocale> |
| (...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 OnReplyBluetoothManualChooserEvents) | 737 OnReplyBluetoothManualChooserEvents) |
| 738 IPC_MESSAGE_HANDLER(ShellViewMsg_LayoutDumpCompleted, OnLayoutDumpCompleted) | 738 IPC_MESSAGE_HANDLER(ShellViewMsg_LayoutDumpCompleted, OnLayoutDumpCompleted) |
| 739 IPC_MESSAGE_UNHANDLED(handled = false) | 739 IPC_MESSAGE_UNHANDLED(handled = false) |
| 740 IPC_END_MESSAGE_MAP() | 740 IPC_END_MESSAGE_MAP() |
| 741 | 741 |
| 742 return handled; | 742 return handled; |
| 743 } | 743 } |
| 744 | 744 |
| 745 void BlinkTestRunner::Navigate(const GURL& url) { | 745 void BlinkTestRunner::Navigate(const GURL& url) { |
| 746 focus_on_next_commit_ = true; | 746 focus_on_next_commit_ = true; |
| 747 if (!is_main_window_ && | |
| 748 LayoutTestRenderProcessObserver::GetInstance()->main_test_runner() == | |
| 749 this) { | |
| 750 test_runner::WebTestInterfaces* interfaces = | |
| 751 LayoutTestRenderProcessObserver::GetInstance()->test_interfaces(); | |
| 752 interfaces->SetTestIsRunning(true); | |
| 753 interfaces->ConfigureForTestWithURL(GURL(), false); | |
| 754 ForceResizeRenderView(render_view(), WebSize(800, 600)); | |
| 755 } | |
| 756 } | 747 } |
| 757 | 748 |
| 758 void BlinkTestRunner::DidCommitProvisionalLoad(WebLocalFrame* frame, | 749 void BlinkTestRunner::DidCommitProvisionalLoad(WebLocalFrame* frame, |
| 759 bool is_new_navigation) { | 750 bool is_new_navigation) { |
| 760 if (!focus_on_next_commit_) | 751 if (!focus_on_next_commit_) |
| 761 return; | 752 return; |
| 762 focus_on_next_commit_ = false; | 753 focus_on_next_commit_ = false; |
| 763 render_view()->GetWebView()->setFocusedFrame(frame); | 754 render_view()->GetWebView()->setFocusedFrame(frame); |
| 764 } | 755 } |
| 765 | 756 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 | 888 |
| 898 mojom::LayoutTestBluetoothFakeAdapterSetter& | 889 mojom::LayoutTestBluetoothFakeAdapterSetter& |
| 899 BlinkTestRunner::GetBluetoothFakeAdapterSetter() { | 890 BlinkTestRunner::GetBluetoothFakeAdapterSetter() { |
| 900 if (!bluetooth_fake_adapter_setter_) { | 891 if (!bluetooth_fake_adapter_setter_) { |
| 901 RenderThread::Get()->GetServiceRegistry()->ConnectToRemoteService( | 892 RenderThread::Get()->GetServiceRegistry()->ConnectToRemoteService( |
| 902 mojo::GetProxy(&bluetooth_fake_adapter_setter_)); | 893 mojo::GetProxy(&bluetooth_fake_adapter_setter_)); |
| 903 } | 894 } |
| 904 return *bluetooth_fake_adapter_setter_; | 895 return *bluetooth_fake_adapter_setter_; |
| 905 } | 896 } |
| 906 | 897 |
| 898 void BlinkTestRunner::OnSetupSecondaryRenderer() { |
| 899 DCHECK(!is_main_window_); |
| 900 |
| 901 test_runner::WebTestInterfaces* interfaces = |
| 902 LayoutTestRenderProcessObserver::GetInstance()->test_interfaces(); |
| 903 interfaces->SetTestIsRunning(true); |
| 904 interfaces->ConfigureForTestWithURL(GURL(), false); |
| 905 ForceResizeRenderView(render_view(), WebSize(800, 600)); |
| 906 } |
| 907 |
| 907 void BlinkTestRunner::OnReplicateTestConfiguration( | 908 void BlinkTestRunner::OnReplicateTestConfiguration( |
| 908 const ShellTestConfiguration& params) { | 909 const ShellTestConfiguration& params) { |
| 909 test_config_ = params; | 910 test_config_ = params; |
| 910 is_main_window_ = true; | 911 is_main_window_ = true; |
| 911 | 912 |
| 912 test_runner::WebTestInterfaces* interfaces = | 913 test_runner::WebTestInterfaces* interfaces = |
| 913 LayoutTestRenderProcessObserver::GetInstance()->test_interfaces(); | 914 LayoutTestRenderProcessObserver::GetInstance()->test_interfaces(); |
| 914 interfaces->SetTestIsRunning(true); | 915 interfaces->SetTestIsRunning(true); |
| 915 interfaces->ConfigureForTestWithURL(params.test_url, | 916 interfaces->ConfigureForTestWithURL(params.test_url, |
| 916 params.enable_pixel_dumping); | 917 params.enable_pixel_dumping); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 get_bluetooth_events_callbacks_.pop_front(); | 972 get_bluetooth_events_callbacks_.pop_front(); |
| 972 callback.Run(events); | 973 callback.Run(events); |
| 973 } | 974 } |
| 974 | 975 |
| 975 void BlinkTestRunner::ReportLeakDetectionResult( | 976 void BlinkTestRunner::ReportLeakDetectionResult( |
| 976 const LeakDetectionResult& report) { | 977 const LeakDetectionResult& report) { |
| 977 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); | 978 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); |
| 978 } | 979 } |
| 979 | 980 |
| 980 } // namespace content | 981 } // namespace content |
| OLD | NEW |