OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ | 5 #ifndef COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ |
6 #define COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ | 6 #define COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <utility> | 9 #include <utility> |
9 | 10 |
10 #include "base/logging.h" | 11 #include "base/logging.h" |
11 #include "base/macros.h" | 12 #include "base/macros.h" |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "components/test_runner/test_runner_export.h" | 13 #include "components/test_runner/test_runner_export.h" |
14 #include "components/test_runner/web_frame_test_client.h" | 14 #include "components/test_runner/web_frame_test_client.h" |
15 #include "third_party/WebKit/public/platform/WebString.h" | 15 #include "third_party/WebKit/public/platform/WebString.h" |
16 #include "third_party/WebKit/public/web/WebFrameClient.h" | 16 #include "third_party/WebKit/public/web/WebFrameClient.h" |
17 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 17 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
18 | 18 |
19 namespace test_runner { | 19 namespace test_runner { |
20 | 20 |
21 class TEST_RUNNER_EXPORT WebFrameTestProxyBase { | 21 class TEST_RUNNER_EXPORT WebFrameTestProxyBase { |
22 public: | 22 public: |
23 void set_test_client(scoped_ptr<WebFrameTestClient> client) { | 23 void set_test_client(std::unique_ptr<WebFrameTestClient> client) { |
24 DCHECK(client); | 24 DCHECK(client); |
25 DCHECK(!test_client_); | 25 DCHECK(!test_client_); |
26 test_client_ = std::move(client); | 26 test_client_ = std::move(client); |
27 } | 27 } |
28 | 28 |
29 protected: | 29 protected: |
30 WebFrameTestProxyBase(); | 30 WebFrameTestProxyBase(); |
31 ~WebFrameTestProxyBase(); | 31 ~WebFrameTestProxyBase(); |
32 blink::WebFrameClient* test_client() { return test_client_.get(); } | 32 blink::WebFrameClient* test_client() { return test_client_.get(); } |
33 | 33 |
34 private: | 34 private: |
35 scoped_ptr<WebFrameTestClient> test_client_; | 35 std::unique_ptr<WebFrameTestClient> test_client_; |
36 | 36 |
37 DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxyBase); | 37 DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxyBase); |
38 }; | 38 }; |
39 | 39 |
40 // WebTestProxy is used during LayoutTests and always instantiated, at time of | 40 // WebTestProxy is used during LayoutTests and always instantiated, at time of |
41 // writing with Base=RenderFrameImpl. It does not directly inherit from it for | 41 // writing with Base=RenderFrameImpl. It does not directly inherit from it for |
42 // layering purposes. | 42 // layering purposes. |
43 template <class Base, typename P> | 43 template <class Base, typename P> |
44 class WebFrameTestProxy : public Base, public WebFrameTestProxyBase { | 44 class WebFrameTestProxy : public Base, public WebFrameTestProxyBase { |
45 public: | 45 public: |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 Base::didClearWindowObject(frame); | 291 Base::didClearWindowObject(frame); |
292 } | 292 } |
293 | 293 |
294 private: | 294 private: |
295 DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxy); | 295 DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxy); |
296 }; | 296 }; |
297 | 297 |
298 } // namespace test_runner | 298 } // namespace test_runner |
299 | 299 |
300 #endif // COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ | 300 #endif // COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ |
OLD | NEW |