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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
122 | 122 |
123 WebTaskList* mutable_task_list() { return &task_list_; } | 123 WebTaskList* mutable_task_list() { return &task_list_; } |
124 | 124 |
125 blink::WebView* GetWebView() const; | 125 blink::WebView* GetWebView() const; |
126 | 126 |
127 void PostSpellCheckEvent(const blink::WebString& eventName); | 127 void PostSpellCheckEvent(const blink::WebString& eventName); |
128 | 128 |
129 // WebCompositeAndReadbackAsyncCallback implementation. | 129 // WebCompositeAndReadbackAsyncCallback implementation. |
130 virtual void didCompositeAndReadback(const SkBitmap& bitmap); | 130 virtual void didCompositeAndReadback(const SkBitmap& bitmap); |
131 | 131 |
132 void SetAcceptLanguages(const std::string& accept_languages); | |
133 | |
132 protected: | 134 protected: |
133 WebTestProxyBase(); | 135 WebTestProxyBase(); |
134 ~WebTestProxyBase(); | 136 ~WebTestProxyBase(); |
135 | 137 |
136 void ScheduleAnimation(); | 138 void ScheduleAnimation(); |
137 void PostAccessibilityEvent(const blink::WebAXObject&, blink::WebAXEvent); | 139 void PostAccessibilityEvent(const blink::WebAXObject&, blink::WebAXEvent); |
138 void StartDragging(blink::WebLocalFrame*, const blink::WebDragData&, | 140 void StartDragging(blink::WebLocalFrame*, const blink::WebDragData&, |
139 blink::WebDragOperationsMask, const blink::WebImage&, | 141 blink::WebDragOperationsMask, const blink::WebImage&, |
140 const blink::WebPoint&); | 142 const blink::WebPoint&); |
141 void DidChangeSelection(bool isEmptySelection); | 143 void DidChangeSelection(bool isEmptySelection); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
199 blink::WebNavigationPolicy DecidePolicyForNavigation( | 201 blink::WebNavigationPolicy DecidePolicyForNavigation( |
200 blink::WebLocalFrame*, blink::WebDataSource::ExtraData*, | 202 blink::WebLocalFrame*, blink::WebDataSource::ExtraData*, |
201 const blink::WebURLRequest&, blink::WebNavigationType, | 203 const blink::WebURLRequest&, blink::WebNavigationType, |
202 blink::WebNavigationPolicy defaultPolicy, bool isRedirect); | 204 blink::WebNavigationPolicy defaultPolicy, bool isRedirect); |
203 bool WillCheckAndDispatchMessageEvent(blink::WebLocalFrame* sourceFrame, | 205 bool WillCheckAndDispatchMessageEvent(blink::WebLocalFrame* sourceFrame, |
204 blink::WebFrame* targetFrame, | 206 blink::WebFrame* targetFrame, |
205 blink::WebSecurityOrigin target, | 207 blink::WebSecurityOrigin target, |
206 blink::WebDOMMessageEvent); | 208 blink::WebDOMMessageEvent); |
207 void ResetInputMethod(); | 209 void ResetInputMethod(); |
208 | 210 |
211 blink::WebString acceptLanguages(); | |
212 | |
209 private: | 213 private: |
210 template <class, typename, typename> | 214 template <class, typename, typename> |
211 friend class WebFrameTestProxy; | 215 friend class WebFrameTestProxy; |
212 void LocationChangeDone(blink::WebFrame*); | 216 void LocationChangeDone(blink::WebFrame*); |
213 void AnimateNow(); | 217 void AnimateNow(); |
214 void DrawSelectionRect(SkCanvas* canvas); | 218 void DrawSelectionRect(SkCanvas* canvas); |
215 void DidDisplayAsync(const base::Closure& callback, const SkBitmap& bitmap); | 219 void DidDisplayAsync(const base::Closure& callback, const SkBitmap& bitmap); |
216 | 220 |
217 blink::WebWidget* web_widget() const { return web_widget_; } | 221 blink::WebWidget* web_widget() const { return web_widget_; } |
218 | 222 |
(...skipping 10 matching lines...) Expand all Loading... | |
229 std::map<unsigned, std::string> resource_identifier_map_; | 233 std::map<unsigned, std::string> resource_identifier_map_; |
230 std::deque<base::Callback<void(const SkBitmap&)> > | 234 std::deque<base::Callback<void(const SkBitmap&)> > |
231 composite_and_readback_callbacks_; | 235 composite_and_readback_callbacks_; |
232 | 236 |
233 bool log_console_output_; | 237 bool log_console_output_; |
234 int chooser_count_; | 238 int chooser_count_; |
235 | 239 |
236 scoped_ptr<blink::WebMIDIClientMock> m_midiClient; | 240 scoped_ptr<blink::WebMIDIClientMock> m_midiClient; |
237 scoped_ptr<MockWebSpeechRecognizer> m_speechRecognizer; | 241 scoped_ptr<MockWebSpeechRecognizer> m_speechRecognizer; |
238 | 242 |
243 std::string accept_languages_; | |
244 | |
239 private: | 245 private: |
240 DISALLOW_COPY_AND_ASSIGN(WebTestProxyBase); | 246 DISALLOW_COPY_AND_ASSIGN(WebTestProxyBase); |
241 }; | 247 }; |
242 | 248 |
243 // Use this template to inject methods into your WebViewClient/WebFrameClient | 249 // Use this template to inject methods into your WebViewClient/WebFrameClient |
244 // implementation required for the running layout tests. | 250 // implementation required for the running layout tests. |
245 template <class Base, typename T> | 251 template <class Base, typename T> |
246 class WebTestProxy : public Base, public WebTestProxyBase { | 252 class WebTestProxy : public Base, public WebTestProxyBase { |
247 public: | 253 public: |
248 explicit WebTestProxy(T t) : Base(t) {} | 254 explicit WebTestProxy(T t) : Base(t) {} |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
331 } | 337 } |
332 virtual void hideValidationMessage() { | 338 virtual void hideValidationMessage() { |
333 WebTestProxyBase::HideValidationMessage(); | 339 WebTestProxyBase::HideValidationMessage(); |
334 } | 340 } |
335 virtual void moveValidationMessage(const blink::WebRect& anchorInRootView) { | 341 virtual void moveValidationMessage(const blink::WebRect& anchorInRootView) { |
336 WebTestProxyBase::MoveValidationMessage(anchorInRootView); | 342 WebTestProxyBase::MoveValidationMessage(anchorInRootView); |
337 } | 343 } |
338 virtual void postSpellCheckEvent(const blink::WebString& eventName) { | 344 virtual void postSpellCheckEvent(const blink::WebString& eventName) { |
339 WebTestProxyBase::PostSpellCheckEvent(eventName); | 345 WebTestProxyBase::PostSpellCheckEvent(eventName); |
340 } | 346 } |
347 virtual blink::WebString acceptLanguages() { | |
348 return WebTestProxy::acceptLanguages(); | |
jochen (gone - plz use gerrit)
2014/05/23 12:54:18
should be WebTestProxyBase
| |
349 } | |
341 | 350 |
342 private: | 351 private: |
343 DISALLOW_COPY_AND_ASSIGN(WebTestProxy); | 352 DISALLOW_COPY_AND_ASSIGN(WebTestProxy); |
344 }; | 353 }; |
345 | 354 |
346 } // namespace content | 355 } // namespace content |
347 | 356 |
348 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_TEST_PROXY_H_ | 357 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_TEST_PROXY_H_ |
OLD | NEW |