OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/test_runner/web_test_interfaces.h" | 5 #include "components/test_runner/web_test_interfaces.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "components/test_runner/app_banner_client.h" | 10 #include "components/test_runner/app_banner_client.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 std::unique_ptr<blink::WebAppBannerClient> | 86 std::unique_ptr<blink::WebAppBannerClient> |
87 WebTestInterfaces::CreateAppBannerClient() { | 87 WebTestInterfaces::CreateAppBannerClient() { |
88 std::unique_ptr<AppBannerClient> client(new AppBannerClient); | 88 std::unique_ptr<AppBannerClient> client(new AppBannerClient); |
89 interfaces_->SetAppBannerClient(client.get()); | 89 interfaces_->SetAppBannerClient(client.get()); |
90 return std::move(client); | 90 return std::move(client); |
91 } | 91 } |
92 | 92 |
93 std::unique_ptr<WebFrameTestClient> WebTestInterfaces::CreateWebFrameTestClient( | 93 std::unique_ptr<WebFrameTestClient> WebTestInterfaces::CreateWebFrameTestClient( |
94 WebViewTestProxyBase* web_view_test_proxy_base, | 94 WebViewTestProxyBase* web_view_test_proxy_base, |
95 WebFrameTestProxyBase* web_frame_test_proxy_base) { | 95 WebFrameTestProxyBase* web_frame_test_proxy_base) { |
96 return base::MakeUnique<WebFrameTestClient>( | 96 // TODO(lukasza): Do not pass the WebTestDelegate below - it's lifetime can |
97 interfaces_->GetTestRunner(), interfaces_->GetDelegate(), | 97 // differ from the lifetime of WebFrameTestClient - https://crbug.com/606594. |
98 web_view_test_proxy_base, web_frame_test_proxy_base); | 98 return base::MakeUnique<WebFrameTestClient>(interfaces_->GetDelegate(), |
| 99 web_view_test_proxy_base, |
| 100 web_frame_test_proxy_base); |
99 } | 101 } |
100 | 102 |
101 std::unique_ptr<WebViewTestClient> WebTestInterfaces::CreateWebViewTestClient( | 103 std::unique_ptr<WebViewTestClient> WebTestInterfaces::CreateWebViewTestClient( |
102 WebViewTestProxyBase* web_view_test_proxy_base) { | 104 WebViewTestProxyBase* web_view_test_proxy_base) { |
103 return base::MakeUnique<WebViewTestClient>(interfaces_->GetTestRunner(), | 105 return base::MakeUnique<WebViewTestClient>(web_view_test_proxy_base); |
104 web_view_test_proxy_base); | |
105 } | 106 } |
106 | 107 |
107 std::unique_ptr<WebWidgetTestClient> | 108 std::unique_ptr<WebWidgetTestClient> |
108 WebTestInterfaces::CreateWebWidgetTestClient( | 109 WebTestInterfaces::CreateWebWidgetTestClient( |
109 WebWidgetTestProxyBase* web_widget_test_proxy_base) { | 110 WebWidgetTestProxyBase* web_widget_test_proxy_base) { |
110 return base::MakeUnique<WebWidgetTestClient>(interfaces_->GetTestRunner(), | 111 return base::MakeUnique<WebWidgetTestClient>(interfaces_->GetTestRunner(), |
111 web_widget_test_proxy_base); | 112 web_widget_test_proxy_base); |
112 } | 113 } |
113 | 114 |
114 std::vector<blink::WebView*> WebTestInterfaces::GetWindowList() { | 115 std::vector<blink::WebView*> WebTestInterfaces::GetWindowList() { |
115 std::vector<blink::WebView*> result; | 116 std::vector<blink::WebView*> result; |
116 for (WebViewTestProxyBase* proxy : interfaces_->GetWindowList()) | 117 for (WebViewTestProxyBase* proxy : interfaces_->GetWindowList()) |
117 result.push_back(proxy->web_view()); | 118 result.push_back(proxy->web_view()); |
118 return result; | 119 return result; |
119 } | 120 } |
120 | 121 |
121 } // namespace test_runner | 122 } // namespace test_runner |
OLD | NEW |