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

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 DCHECK_EQ(GURL(url::kAboutBlankURL),
1051 url::Origin(main_frame->GetSecurityOrigin()).GetURL());
dcheng 2017/06/15 23:17:00 I'm a little surprised this works -- wouldn't the
Łukasz Anforowicz 2017/06/16 19:39:24 Oops - thanks for catching this. I didn't catch t
1050 DCHECK(!main_frame->IsLoading()); 1052 DCHECK(!main_frame->IsLoading());
1051 1053
1052 leak_detector_->TryLeakDetection(main_frame); 1054 leak_detector_->TryLeakDetection(main_frame);
Łukasz Anforowicz 2017/06/16 19:39:24 FWIW, the argument (i.e. |main_frame|) above is on
dcheng 2017/06/20 09:02:21 Yeah, seems odd. We probably need to go through an
1053 } 1055 }
1054 1056
1055 void BlinkTestRunner::OnReplyBluetoothManualChooserEvents( 1057 void BlinkTestRunner::OnReplyBluetoothManualChooserEvents(
1056 const std::vector<std::string>& events) { 1058 const std::vector<std::string>& events) {
1057 DCHECK(!get_bluetooth_events_callbacks_.empty()); 1059 DCHECK(!get_bluetooth_events_callbacks_.empty());
1058 base::Callback<void(const std::vector<std::string>&)> callback = 1060 base::Callback<void(const std::vector<std::string>&)> callback =
1059 get_bluetooth_events_callbacks_.front(); 1061 get_bluetooth_events_callbacks_.front();
1060 get_bluetooth_events_callbacks_.pop_front(); 1062 get_bluetooth_events_callbacks_.pop_front();
1061 callback.Run(events); 1063 callback.Run(events);
1062 } 1064 }
1063 1065
1064 void BlinkTestRunner::ReportLeakDetectionResult( 1066 void BlinkTestRunner::ReportLeakDetectionResult(
1065 const LeakDetectionResult& report) { 1067 const LeakDetectionResult& report) {
1066 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); 1068 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report));
1067 } 1069 }
1068 1070
1069 void BlinkTestRunner::OnDestruct() { 1071 void BlinkTestRunner::OnDestruct() {
1070 delete this; 1072 delete this;
1071 } 1073 }
1072 1074
1073 } // namespace content 1075 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698