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 CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_TEST_PROXY_H_ | 5 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_TEST_PROXY_H_ |
6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_TEST_PROXY_H_ | 6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_TEST_PROXY_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "content/shell/renderer/test_runner/web_task.h" | 15 #include "content/shell/renderer/test_runner/web_task.h" |
16 #include "third_party/WebKit/public/platform/WebCompositeAndReadbackAsyncCallbac k.h" | 16 #include "third_party/WebKit/public/platform/WebCompositeAndReadbackAsyncCallbac k.h" |
tkent
2014/09/18 06:01:29
Move this line to .cc.
keishi
2014/09/18 09:14:17
Done.
| |
17 #include "third_party/WebKit/public/platform/WebRect.h" | 17 #include "third_party/WebKit/public/platform/WebRect.h" |
18 #include "third_party/WebKit/public/platform/WebScreenInfo.h" | 18 #include "third_party/WebKit/public/platform/WebScreenInfo.h" |
19 #include "third_party/WebKit/public/platform/WebURLError.h" | 19 #include "third_party/WebKit/public/platform/WebURLError.h" |
20 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 20 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
21 #include "third_party/WebKit/public/web/WebAXEnums.h" | 21 #include "third_party/WebKit/public/web/WebAXEnums.h" |
22 #include "third_party/WebKit/public/web/WebDOMMessageEvent.h" | 22 #include "third_party/WebKit/public/web/WebDOMMessageEvent.h" |
23 #include "third_party/WebKit/public/web/WebDataSource.h" | 23 #include "third_party/WebKit/public/web/WebDataSource.h" |
24 #include "third_party/WebKit/public/web/WebDragOperation.h" | 24 #include "third_party/WebKit/public/web/WebDragOperation.h" |
25 #include "third_party/WebKit/public/web/WebFrame.h" | 25 #include "third_party/WebKit/public/web/WebFrame.h" |
26 #include "third_party/WebKit/public/web/WebFrameClient.h" | 26 #include "third_party/WebKit/public/web/WebFrameClient.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 class SpellCheckClient; | 86 class SpellCheckClient; |
87 class TestInterfaces; | 87 class TestInterfaces; |
88 class WebTestDelegate; | 88 class WebTestDelegate; |
89 class WebTestInterfaces; | 89 class WebTestInterfaces; |
90 | 90 |
91 // WebTestProxyBase is the "brain" of WebTestProxy in the sense that | 91 // WebTestProxyBase is the "brain" of WebTestProxy in the sense that |
92 // WebTestProxy does the bridge between RenderViewImpl and WebTestProxyBase and | 92 // WebTestProxy does the bridge between RenderViewImpl and WebTestProxyBase and |
93 // when it requires a behavior to be different from the usual, it will call | 93 // when it requires a behavior to be different from the usual, it will call |
94 // WebTestProxyBase that implements the expected behavior. | 94 // WebTestProxyBase that implements the expected behavior. |
95 // See WebTestProxy class comments for more information. | 95 // See WebTestProxy class comments for more information. |
96 class WebTestProxyBase : public blink::WebCompositeAndReadbackAsyncCallback { | 96 class WebTestProxyBase { |
97 public: | 97 public: |
98 void SetInterfaces(WebTestInterfaces* interfaces); | 98 void SetInterfaces(WebTestInterfaces* interfaces); |
99 void SetDelegate(WebTestDelegate* delegate); | 99 void SetDelegate(WebTestDelegate* delegate); |
100 void set_widget(blink::WebWidget* widget) { web_widget_ = widget; } | 100 void set_widget(blink::WebWidget* widget) { web_widget_ = widget; } |
101 | 101 |
102 void Reset(); | 102 void Reset(); |
103 | 103 |
104 blink::WebSpellCheckClient* GetSpellCheckClient() const; | 104 blink::WebSpellCheckClient* GetSpellCheckClient() const; |
105 blink::WebColorChooser* CreateColorChooser( | 105 blink::WebColorChooser* CreateColorChooser( |
106 blink::WebColorChooserClient* client, | 106 blink::WebColorChooserClient* client, |
(...skipping 27 matching lines...) Expand all Loading... | |
134 blink::WebMIDIClientMock* GetMIDIClientMock(); | 134 blink::WebMIDIClientMock* GetMIDIClientMock(); |
135 MockWebSpeechRecognizer* GetSpeechRecognizerMock(); | 135 MockWebSpeechRecognizer* GetSpeechRecognizerMock(); |
136 MockCredentialManagerClient* GetCredentialManagerClientMock(); | 136 MockCredentialManagerClient* GetCredentialManagerClientMock(); |
137 | 137 |
138 WebTaskList* mutable_task_list() { return &task_list_; } | 138 WebTaskList* mutable_task_list() { return &task_list_; } |
139 | 139 |
140 blink::WebView* GetWebView() const; | 140 blink::WebView* GetWebView() const; |
141 | 141 |
142 void PostSpellCheckEvent(const blink::WebString& event_name); | 142 void PostSpellCheckEvent(const blink::WebString& event_name); |
143 | 143 |
144 // WebCompositeAndReadbackAsyncCallback implementation. | |
145 virtual void didCompositeAndReadback(const SkBitmap& bitmap); | |
146 | |
147 void SetAcceptLanguages(const std::string& accept_languages); | 144 void SetAcceptLanguages(const std::string& accept_languages); |
148 | 145 |
149 MockWebPushClient* GetPushClientMock(); | 146 MockWebPushClient* GetPushClientMock(); |
150 | 147 |
151 protected: | 148 protected: |
152 WebTestProxyBase(); | 149 WebTestProxyBase(); |
153 ~WebTestProxyBase(); | 150 ~WebTestProxyBase(); |
154 | 151 |
155 void ScheduleAnimation(); | 152 void ScheduleAnimation(); |
156 void PostAccessibilityEvent(const blink::WebAXObject&, blink::WebAXEvent); | 153 void PostAccessibilityEvent(const blink::WebAXObject&, blink::WebAXEvent); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
261 WebTestDelegate* delegate_; | 258 WebTestDelegate* delegate_; |
262 blink::WebWidget* web_widget_; | 259 blink::WebWidget* web_widget_; |
263 | 260 |
264 WebTaskList task_list_; | 261 WebTaskList task_list_; |
265 | 262 |
266 scoped_ptr<SpellCheckClient> spellcheck_; | 263 scoped_ptr<SpellCheckClient> spellcheck_; |
267 scoped_ptr<MockWebUserMediaClient> user_media_client_; | 264 scoped_ptr<MockWebUserMediaClient> user_media_client_; |
268 | 265 |
269 bool animate_scheduled_; | 266 bool animate_scheduled_; |
270 std::map<unsigned, std::string> resource_identifier_map_; | 267 std::map<unsigned, std::string> resource_identifier_map_; |
271 std::deque<base::Callback<void(const SkBitmap&)> > | |
272 composite_and_readback_callbacks_; | |
273 | 268 |
274 bool log_console_output_; | 269 bool log_console_output_; |
275 int chooser_count_; | 270 int chooser_count_; |
276 | 271 |
277 scoped_ptr<MockCredentialManagerClient> credential_manager_client_; | 272 scoped_ptr<MockCredentialManagerClient> credential_manager_client_; |
278 scoped_ptr<blink::WebMIDIClientMock> midi_client_; | 273 scoped_ptr<blink::WebMIDIClientMock> midi_client_; |
279 scoped_ptr<MockWebSpeechRecognizer> speech_recognizer_; | 274 scoped_ptr<MockWebSpeechRecognizer> speech_recognizer_; |
280 scoped_ptr<MockWebPushClient> push_client_; | 275 scoped_ptr<MockWebPushClient> push_client_; |
281 scoped_ptr<MockScreenOrientationClient> screen_orientation_client_; | 276 scoped_ptr<MockScreenOrientationClient> screen_orientation_client_; |
282 | 277 |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
407 return WebTestProxyBase::GetWebPushClient(); | 402 return WebTestProxyBase::GetWebPushClient(); |
408 } | 403 } |
409 | 404 |
410 private: | 405 private: |
411 DISALLOW_COPY_AND_ASSIGN(WebTestProxy); | 406 DISALLOW_COPY_AND_ASSIGN(WebTestProxy); |
412 }; | 407 }; |
413 | 408 |
414 } // namespace content | 409 } // namespace content |
415 | 410 |
416 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_TEST_PROXY_H_ | 411 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_TEST_PROXY_H_ |
OLD | NEW |