OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_WEBTESTPROXY_H_ | 5 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_WEBTESTPROXY_H_ |
6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_WEBTESTPROXY_H_ | 6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_WEBTESTPROXY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 struct WebConsoleMessage; | 64 struct WebConsoleMessage; |
65 struct WebContextMenuData; | 65 struct WebContextMenuData; |
66 struct WebFileChooserParams; | 66 struct WebFileChooserParams; |
67 struct WebPluginParams; | 67 struct WebPluginParams; |
68 struct WebPoint; | 68 struct WebPoint; |
69 struct WebSize; | 69 struct WebSize; |
70 struct WebWindowFeatures; | 70 struct WebWindowFeatures; |
71 typedef unsigned WebColor; | 71 typedef unsigned WebColor; |
72 } | 72 } |
73 | 73 |
74 namespace WebTestRunner { | 74 namespace content { |
| 75 |
75 class MockWebSpeechRecognizer; | 76 class MockWebSpeechRecognizer; |
| 77 class RenderFrame; |
| 78 class SpellCheckClient; |
76 class TestInterfaces; | 79 class TestInterfaces; |
77 class WebTestDelegate; | 80 class WebTestDelegate; |
78 class WebTestInterfaces; | 81 class WebTestInterfaces; |
79 class WebUserMediaClientMock; | 82 class WebUserMediaClientMock; |
80 } | |
81 | |
82 namespace content { | |
83 | |
84 class RenderFrame; | |
85 class SpellCheckClient; | |
86 | 83 |
87 class WebTestProxyBase : public blink::WebCompositeAndReadbackAsyncCallback { | 84 class WebTestProxyBase : public blink::WebCompositeAndReadbackAsyncCallback { |
88 public: | 85 public: |
89 void setInterfaces(WebTestRunner::WebTestInterfaces*); | 86 void setInterfaces(WebTestInterfaces*); |
90 void setDelegate(WebTestRunner::WebTestDelegate*); | 87 void setDelegate(WebTestDelegate*); |
91 void setWidget(blink::WebWidget*); | 88 void setWidget(blink::WebWidget*); |
92 | 89 |
93 void reset(); | 90 void reset(); |
94 | 91 |
95 blink::WebSpellCheckClient *spellCheckClient() const; | 92 blink::WebSpellCheckClient *spellCheckClient() const; |
96 blink::WebColorChooser* createColorChooser(blink::WebColorChooserClient*, co
nst blink::WebColor&, const blink::WebVector<blink::WebColorSuggestion>& suggest
ions); | 93 blink::WebColorChooser* createColorChooser(blink::WebColorChooserClient*, co
nst blink::WebColor&, const blink::WebVector<blink::WebColorSuggestion>& suggest
ions); |
97 bool runFileChooser(const blink::WebFileChooserParams&, blink::WebFileChoose
rCompletion*); | 94 bool runFileChooser(const blink::WebFileChooserParams&, blink::WebFileChoose
rCompletion*); |
98 void showValidationMessage(const blink::WebRect& anchorInRootView, const bli
nk::WebString& mainText, const blink::WebString& supplementalText, blink::WebTex
tDirection); | 95 void showValidationMessage(const blink::WebRect& anchorInRootView, const bli
nk::WebString& mainText, const blink::WebString& supplementalText, blink::WebTex
tDirection); |
99 void hideValidationMessage(); | 96 void hideValidationMessage(); |
100 void moveValidationMessage(const blink::WebRect& anchorInRootView); | 97 void moveValidationMessage(const blink::WebRect& anchorInRootView); |
(...skipping 10 matching lines...) Expand all Loading... |
111 void didOpenChooser(); | 108 void didOpenChooser(); |
112 void didCloseChooser(); | 109 void didCloseChooser(); |
113 bool isChooserShown(); | 110 bool isChooserShown(); |
114 | 111 |
115 void display(base::Closure callback); | 112 void display(base::Closure callback); |
116 void displayAsyncThen(base::Closure callback); | 113 void displayAsyncThen(base::Closure callback); |
117 | 114 |
118 void discardBackingStore(); | 115 void discardBackingStore(); |
119 | 116 |
120 blink::WebMIDIClientMock* midiClientMock(); | 117 blink::WebMIDIClientMock* midiClientMock(); |
121 WebTestRunner::MockWebSpeechRecognizer* speechRecognizerMock(); | 118 MockWebSpeechRecognizer* speechRecognizerMock(); |
122 | 119 |
123 WebTestRunner::WebTaskList* taskList() { return &m_taskList; } | 120 WebTaskList* taskList() { return &m_taskList; } |
124 | 121 |
125 blink::WebView* webView(); | 122 blink::WebView* webView(); |
126 | 123 |
127 void didForceResize(); | 124 void didForceResize(); |
128 | 125 |
129 void postSpellCheckEvent(const blink::WebString& eventName); | 126 void postSpellCheckEvent(const blink::WebString& eventName); |
130 | 127 |
131 // WebCompositeAndReadbackAsyncCallback implementation. | 128 // WebCompositeAndReadbackAsyncCallback implementation. |
132 virtual void didCompositeAndReadback(const SkBitmap& bitmap); | 129 virtual void didCompositeAndReadback(const SkBitmap& bitmap); |
133 | 130 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 void paintRect(const blink::WebRect&); | 191 void paintRect(const blink::WebRect&); |
195 void paintInvalidatedRegion(); | 192 void paintInvalidatedRegion(); |
196 void paintPagesWithBoundaries(); | 193 void paintPagesWithBoundaries(); |
197 SkCanvas* canvas(); | 194 SkCanvas* canvas(); |
198 void invalidateAll(); | 195 void invalidateAll(); |
199 void animateNow(); | 196 void animateNow(); |
200 void DrawSelectionRect(SkCanvas* canvas); | 197 void DrawSelectionRect(SkCanvas* canvas); |
201 | 198 |
202 blink::WebWidget* webWidget(); | 199 blink::WebWidget* webWidget(); |
203 | 200 |
204 WebTestRunner::TestInterfaces* m_testInterfaces; | 201 TestInterfaces* m_testInterfaces; |
205 ::WebTestRunner::WebTestDelegate* m_delegate; | 202 WebTestDelegate* m_delegate; |
206 blink::WebWidget* m_webWidget; | 203 blink::WebWidget* m_webWidget; |
207 | 204 |
208 WebTestRunner::WebTaskList m_taskList; | 205 WebTaskList m_taskList; |
209 | 206 |
210 scoped_ptr<SpellCheckClient> m_spellcheck; | 207 scoped_ptr<SpellCheckClient> m_spellcheck; |
211 scoped_ptr<WebTestRunner::WebUserMediaClientMock> m_userMediaClient; | 208 scoped_ptr<WebUserMediaClientMock> m_userMediaClient; |
212 | 209 |
213 // Painting. | 210 // Painting. |
214 scoped_ptr<SkCanvas> m_canvas; | 211 scoped_ptr<SkCanvas> m_canvas; |
215 blink::WebRect m_paintRect; | 212 blink::WebRect m_paintRect; |
216 bool m_isPainting; | 213 bool m_isPainting; |
217 bool m_animateScheduled; | 214 bool m_animateScheduled; |
218 std::map<unsigned, std::string> m_resourceIdentifierMap; | 215 std::map<unsigned, std::string> m_resourceIdentifierMap; |
219 std::map<unsigned, blink::WebURLRequest> m_requestMap; | 216 std::map<unsigned, blink::WebURLRequest> m_requestMap; |
220 base::Callback<void(const SkBitmap&)> m_compositeAndReadbackCallback; | 217 base::Callback<void(const SkBitmap&)> m_compositeAndReadbackCallback; |
221 | 218 |
222 bool m_logConsoleOutput; | 219 bool m_logConsoleOutput; |
223 int m_chooserCount; | 220 int m_chooserCount; |
224 | 221 |
225 scoped_ptr<blink::WebMIDIClientMock> m_midiClient; | 222 scoped_ptr<blink::WebMIDIClientMock> m_midiClient; |
226 scoped_ptr<WebTestRunner::MockWebSpeechRecognizer> m_speechRecognizer; | 223 scoped_ptr<MockWebSpeechRecognizer> m_speechRecognizer; |
227 | 224 |
228 private: | 225 private: |
229 DISALLOW_COPY_AND_ASSIGN(WebTestProxyBase); | 226 DISALLOW_COPY_AND_ASSIGN(WebTestProxyBase); |
230 }; | 227 }; |
231 | 228 |
232 // Use this template to inject methods into your WebViewClient/WebFrameClient | 229 // Use this template to inject methods into your WebViewClient/WebFrameClient |
233 // implementation required for the running layout tests. | 230 // implementation required for the running layout tests. |
234 template<class Base, typename T> | 231 template<class Base, typename T> |
235 class WebTestProxy : public Base, public WebTestProxyBase { | 232 class WebTestProxy : public Base, public WebTestProxyBase { |
236 public: | 233 public: |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 WebTestProxyBase::postSpellCheckEvent(eventName); | 368 WebTestProxyBase::postSpellCheckEvent(eventName); |
372 } | 369 } |
373 | 370 |
374 private: | 371 private: |
375 DISALLOW_COPY_AND_ASSIGN(WebTestProxy); | 372 DISALLOW_COPY_AND_ASSIGN(WebTestProxy); |
376 }; | 373 }; |
377 | 374 |
378 } // namespace content | 375 } // namespace content |
379 | 376 |
380 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEBTESTPROXY_H_ | 377 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEBTESTPROXY_H_ |
OLD | NEW |