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> |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 class SpellCheckClient; | 85 class SpellCheckClient; |
86 class TestInterfaces; | 86 class TestInterfaces; |
87 class WebTestDelegate; | 87 class WebTestDelegate; |
88 class WebTestInterfaces; | 88 class WebTestInterfaces; |
89 | 89 |
90 // WebTestProxyBase is the "brain" of WebTestProxy in the sense that | 90 // WebTestProxyBase is the "brain" of WebTestProxy in the sense that |
91 // WebTestProxy does the bridge between RenderViewImpl and WebTestProxyBase and | 91 // WebTestProxy does the bridge between RenderViewImpl and WebTestProxyBase and |
92 // when it requires a behavior to be different from the usual, it will call | 92 // when it requires a behavior to be different from the usual, it will call |
93 // WebTestProxyBase that implements the expected behavior. | 93 // WebTestProxyBase that implements the expected behavior. |
94 // See WebTestProxy class comments for more information. | 94 // See WebTestProxy class comments for more information. |
95 class WebTestProxyBase : public blink::WebCompositeAndReadbackAsyncCallback { | 95 class WebTestProxyBase { |
96 public: | 96 public: |
97 void SetInterfaces(WebTestInterfaces* interfaces); | 97 void SetInterfaces(WebTestInterfaces* interfaces); |
98 void SetDelegate(WebTestDelegate* delegate); | 98 void SetDelegate(WebTestDelegate* delegate); |
99 void set_widget(blink::WebWidget* widget) { web_widget_ = widget; } | 99 void set_widget(blink::WebWidget* widget) { web_widget_ = widget; } |
100 | 100 |
101 void Reset(); | 101 void Reset(); |
102 | 102 |
103 blink::WebSpellCheckClient* GetSpellCheckClient() const; | 103 blink::WebSpellCheckClient* GetSpellCheckClient() const; |
104 blink::WebColorChooser* CreateColorChooser( | 104 blink::WebColorChooser* CreateColorChooser( |
105 blink::WebColorChooserClient* client, | 105 blink::WebColorChooserClient* client, |
(...skipping 26 matching lines...) Expand all Loading... |
132 MockScreenOrientationClient* GetScreenOrientationClientMock(); | 132 MockScreenOrientationClient* GetScreenOrientationClientMock(); |
133 blink::WebMIDIClientMock* GetMIDIClientMock(); | 133 blink::WebMIDIClientMock* GetMIDIClientMock(); |
134 MockWebSpeechRecognizer* GetSpeechRecognizerMock(); | 134 MockWebSpeechRecognizer* GetSpeechRecognizerMock(); |
135 | 135 |
136 WebTaskList* mutable_task_list() { return &task_list_; } | 136 WebTaskList* mutable_task_list() { return &task_list_; } |
137 | 137 |
138 blink::WebView* GetWebView() const; | 138 blink::WebView* GetWebView() const; |
139 | 139 |
140 void PostSpellCheckEvent(const blink::WebString& event_name); | 140 void PostSpellCheckEvent(const blink::WebString& event_name); |
141 | 141 |
142 // WebCompositeAndReadbackAsyncCallback implementation. | |
143 virtual void didCompositeAndReadback(const SkBitmap& bitmap); | |
144 | |
145 void SetAcceptLanguages(const std::string& accept_languages); | 142 void SetAcceptLanguages(const std::string& accept_languages); |
146 | 143 |
147 MockWebPushClient* GetPushClientMock(); | 144 MockWebPushClient* GetPushClientMock(); |
148 | 145 |
149 protected: | 146 protected: |
150 WebTestProxyBase(); | 147 WebTestProxyBase(); |
151 ~WebTestProxyBase(); | 148 ~WebTestProxyBase(); |
152 | 149 |
153 void ScheduleAnimation(); | 150 void ScheduleAnimation(); |
154 void PostAccessibilityEvent(const blink::WebAXObject&, blink::WebAXEvent); | 151 void PostAccessibilityEvent(const blink::WebAXObject&, blink::WebAXEvent); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 WebTestDelegate* delegate_; | 256 WebTestDelegate* delegate_; |
260 blink::WebWidget* web_widget_; | 257 blink::WebWidget* web_widget_; |
261 | 258 |
262 WebTaskList task_list_; | 259 WebTaskList task_list_; |
263 | 260 |
264 scoped_ptr<SpellCheckClient> spellcheck_; | 261 scoped_ptr<SpellCheckClient> spellcheck_; |
265 scoped_ptr<MockWebUserMediaClient> user_media_client_; | 262 scoped_ptr<MockWebUserMediaClient> user_media_client_; |
266 | 263 |
267 bool animate_scheduled_; | 264 bool animate_scheduled_; |
268 std::map<unsigned, std::string> resource_identifier_map_; | 265 std::map<unsigned, std::string> resource_identifier_map_; |
269 std::deque<base::Callback<void(const SkBitmap&)> > | |
270 composite_and_readback_callbacks_; | |
271 | 266 |
272 bool log_console_output_; | 267 bool log_console_output_; |
273 int chooser_count_; | 268 int chooser_count_; |
274 | 269 |
275 scoped_ptr<blink::WebMIDIClientMock> midi_client_; | 270 scoped_ptr<blink::WebMIDIClientMock> midi_client_; |
276 scoped_ptr<MockWebSpeechRecognizer> speech_recognizer_; | 271 scoped_ptr<MockWebSpeechRecognizer> speech_recognizer_; |
277 scoped_ptr<MockWebPushClient> push_client_; | 272 scoped_ptr<MockWebPushClient> push_client_; |
278 scoped_ptr<MockScreenOrientationClient> screen_orientation_client_; | 273 scoped_ptr<MockScreenOrientationClient> screen_orientation_client_; |
279 | 274 |
280 std::string accept_languages_; | 275 std::string accept_languages_; |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 return WebTestProxyBase::GetWebPushClient(); | 399 return WebTestProxyBase::GetWebPushClient(); |
405 } | 400 } |
406 | 401 |
407 private: | 402 private: |
408 DISALLOW_COPY_AND_ASSIGN(WebTestProxy); | 403 DISALLOW_COPY_AND_ASSIGN(WebTestProxy); |
409 }; | 404 }; |
410 | 405 |
411 } // namespace content | 406 } // namespace content |
412 | 407 |
413 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_TEST_PROXY_H_ | 408 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_TEST_PROXY_H_ |
OLD | NEW |