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_FRAME_TEST_PROXY_H_ | 5 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ |
6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ | 6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "content/shell/renderer/test_runner/WebTestDelegate.h" | |
10 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h" | 9 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h" |
11 #include "content/shell/renderer/test_runner/test_interfaces.h" | 10 #include "content/shell/renderer/test_runner/test_interfaces.h" |
12 #include "content/shell/renderer/test_runner/test_runner.h" | 11 #include "content/shell/renderer/test_runner/test_runner.h" |
| 12 #include "content/shell/renderer/test_runner/web_test_delegate.h" |
13 #include "content/shell/renderer/test_runner/web_test_proxy.h" | 13 #include "content/shell/renderer/test_runner/web_test_proxy.h" |
14 #include "content/test/test_media_stream_renderer_factory.h" | 14 #include "content/test/test_media_stream_renderer_factory.h" |
15 #include "third_party/WebKit/public/platform/WebString.h" | 15 #include "third_party/WebKit/public/platform/WebString.h" |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 | 18 |
19 // Templetized wrapper around RenderFrameImpl objects, which implement | 19 // Templetized wrapper around RenderFrameImpl objects, which implement |
20 // the WebFrameClient interface. | 20 // the WebFrameClient interface. |
21 template <class Base, typename P, typename R> | 21 template <class Base, typename P, typename R> |
22 class WebFrameTestProxy : public Base { | 22 class WebFrameTestProxy : public Base { |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 } | 139 } |
140 | 140 |
141 virtual blink::WebColorChooser* createColorChooser( | 141 virtual blink::WebColorChooser* createColorChooser( |
142 blink::WebColorChooserClient* client, | 142 blink::WebColorChooserClient* client, |
143 const blink::WebColor& initial_color, | 143 const blink::WebColor& initial_color, |
144 const blink::WebVector<blink::WebColorSuggestion>& suggestions) { | 144 const blink::WebVector<blink::WebColorSuggestion>& suggestions) { |
145 return base_proxy_->CreateColorChooser(client, initial_color, suggestions); | 145 return base_proxy_->CreateColorChooser(client, initial_color, suggestions); |
146 } | 146 } |
147 | 147 |
148 virtual void runModalAlertDialog(const blink::WebString& message) { | 148 virtual void runModalAlertDialog(const blink::WebString& message) { |
149 base_proxy_->delegate_->printMessage(std::string("ALERT: ") + | 149 base_proxy_->delegate_->PrintMessage(std::string("ALERT: ") + |
150 message.utf8().data() + "\n"); | 150 message.utf8().data() + "\n"); |
151 } | 151 } |
152 | 152 |
153 virtual bool runModalConfirmDialog(const blink::WebString& message) { | 153 virtual bool runModalConfirmDialog(const blink::WebString& message) { |
154 base_proxy_->delegate_->printMessage(std::string("CONFIRM: ") + | 154 base_proxy_->delegate_->PrintMessage(std::string("CONFIRM: ") + |
155 message.utf8().data() + "\n"); | 155 message.utf8().data() + "\n"); |
156 return true; | 156 return true; |
157 } | 157 } |
158 | 158 |
159 virtual bool runModalPromptDialog(const blink::WebString& message, | 159 virtual bool runModalPromptDialog(const blink::WebString& message, |
160 const blink::WebString& default_value, | 160 const blink::WebString& default_value, |
161 blink::WebString*) { | 161 blink::WebString*) { |
162 base_proxy_->delegate_->printMessage( | 162 base_proxy_->delegate_->PrintMessage( |
163 std::string("PROMPT: ") + message.utf8().data() + ", default text: " + | 163 std::string("PROMPT: ") + message.utf8().data() + ", default text: " + |
164 default_value.utf8().data() + "\n"); | 164 default_value.utf8().data() + "\n"); |
165 return true; | 165 return true; |
166 } | 166 } |
167 | 167 |
168 virtual bool runModalBeforeUnloadDialog(bool is_reload, | 168 virtual bool runModalBeforeUnloadDialog(bool is_reload, |
169 const blink::WebString& message) { | 169 const blink::WebString& message) { |
170 base_proxy_->delegate_->printMessage(std::string("CONFIRM NAVIGATION: ") + | 170 base_proxy_->delegate_->PrintMessage(std::string("CONFIRM NAVIGATION: ") + |
171 message.utf8().data() + "\n"); | 171 message.utf8().data() + "\n"); |
172 return !base_proxy_->test_interfaces_->GetTestRunner() | 172 return !base_proxy_->test_interfaces_->GetTestRunner() |
173 ->shouldStayOnPageAfterHandlingBeforeUnload(); | 173 ->shouldStayOnPageAfterHandlingBeforeUnload(); |
174 } | 174 } |
175 | 175 |
176 virtual void showContextMenu( | 176 virtual void showContextMenu( |
177 const blink::WebContextMenuData& context_menu_data) { | 177 const blink::WebContextMenuData& context_menu_data) { |
178 base_proxy_->ShowContextMenu(Base::GetWebFrame(), | 178 base_proxy_->ShowContextMenu(Base::GetWebFrame(), |
179 context_menu_data); | 179 context_menu_data); |
180 Base::showContextMenu(context_menu_data); | 180 Base::showContextMenu(context_menu_data); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 #endif | 296 #endif |
297 | 297 |
298 WebTestProxyBase* base_proxy_; | 298 WebTestProxyBase* base_proxy_; |
299 | 299 |
300 DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxy); | 300 DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxy); |
301 }; | 301 }; |
302 | 302 |
303 } // namespace content | 303 } // namespace content |
304 | 304 |
305 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ | 305 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ |
OLD | NEW |