| 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 COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ | 5 #ifndef COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ |
| 6 #define COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ | 6 #define COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "components/test_runner/mock_screen_orientation_client.h" | 9 #include "components/test_runner/mock_screen_orientation_client.h" |
| 10 #include "components/test_runner/web_test_delegate.h" | 10 #include "components/test_runner/web_test_delegate.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 } | 141 } |
| 142 | 142 |
| 143 blink::WebColorChooser* createColorChooser( | 143 blink::WebColorChooser* createColorChooser( |
| 144 blink::WebColorChooserClient* client, | 144 blink::WebColorChooserClient* client, |
| 145 const blink::WebColor& initial_color, | 145 const blink::WebColor& initial_color, |
| 146 const blink::WebVector<blink::WebColorSuggestion>& suggestions) override { | 146 const blink::WebVector<blink::WebColorSuggestion>& suggestions) override { |
| 147 return base_proxy_->CreateColorChooser(client, initial_color, suggestions); | 147 return base_proxy_->CreateColorChooser(client, initial_color, suggestions); |
| 148 } | 148 } |
| 149 | 149 |
| 150 void runModalAlertDialog(const blink::WebString& message) override { | 150 void runModalAlertDialog(const blink::WebString& message) override { |
| 151 base_proxy_->GetDelegate()->PrintMessage(std::string("ALERT: ") + | 151 base_proxy_->RunModalAlertDialog(message); |
| 152 message.utf8().data() + "\n"); | |
| 153 } | 152 } |
| 154 | 153 |
| 155 bool runModalConfirmDialog(const blink::WebString& message) override { | 154 bool runModalConfirmDialog(const blink::WebString& message) override { |
| 156 base_proxy_->GetDelegate()->PrintMessage(std::string("CONFIRM: ") + | 155 return base_proxy_->RunModalConfirmDialog(message); |
| 157 message.utf8().data() + "\n"); | |
| 158 return true; | |
| 159 } | 156 } |
| 160 | 157 |
| 161 bool runModalPromptDialog(const blink::WebString& message, | 158 bool runModalPromptDialog(const blink::WebString& message, |
| 162 const blink::WebString& default_value, | 159 const blink::WebString& default_value, |
| 163 blink::WebString*) override { | 160 blink::WebString* actual_value) override { |
| 164 base_proxy_->GetDelegate()->PrintMessage( | 161 return base_proxy_->RunModalPromptDialog(message, default_value, |
| 165 std::string("PROMPT: ") + message.utf8().data() + ", default text: " + | 162 actual_value); |
| 166 default_value.utf8().data() + "\n"); | |
| 167 return true; | |
| 168 } | 163 } |
| 169 | 164 |
| 170 bool runModalBeforeUnloadDialog(bool is_reload) override { | 165 bool runModalBeforeUnloadDialog(bool is_reload) override { |
| 171 base_proxy_->GetDelegate()->PrintMessage( | 166 return base_proxy_->RunModalBeforeUnloadDialog(is_reload); |
| 172 std::string("CONFIRM NAVIGATION\n")); | |
| 173 return !base_proxy_->GetInterfaces() | |
| 174 ->TestRunner() | |
| 175 ->ShouldStayOnPageAfterHandlingBeforeUnload(); | |
| 176 } | 167 } |
| 177 | 168 |
| 178 void showContextMenu( | 169 void showContextMenu( |
| 179 const blink::WebContextMenuData& context_menu_data) override { | 170 const blink::WebContextMenuData& context_menu_data) override { |
| 180 base_proxy_->ShowContextMenu(context_menu_data); | 171 base_proxy_->ShowContextMenu(context_menu_data); |
| 181 Base::showContextMenu(context_menu_data); | 172 Base::showContextMenu(context_menu_data); |
| 182 } | 173 } |
| 183 | 174 |
| 184 void didDetectXSS(const blink::WebURL& insecure_url, | 175 void didDetectXSS(const blink::WebURL& insecure_url, |
| 185 bool did_block_entire_page) override { | 176 bool did_block_entire_page) override { |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 | 271 |
| 281 private: | 272 private: |
| 282 WebTestProxyBase* base_proxy_; | 273 WebTestProxyBase* base_proxy_; |
| 283 | 274 |
| 284 DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxy); | 275 DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxy); |
| 285 }; | 276 }; |
| 286 | 277 |
| 287 } // namespace test_runner | 278 } // namespace test_runner |
| 288 | 279 |
| 289 #endif // COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ | 280 #endif // COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ |
| OLD | NEW |