| 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 <memory> | 8 #include <memory> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "components/test_runner/test_runner_export.h" | 13 #include "components/test_runner/test_runner_export.h" |
| 14 #include "components/test_runner/web_frame_test_client.h" | 14 #include "components/test_runner/web_frame_test_client.h" |
| 15 #include "third_party/WebKit/public/platform/WebEffectiveConnectionType.h" |
| 15 #include "third_party/WebKit/public/platform/WebString.h" | 16 #include "third_party/WebKit/public/platform/WebString.h" |
| 16 #include "third_party/WebKit/public/web/WebFrameClient.h" | 17 #include "third_party/WebKit/public/web/WebFrameClient.h" |
| 17 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 18 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
| 18 | 19 |
| 19 namespace test_runner { | 20 namespace test_runner { |
| 20 | 21 |
| 21 class TEST_RUNNER_EXPORT WebFrameTestProxyBase { | 22 class TEST_RUNNER_EXPORT WebFrameTestProxyBase { |
| 22 public: | 23 public: |
| 23 void set_test_client(std::unique_ptr<WebFrameTestClient> client) { | 24 void set_test_client(std::unique_ptr<WebFrameTestClient> client) { |
| 24 DCHECK(client); | 25 DCHECK(client); |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 } | 185 } |
| 185 | 186 |
| 186 blink::WebColorChooser* createColorChooser( | 187 blink::WebColorChooser* createColorChooser( |
| 187 blink::WebColorChooserClient* client, | 188 blink::WebColorChooserClient* client, |
| 188 const blink::WebColor& initial_color, | 189 const blink::WebColor& initial_color, |
| 189 const blink::WebVector<blink::WebColorSuggestion>& suggestions) override { | 190 const blink::WebVector<blink::WebColorSuggestion>& suggestions) override { |
| 190 return test_client()->createColorChooser(client, initial_color, | 191 return test_client()->createColorChooser(client, initial_color, |
| 191 suggestions); | 192 suggestions); |
| 192 } | 193 } |
| 193 | 194 |
| 195 blink::WebEffectiveConnectionType getEffectiveConnectionType() override { |
| 196 if (test_client()->getEffectiveConnectionType() != |
| 197 blink::WebEffectiveConnectionType::TypeUnknown) { |
| 198 return test_client()->getEffectiveConnectionType(); |
| 199 } |
| 200 return Base::getEffectiveConnectionType(); |
| 201 } |
| 202 |
| 194 void runModalAlertDialog(const blink::WebString& message) override { | 203 void runModalAlertDialog(const blink::WebString& message) override { |
| 195 test_client()->runModalAlertDialog(message); | 204 test_client()->runModalAlertDialog(message); |
| 196 } | 205 } |
| 197 | 206 |
| 198 bool runModalConfirmDialog(const blink::WebString& message) override { | 207 bool runModalConfirmDialog(const blink::WebString& message) override { |
| 199 return test_client()->runModalConfirmDialog(message); | 208 return test_client()->runModalConfirmDialog(message); |
| 200 } | 209 } |
| 201 | 210 |
| 202 bool runModalPromptDialog(const blink::WebString& message, | 211 bool runModalPromptDialog(const blink::WebString& message, |
| 203 const blink::WebString& default_value, | 212 const blink::WebString& default_value, |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 return test_client()->runFileChooser(params, completion); | 299 return test_client()->runFileChooser(params, completion); |
| 291 } | 300 } |
| 292 | 301 |
| 293 private: | 302 private: |
| 294 DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxy); | 303 DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxy); |
| 295 }; | 304 }; |
| 296 | 305 |
| 297 } // namespace test_runner | 306 } // namespace test_runner |
| 298 | 307 |
| 299 #endif // COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ | 308 #endif // COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ |
| OLD | NEW |