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