| 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 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 const std::vector<int>& routing_ids, | 1015 const std::vector<int>& routing_ids, |
| 1016 const std::vector<std::vector<PageState>>& session_histories, | 1016 const std::vector<std::vector<PageState>>& session_histories, |
| 1017 const std::vector<unsigned>& current_entry_indexes) { | 1017 const std::vector<unsigned>& current_entry_indexes) { |
| 1018 routing_ids_ = routing_ids; | 1018 routing_ids_ = routing_ids; |
| 1019 session_histories_ = session_histories; | 1019 session_histories_ = session_histories; |
| 1020 current_entry_indexes_ = current_entry_indexes; | 1020 current_entry_indexes_ = current_entry_indexes; |
| 1021 CaptureDump(); | 1021 CaptureDump(); |
| 1022 } | 1022 } |
| 1023 | 1023 |
| 1024 void BlinkTestRunner::OnReset() { | 1024 void BlinkTestRunner::OnReset() { |
| 1025 // ShellViewMsg_Reset should always be sent to the *current* view. |
| 1026 DCHECK(render_view()->GetWebView()->MainFrame()->IsWebLocalFrame()); |
| 1027 WebLocalFrame* main_frame = |
| 1028 render_view()->GetWebView()->MainFrame()->ToWebLocalFrame(); |
| 1029 |
| 1025 LayoutTestRenderThreadObserver::GetInstance()->test_interfaces()->ResetAll(); | 1030 LayoutTestRenderThreadObserver::GetInstance()->test_interfaces()->ResetAll(); |
| 1026 Reset(true /* for_new_test */); | 1031 Reset(true /* for_new_test */); |
| 1027 // Navigating to about:blank will make sure that no new loads are initiated | 1032 // Navigating to about:blank will make sure that no new loads are initiated |
| 1028 // by the renderer. | 1033 // by the renderer. |
| 1029 WebURLRequest request = WebURLRequest(GURL(url::kAboutBlankURL)); | 1034 main_frame->LoadRequest(WebURLRequest(GURL(url::kAboutBlankURL))); |
| 1030 render_view()->GetWebView()->MainFrame()->LoadRequest(request); | |
| 1031 Send(new ShellViewHostMsg_ResetDone(routing_id())); | 1035 Send(new ShellViewHostMsg_ResetDone(routing_id())); |
| 1032 } | 1036 } |
| 1033 | 1037 |
| 1034 void BlinkTestRunner::OnTestFinishedInSecondaryRenderer() { | 1038 void BlinkTestRunner::OnTestFinishedInSecondaryRenderer() { |
| 1035 DCHECK(is_main_window_ && render_view()->GetMainRenderFrame()); | 1039 DCHECK(is_main_window_ && render_view()->GetMainRenderFrame()); |
| 1036 | 1040 |
| 1037 // Avoid a situation where TestFinished is called twice, because | 1041 // Avoid a situation where TestFinished is called twice, because |
| 1038 // of a racey test finish in 2 secondary renderers. | 1042 // of a racey test finish in 2 secondary renderers. |
| 1039 test_runner::WebTestInterfaces* interfaces = | 1043 test_runner::WebTestInterfaces* interfaces = |
| 1040 LayoutTestRenderThreadObserver::GetInstance()->test_interfaces(); | 1044 LayoutTestRenderThreadObserver::GetInstance()->test_interfaces(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1064 void BlinkTestRunner::ReportLeakDetectionResult( | 1068 void BlinkTestRunner::ReportLeakDetectionResult( |
| 1065 const LeakDetectionResult& report) { | 1069 const LeakDetectionResult& report) { |
| 1066 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); | 1070 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); |
| 1067 } | 1071 } |
| 1068 | 1072 |
| 1069 void BlinkTestRunner::OnDestruct() { | 1073 void BlinkTestRunner::OnDestruct() { |
| 1070 delete this; | 1074 delete this; |
| 1071 } | 1075 } |
| 1072 | 1076 |
| 1073 } // namespace content | 1077 } // namespace content |
| OLD | NEW |