OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_CLIENT_H_ | 5 #ifndef COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_CLIENT_H_ |
6 #define COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_CLIENT_H_ | 6 #define COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_CLIENT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "third_party/WebKit/public/web/WebFrameClient.h" | 12 #include "third_party/WebKit/public/web/WebFrameClient.h" |
13 | 13 |
14 namespace test_runner { | 14 namespace test_runner { |
15 | 15 |
16 class AccessibilityController; | 16 class AccessibilityController; |
17 class TestRunner; | 17 class TestRunner; |
18 class WebFrameTestProxyBase; | 18 class WebFrameTestProxyBase; |
19 class WebTestDelegate; | 19 class WebTestDelegate; |
20 class WebViewTestProxyBase; | 20 class WebViewTestProxyBase; |
21 | 21 |
22 // WebFrameTestClient implements WebFrameClient interface, providing behavior | 22 // WebFrameTestClient implements WebFrameClient interface, providing behavior |
23 // expected by tests. WebFrameTestClient ends up used by WebFrameTestProxy | 23 // expected by tests. WebFrameTestClient ends up used by WebFrameTestProxy |
24 // which coordinates forwarding WebFrameClient calls either to | 24 // which coordinates forwarding WebFrameClient calls either to |
25 // WebFrameTestClient or to the product code (i.e. to RenderFrameImpl). | 25 // WebFrameTestClient or to the product code (i.e. to RenderFrameImpl). |
26 class WebFrameTestClient : public blink::WebFrameClient { | 26 class WebFrameTestClient : public blink::WebFrameClient { |
27 public: | 27 public: |
28 // Caller has to ensure that all arguments (|test_runner|, |delegate| and so | 28 // Caller has to ensure that all arguments (|delegate|, |
29 // forth) live longer than |this|. | 29 // |web_view_test_proxy_base_| and so forth) live longer than |this|. |
30 WebFrameTestClient(TestRunner* test_runner, | 30 WebFrameTestClient(WebTestDelegate* delegate, |
31 WebTestDelegate* delegate, | |
32 WebViewTestProxyBase* web_view_test_proxy_base, | 31 WebViewTestProxyBase* web_view_test_proxy_base, |
33 WebFrameTestProxyBase* web_frame_test_proxy_base); | 32 WebFrameTestProxyBase* web_frame_test_proxy_base); |
34 | 33 |
35 ~WebFrameTestClient() override; | 34 ~WebFrameTestClient() override; |
36 | 35 |
37 // WebFrameClient overrides needed by WebFrameTestProxy. | 36 // WebFrameClient overrides needed by WebFrameTestProxy. |
38 blink::WebColorChooser* createColorChooser( | 37 blink::WebColorChooser* createColorChooser( |
39 blink::WebColorChooserClient* client, | 38 blink::WebColorChooserClient* client, |
40 const blink::WebColor& initial_color, | 39 const blink::WebColor& initial_color, |
41 const blink::WebVector<blink::WebColorSuggestion>& suggestions) override; | 40 const blink::WebVector<blink::WebColorSuggestion>& suggestions) override; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 void checkIfAudioSinkExistsAndIsAuthorized( | 100 void checkIfAudioSinkExistsAndIsAuthorized( |
102 const blink::WebString& sink_id, | 101 const blink::WebString& sink_id, |
103 const blink::WebSecurityOrigin& security_origin, | 102 const blink::WebSecurityOrigin& security_origin, |
104 blink::WebSetSinkIdCallbacks* web_callbacks) override; | 103 blink::WebSetSinkIdCallbacks* web_callbacks) override; |
105 void didClearWindowObject(blink::WebLocalFrame* frame) override; | 104 void didClearWindowObject(blink::WebLocalFrame* frame) override; |
106 bool runFileChooser(const blink::WebFileChooserParams& params, | 105 bool runFileChooser(const blink::WebFileChooserParams& params, |
107 blink::WebFileChooserCompletion* completion) override; | 106 blink::WebFileChooserCompletion* completion) override; |
108 blink::WebEffectiveConnectionType getEffectiveConnectionType() override; | 107 blink::WebEffectiveConnectionType getEffectiveConnectionType() override; |
109 | 108 |
110 private: | 109 private: |
| 110 TestRunner* test_runner(); |
| 111 |
111 // Borrowed pointers to other parts of Layout Tests state. | 112 // Borrowed pointers to other parts of Layout Tests state. |
112 TestRunner* test_runner_; | |
113 WebTestDelegate* delegate_; | 113 WebTestDelegate* delegate_; |
114 WebViewTestProxyBase* web_view_test_proxy_base_; | 114 WebViewTestProxyBase* web_view_test_proxy_base_; |
115 WebFrameTestProxyBase* web_frame_test_proxy_base_; | 115 WebFrameTestProxyBase* web_frame_test_proxy_base_; |
116 | 116 |
117 DISALLOW_COPY_AND_ASSIGN(WebFrameTestClient); | 117 DISALLOW_COPY_AND_ASSIGN(WebFrameTestClient); |
118 }; | 118 }; |
119 | 119 |
120 } // namespace test_runner | 120 } // namespace test_runner |
121 | 121 |
122 #endif // COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_CLIENT_H_ | 122 #endif // COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_CLIENT_H_ |
OLD | NEW |