Chromium Code Reviews| 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 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <clocale> | 9 #include <clocale> |
| 10 #include <cmath> | 10 #include <cmath> |
| (...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 792 | 792 |
| 793 void BlinkTestRunner::DidClearWindowObject(WebLocalFrame* frame) { | 793 void BlinkTestRunner::DidClearWindowObject(WebLocalFrame* frame) { |
| 794 WebTestingSupport::injectInternalsObject(frame); | 794 WebTestingSupport::injectInternalsObject(frame); |
| 795 LayoutTestRenderProcessObserver::GetInstance()->test_interfaces()->BindTo( | 795 LayoutTestRenderProcessObserver::GetInstance()->test_interfaces()->BindTo( |
| 796 frame); | 796 frame); |
| 797 } | 797 } |
| 798 | 798 |
| 799 bool BlinkTestRunner::OnMessageReceived(const IPC::Message& message) { | 799 bool BlinkTestRunner::OnMessageReceived(const IPC::Message& message) { |
| 800 bool handled = true; | 800 bool handled = true; |
| 801 IPC_BEGIN_MESSAGE_MAP(BlinkTestRunner, message) | 801 IPC_BEGIN_MESSAGE_MAP(BlinkTestRunner, message) |
| 802 IPC_MESSAGE_HANDLER(ShellViewMsg_SetTestConfiguration, | |
| 803 OnSetTestConfiguration) | |
| 804 IPC_MESSAGE_HANDLER(ShellViewMsg_SessionHistory, OnSessionHistory) | 802 IPC_MESSAGE_HANDLER(ShellViewMsg_SessionHistory, OnSessionHistory) |
| 805 IPC_MESSAGE_HANDLER(ShellViewMsg_Reset, OnReset) | 803 IPC_MESSAGE_HANDLER(ShellViewMsg_Reset, OnReset) |
| 806 IPC_MESSAGE_HANDLER(ShellViewMsg_NotifyDone, OnNotifyDone) | 804 IPC_MESSAGE_HANDLER(ShellViewMsg_NotifyDone, OnNotifyDone) |
| 807 IPC_MESSAGE_HANDLER(ShellViewMsg_TryLeakDetection, OnTryLeakDetection) | 805 IPC_MESSAGE_HANDLER(ShellViewMsg_TryLeakDetection, OnTryLeakDetection) |
| 808 IPC_MESSAGE_HANDLER(ShellViewMsg_ReplyBluetoothManualChooserEvents, | 806 IPC_MESSAGE_HANDLER(ShellViewMsg_ReplyBluetoothManualChooserEvents, |
| 809 OnReplyBluetoothManualChooserEvents) | 807 OnReplyBluetoothManualChooserEvents) |
| 810 IPC_MESSAGE_HANDLER(ShellViewMsg_LayoutDumpCompleted, OnLayoutDumpCompleted) | 808 IPC_MESSAGE_HANDLER(ShellViewMsg_LayoutDumpCompleted, OnLayoutDumpCompleted) |
| 811 IPC_MESSAGE_UNHANDLED(handled = false) | 809 IPC_MESSAGE_UNHANDLED(handled = false) |
| 812 IPC_END_MESSAGE_MAP() | 810 IPC_END_MESSAGE_MAP() |
| 813 | 811 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 968 | 966 |
| 969 void BlinkTestRunner::CaptureDumpComplete() { | 967 void BlinkTestRunner::CaptureDumpComplete() { |
| 970 render_view()->GetWebView()->mainFrame()->stopLoading(); | 968 render_view()->GetWebView()->mainFrame()->stopLoading(); |
| 971 | 969 |
| 972 base::ThreadTaskRunnerHandle::Get()->PostTask( | 970 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 973 FROM_HERE, base::Bind(base::IgnoreResult(&BlinkTestRunner::Send), | 971 FROM_HERE, base::Bind(base::IgnoreResult(&BlinkTestRunner::Send), |
| 974 base::Unretained(this), | 972 base::Unretained(this), |
| 975 new ShellViewHostMsg_TestFinished(routing_id()))); | 973 new ShellViewHostMsg_TestFinished(routing_id()))); |
| 976 } | 974 } |
| 977 | 975 |
| 978 void BlinkTestRunner::OnSetTestConfiguration( | 976 void BlinkTestRunner::OnReplicateTestConfiguration( |
| 979 const ShellTestConfiguration& params) { | 977 const ShellTestConfiguration& params) { |
| 980 test_config_ = params; | 978 test_config_ = params; |
| 981 is_main_window_ = true; | 979 is_main_window_ = true; |
|
jochen (gone - plz use gerrit)
2016/03/04 12:36:55
there can only be one main window, but now all OOP
Łukasz Anforowicz
2016/03/04 20:49:45
I've addressed your other, similar question here:
| |
| 982 | 980 |
| 983 ForceResizeRenderView( | |
| 984 render_view(), | |
| 985 WebSize(params.initial_size.width(), params.initial_size.height())); | |
| 986 SetFocus(proxy_, true); | |
| 987 | |
| 988 test_runner::WebTestInterfaces* interfaces = | 981 test_runner::WebTestInterfaces* interfaces = |
| 989 LayoutTestRenderProcessObserver::GetInstance()->test_interfaces(); | 982 LayoutTestRenderProcessObserver::GetInstance()->test_interfaces(); |
| 990 interfaces->SetTestIsRunning(true); | 983 interfaces->SetTestIsRunning(true); |
| 991 interfaces->ConfigureForTestWithURL(params.test_url, | 984 interfaces->ConfigureForTestWithURL(params.test_url, |
| 992 params.enable_pixel_dumping); | 985 params.enable_pixel_dumping); |
| 993 } | 986 } |
| 994 | 987 |
| 988 void BlinkTestRunner::OnSetTestConfiguration( | |
| 989 const ShellTestConfiguration& params) { | |
| 990 OnReplicateTestConfiguration(params); | |
| 991 | |
| 992 ForceResizeRenderView( | |
| 993 render_view(), | |
| 994 WebSize(params.initial_size.width(), params.initial_size.height())); | |
| 995 SetFocus(proxy_, true); | |
| 996 } | |
| 997 | |
| 995 void BlinkTestRunner::OnSessionHistory( | 998 void BlinkTestRunner::OnSessionHistory( |
| 996 const std::vector<int>& routing_ids, | 999 const std::vector<int>& routing_ids, |
| 997 const std::vector<std::vector<PageState>>& session_histories, | 1000 const std::vector<std::vector<PageState>>& session_histories, |
| 998 const std::vector<unsigned>& current_entry_indexes) { | 1001 const std::vector<unsigned>& current_entry_indexes) { |
| 999 routing_ids_ = routing_ids; | 1002 routing_ids_ = routing_ids; |
| 1000 session_histories_ = session_histories; | 1003 session_histories_ = session_histories; |
| 1001 current_entry_indexes_ = current_entry_indexes; | 1004 current_entry_indexes_ = current_entry_indexes; |
| 1002 CaptureDump(); | 1005 CaptureDump(); |
| 1003 } | 1006 } |
| 1004 | 1007 |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 1034 get_bluetooth_events_callbacks_.pop_front(); | 1037 get_bluetooth_events_callbacks_.pop_front(); |
| 1035 callback.Run(events); | 1038 callback.Run(events); |
| 1036 } | 1039 } |
| 1037 | 1040 |
| 1038 void BlinkTestRunner::ReportLeakDetectionResult( | 1041 void BlinkTestRunner::ReportLeakDetectionResult( |
| 1039 const LeakDetectionResult& report) { | 1042 const LeakDetectionResult& report) { |
| 1040 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); | 1043 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); |
| 1041 } | 1044 } |
| 1042 | 1045 |
| 1043 } // namespace content | 1046 } // namespace content |
| OLD | NEW |