OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_HTML_VIEWER_WEB_TEST_DELEGATE_IMPL_H_ | 5 #ifndef COMPONENTS_HTML_VIEWER_WEB_TEST_DELEGATE_IMPL_H_ |
6 #define COMPONENTS_HTML_VIEWER_WEB_TEST_DELEGATE_IMPL_H_ | 6 #define COMPONENTS_HTML_VIEWER_WEB_TEST_DELEGATE_IMPL_H_ |
7 | 7 |
| 8 #include "base/callback.h" |
8 #include "base/macros.h" | 9 #include "base/macros.h" |
9 #include "components/test_runner/test_preferences.h" | 10 #include "components/test_runner/test_preferences.h" |
10 #include "components/test_runner/web_test_delegate.h" | 11 #include "components/test_runner/web_test_delegate.h" |
11 | 12 |
12 namespace test_runner { | 13 namespace test_runner { |
13 class WebTestInterfaces; | 14 class WebTestInterfaces; |
14 class WebTestProxyBase; | 15 class WebTestProxyBase; |
15 } | 16 } |
16 | 17 |
17 namespace html_viewer { | 18 namespace html_viewer { |
18 | 19 |
19 class WebTestDelegateImpl : public test_runner::WebTestDelegate { | 20 class WebTestDelegateImpl : public test_runner::WebTestDelegate { |
20 public: | 21 public: |
21 WebTestDelegateImpl(); | 22 WebTestDelegateImpl(); |
22 ~WebTestDelegateImpl(); | 23 ~WebTestDelegateImpl(); |
23 | 24 |
24 void set_test_interfaces(test_runner::WebTestInterfaces* test_interfaces) { | 25 void set_test_interfaces(test_runner::WebTestInterfaces* test_interfaces) { |
25 test_interfaces_ = test_interfaces; | 26 test_interfaces_ = test_interfaces; |
26 } | 27 } |
27 void set_test_proxy(test_runner::WebTestProxyBase* proxy) { | 28 void set_test_proxy(test_runner::WebTestProxyBase* proxy) { |
28 proxy_ = proxy; | 29 proxy_ = proxy; |
29 } | 30 } |
| 31 void set_completion_callback(const base::Closure& callback) { |
| 32 completion_callback_ = callback; |
| 33 } |
30 | 34 |
31 private: | 35 private: |
32 // From test_runner::WebTestDelegate: | 36 // From test_runner::WebTestDelegate: |
33 void ClearEditCommand() override; | 37 void ClearEditCommand() override; |
34 void SetEditCommand(const std::string& name, | 38 void SetEditCommand(const std::string& name, |
35 const std::string& value) override; | 39 const std::string& value) override; |
36 void SetGamepadProvider(test_runner::GamepadController* controller) override; | 40 void SetGamepadProvider(test_runner::GamepadController* controller) override; |
37 void SetDeviceLightData(const double data) override; | 41 void SetDeviceLightData(const double data) override; |
38 void SetDeviceMotionData(const blink::WebDeviceMotionData& data) override; | 42 void SetDeviceMotionData(const blink::WebDeviceMotionData& data) override; |
39 void SetDeviceOrientationData( | 43 void SetDeviceOrientationData( |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 const std::string& platform) override; | 111 const std::string& platform) override; |
108 blink::WebPlugin* CreatePluginPlaceholder( | 112 blink::WebPlugin* CreatePluginPlaceholder( |
109 blink::WebLocalFrame* frame, | 113 blink::WebLocalFrame* frame, |
110 const blink::WebPluginParams& params) override; | 114 const blink::WebPluginParams& params) override; |
111 void OnWebTestProxyBaseDestroy(test_runner::WebTestProxyBase* base) override; | 115 void OnWebTestProxyBaseDestroy(test_runner::WebTestProxyBase* base) override; |
112 | 116 |
113 test_runner::TestPreferences prefs_; | 117 test_runner::TestPreferences prefs_; |
114 test_runner::WebTestInterfaces* test_interfaces_; | 118 test_runner::WebTestInterfaces* test_interfaces_; |
115 test_runner::WebTestProxyBase* proxy_; | 119 test_runner::WebTestProxyBase* proxy_; |
116 std::string dump_tree_; | 120 std::string dump_tree_; |
| 121 base::Closure completion_callback_; |
117 | 122 |
118 DISALLOW_COPY_AND_ASSIGN(WebTestDelegateImpl); | 123 DISALLOW_COPY_AND_ASSIGN(WebTestDelegateImpl); |
119 }; | 124 }; |
120 | 125 |
121 } // namespace html_viewer | 126 } // namespace html_viewer |
122 | 127 |
123 #endif // COMPONENTS_HTML_VIEWER_WEB_TEST_DELEGATE_IMPL_H_ | 128 #endif // COMPONENTS_HTML_VIEWER_WEB_TEST_DELEGATE_IMPL_H_ |
OLD | NEW |