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

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

Issue 2928033002: Move GetDocument method from WebFrame to WebLocalFrame. (Closed)
Patch Set: Rebasing... Created 3 years, 6 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 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 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after
1039 test_runner::WebTestInterfaces* interfaces = 1040 test_runner::WebTestInterfaces* interfaces =
1040 LayoutTestRenderThreadObserver::GetInstance()->test_interfaces(); 1041 LayoutTestRenderThreadObserver::GetInstance()->test_interfaces();
1041 if (!interfaces->TestIsRunning()) 1042 if (!interfaces->TestIsRunning())
1042 return; 1043 return;
1043 1044
1044 TestFinished(); 1045 TestFinished();
1045 } 1046 }
1046 1047
1047 void BlinkTestRunner::OnTryLeakDetection() { 1048 void BlinkTestRunner::OnTryLeakDetection() {
1048 blink::WebFrame* main_frame = render_view()->GetWebView()->MainFrame(); 1049 blink::WebFrame* main_frame = render_view()->GetWebView()->MainFrame();
1049 DCHECK_EQ(GURL(url::kAboutBlankURL), GURL(main_frame->GetDocument().Url())); 1050
1050 DCHECK(!main_frame->IsLoading()); 1051 DCHECK(!main_frame->IsLoading());
1052 if (main_frame->IsWebLocalFrame()) {
1053 DCHECK_EQ(GURL(url::kAboutBlankURL),
1054 GURL(main_frame->ToWebLocalFrame()->GetDocument().Url()));
1055 }
1051 1056
1052 leak_detector_->TryLeakDetection(main_frame); 1057 leak_detector_->TryLeakDetection(main_frame);
1053 } 1058 }
1054 1059
1055 void BlinkTestRunner::OnReplyBluetoothManualChooserEvents( 1060 void BlinkTestRunner::OnReplyBluetoothManualChooserEvents(
1056 const std::vector<std::string>& events) { 1061 const std::vector<std::string>& events) {
1057 DCHECK(!get_bluetooth_events_callbacks_.empty()); 1062 DCHECK(!get_bluetooth_events_callbacks_.empty());
1058 base::Callback<void(const std::vector<std::string>&)> callback = 1063 base::Callback<void(const std::vector<std::string>&)> callback =
1059 get_bluetooth_events_callbacks_.front(); 1064 get_bluetooth_events_callbacks_.front();
1060 get_bluetooth_events_callbacks_.pop_front(); 1065 get_bluetooth_events_callbacks_.pop_front();
1061 callback.Run(events); 1066 callback.Run(events);
1062 } 1067 }
1063 1068
1064 void BlinkTestRunner::ReportLeakDetectionResult( 1069 void BlinkTestRunner::ReportLeakDetectionResult(
1065 const LeakDetectionResult& report) { 1070 const LeakDetectionResult& report) {
1066 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); 1071 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report));
1067 } 1072 }
1068 1073
1069 void BlinkTestRunner::OnDestruct() { 1074 void BlinkTestRunner::OnDestruct() {
1070 delete this; 1075 delete this;
1071 } 1076 }
1072 1077
1073 } // namespace content 1078 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698