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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 WebTaskList* mutable_task_list() { return &task_list_; } | 128 WebTaskList* mutable_task_list() { return &task_list_; } |
129 | 129 |
130 blink::WebView* GetWebView() const; | 130 blink::WebView* GetWebView() const; |
131 | 131 |
132 void PostSpellCheckEvent(const blink::WebString& eventName); | 132 void PostSpellCheckEvent(const blink::WebString& eventName); |
133 | 133 |
134 // WebCompositeAndReadbackAsyncCallback implementation. | 134 // WebCompositeAndReadbackAsyncCallback implementation. |
135 virtual void didCompositeAndReadback(const SkBitmap& bitmap); | 135 virtual void didCompositeAndReadback(const SkBitmap& bitmap); |
136 | 136 |
137 void SetAcceptLanguages(const std::string& accept_languages); | |
138 | |
139 protected: | 137 protected: |
140 WebTestProxyBase(); | 138 WebTestProxyBase(); |
141 ~WebTestProxyBase(); | 139 ~WebTestProxyBase(); |
142 | 140 |
143 void ScheduleAnimation(); | 141 void ScheduleAnimation(); |
144 void PostAccessibilityEvent(const blink::WebAXObject&, blink::WebAXEvent); | 142 void PostAccessibilityEvent(const blink::WebAXObject&, blink::WebAXEvent); |
145 void StartDragging(blink::WebLocalFrame*, const blink::WebDragData&, | 143 void StartDragging(blink::WebLocalFrame*, const blink::WebDragData&, |
146 blink::WebDragOperationsMask, const blink::WebImage&, | 144 blink::WebDragOperationsMask, const blink::WebImage&, |
147 const blink::WebPoint&); | 145 const blink::WebPoint&); |
148 void DidChangeSelection(bool isEmptySelection); | 146 void DidChangeSelection(bool isEmptySelection); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 blink::WebNavigationPolicy DecidePolicyForNavigation( | 204 blink::WebNavigationPolicy DecidePolicyForNavigation( |
207 blink::WebLocalFrame*, blink::WebDataSource::ExtraData*, | 205 blink::WebLocalFrame*, blink::WebDataSource::ExtraData*, |
208 const blink::WebURLRequest&, blink::WebNavigationType, | 206 const blink::WebURLRequest&, blink::WebNavigationType, |
209 blink::WebNavigationPolicy defaultPolicy, bool isRedirect); | 207 blink::WebNavigationPolicy defaultPolicy, bool isRedirect); |
210 bool WillCheckAndDispatchMessageEvent(blink::WebLocalFrame* sourceFrame, | 208 bool WillCheckAndDispatchMessageEvent(blink::WebLocalFrame* sourceFrame, |
211 blink::WebFrame* targetFrame, | 209 blink::WebFrame* targetFrame, |
212 blink::WebSecurityOrigin target, | 210 blink::WebSecurityOrigin target, |
213 blink::WebDOMMessageEvent); | 211 blink::WebDOMMessageEvent); |
214 void ResetInputMethod(); | 212 void ResetInputMethod(); |
215 | 213 |
216 blink::WebString acceptLanguages(); | |
217 | |
218 private: | 214 private: |
219 template <class, typename, typename> | 215 template <class, typename, typename> |
220 friend class WebFrameTestProxy; | 216 friend class WebFrameTestProxy; |
221 void LocationChangeDone(blink::WebFrame*); | 217 void LocationChangeDone(blink::WebFrame*); |
222 void AnimateNow(); | 218 void AnimateNow(); |
223 void DrawSelectionRect(SkCanvas* canvas); | 219 void DrawSelectionRect(SkCanvas* canvas); |
224 void DidDisplayAsync(const base::Closure& callback, const SkBitmap& bitmap); | 220 void DidDisplayAsync(const base::Closure& callback, const SkBitmap& bitmap); |
225 | 221 |
226 blink::WebWidget* web_widget() const { return web_widget_; } | 222 blink::WebWidget* web_widget() const { return web_widget_; } |
227 | 223 |
(...skipping 10 matching lines...) Expand all Loading... |
238 std::map<unsigned, std::string> resource_identifier_map_; | 234 std::map<unsigned, std::string> resource_identifier_map_; |
239 std::deque<base::Callback<void(const SkBitmap&)> > | 235 std::deque<base::Callback<void(const SkBitmap&)> > |
240 composite_and_readback_callbacks_; | 236 composite_and_readback_callbacks_; |
241 | 237 |
242 bool log_console_output_; | 238 bool log_console_output_; |
243 int chooser_count_; | 239 int chooser_count_; |
244 | 240 |
245 scoped_ptr<blink::WebMIDIClientMock> m_midiClient; | 241 scoped_ptr<blink::WebMIDIClientMock> m_midiClient; |
246 scoped_ptr<MockWebSpeechRecognizer> m_speechRecognizer; | 242 scoped_ptr<MockWebSpeechRecognizer> m_speechRecognizer; |
247 | 243 |
248 std::string accept_languages_; | |
249 | |
250 private: | 244 private: |
251 DISALLOW_COPY_AND_ASSIGN(WebTestProxyBase); | 245 DISALLOW_COPY_AND_ASSIGN(WebTestProxyBase); |
252 }; | 246 }; |
253 | 247 |
254 // WebTestProxy is used during LayoutTests and always instantiated, at time of | 248 // WebTestProxy is used during LayoutTests and always instantiated, at time of |
255 // writing with Base=RenderViewImpl. It does not directly inherit from it for | 249 // writing with Base=RenderViewImpl. It does not directly inherit from it for |
256 // layering purposes. | 250 // layering purposes. |
257 // The intent of that class is to wrap RenderViewImpl for tests purposes in | 251 // The intent of that class is to wrap RenderViewImpl for tests purposes in |
258 // order to reduce the amount of test specific code in the production code. | 252 // order to reduce the amount of test specific code in the production code. |
259 // WebTestProxy is only doing the glue between RenderViewImpl and | 253 // WebTestProxy is only doing the glue between RenderViewImpl and |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 } | 350 } |
357 virtual void hideValidationMessage() { | 351 virtual void hideValidationMessage() { |
358 WebTestProxyBase::HideValidationMessage(); | 352 WebTestProxyBase::HideValidationMessage(); |
359 } | 353 } |
360 virtual void moveValidationMessage(const blink::WebRect& anchorInRootView) { | 354 virtual void moveValidationMessage(const blink::WebRect& anchorInRootView) { |
361 WebTestProxyBase::MoveValidationMessage(anchorInRootView); | 355 WebTestProxyBase::MoveValidationMessage(anchorInRootView); |
362 } | 356 } |
363 virtual void postSpellCheckEvent(const blink::WebString& eventName) { | 357 virtual void postSpellCheckEvent(const blink::WebString& eventName) { |
364 WebTestProxyBase::PostSpellCheckEvent(eventName); | 358 WebTestProxyBase::PostSpellCheckEvent(eventName); |
365 } | 359 } |
366 virtual blink::WebString acceptLanguages() { | |
367 return WebTestProxyBase::acceptLanguages(); | |
368 } | |
369 | 360 |
370 private: | 361 private: |
371 DISALLOW_COPY_AND_ASSIGN(WebTestProxy); | 362 DISALLOW_COPY_AND_ASSIGN(WebTestProxy); |
372 }; | 363 }; |
373 | 364 |
374 } // namespace content | 365 } // namespace content |
375 | 366 |
376 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_TEST_PROXY_H_ | 367 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_TEST_PROXY_H_ |
OLD | NEW |