| 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> |
| 11 #include <cmath> | 11 #include <cmath> |
| 12 #include <memory> | 12 #include <memory> |
| 13 #include <string> |
| 13 #include <utility> | 14 #include <utility> |
| 14 | 15 |
| 15 #include "base/base64.h" | 16 #include "base/base64.h" |
| 16 #include "base/command_line.h" | 17 #include "base/command_line.h" |
| 17 #include "base/compiler_specific.h" | 18 #include "base/compiler_specific.h" |
| 18 #include "base/debug/debugger.h" | 19 #include "base/debug/debugger.h" |
| 19 #include "base/files/file_path.h" | 20 #include "base/files/file_path.h" |
| 20 #include "base/location.h" | 21 #include "base/location.h" |
| 21 #include "base/macros.h" | 22 #include "base/macros.h" |
| 22 #include "base/md5.h" | 23 #include "base/md5.h" |
| (...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1043 test_runner::WebTestInterfaces* interfaces = | 1044 test_runner::WebTestInterfaces* interfaces = |
| 1044 LayoutTestRenderThreadObserver::GetInstance()->test_interfaces(); | 1045 LayoutTestRenderThreadObserver::GetInstance()->test_interfaces(); |
| 1045 if (!interfaces->TestIsRunning()) | 1046 if (!interfaces->TestIsRunning()) |
| 1046 return; | 1047 return; |
| 1047 | 1048 |
| 1048 TestFinished(); | 1049 TestFinished(); |
| 1049 } | 1050 } |
| 1050 | 1051 |
| 1051 void BlinkTestRunner::OnTryLeakDetection() { | 1052 void BlinkTestRunner::OnTryLeakDetection() { |
| 1052 blink::WebFrame* main_frame = render_view()->GetWebView()->MainFrame(); | 1053 blink::WebFrame* main_frame = render_view()->GetWebView()->MainFrame(); |
| 1053 DCHECK_EQ(GURL(url::kAboutBlankURL), GURL(main_frame->GetDocument().Url())); | 1054 |
| 1054 DCHECK(!main_frame->IsLoading()); | 1055 DCHECK(!main_frame->IsLoading()); |
| 1056 if (main_frame->IsWebLocalFrame()) { |
| 1057 DCHECK_EQ(GURL(url::kAboutBlankURL), |
| 1058 GURL(main_frame->ToWebLocalFrame()->GetDocument().Url())); |
| 1059 } |
| 1055 | 1060 |
| 1056 leak_detector_->TryLeakDetection(main_frame); | 1061 leak_detector_->TryLeakDetection(main_frame); |
| 1057 } | 1062 } |
| 1058 | 1063 |
| 1059 void BlinkTestRunner::OnReplyBluetoothManualChooserEvents( | 1064 void BlinkTestRunner::OnReplyBluetoothManualChooserEvents( |
| 1060 const std::vector<std::string>& events) { | 1065 const std::vector<std::string>& events) { |
| 1061 DCHECK(!get_bluetooth_events_callbacks_.empty()); | 1066 DCHECK(!get_bluetooth_events_callbacks_.empty()); |
| 1062 base::Callback<void(const std::vector<std::string>&)> callback = | 1067 base::Callback<void(const std::vector<std::string>&)> callback = |
| 1063 get_bluetooth_events_callbacks_.front(); | 1068 get_bluetooth_events_callbacks_.front(); |
| 1064 get_bluetooth_events_callbacks_.pop_front(); | 1069 get_bluetooth_events_callbacks_.pop_front(); |
| 1065 callback.Run(events); | 1070 callback.Run(events); |
| 1066 } | 1071 } |
| 1067 | 1072 |
| 1068 void BlinkTestRunner::ReportLeakDetectionResult( | 1073 void BlinkTestRunner::ReportLeakDetectionResult( |
| 1069 const LeakDetectionResult& report) { | 1074 const LeakDetectionResult& report) { |
| 1070 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); | 1075 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); |
| 1071 } | 1076 } |
| 1072 | 1077 |
| 1073 void BlinkTestRunner::OnDestruct() { | 1078 void BlinkTestRunner::OnDestruct() { |
| 1074 delete this; | 1079 delete this; |
| 1075 } | 1080 } |
| 1076 | 1081 |
| 1077 } // namespace content | 1082 } // namespace content |
| OLD | NEW |