OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_TEST_RUNNER_FOR_SPECIFIC_VIEW_H_ | 5 #ifndef COMPONENTS_TEST_RUNNER_TEST_RUNNER_FOR_SPECIFIC_VIEW_H_ |
6 #define COMPONENTS_TEST_RUNNER_TEST_RUNNER_FOR_SPECIFIC_VIEW_H_ | 6 #define COMPONENTS_TEST_RUNNER_TEST_RUNNER_FOR_SPECIFIC_VIEW_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 13 matching lines...) Expand all Loading... |
24 } | 24 } |
25 | 25 |
26 namespace gin { | 26 namespace gin { |
27 class ArrayBufferView; | 27 class ArrayBufferView; |
28 class Arguments; | 28 class Arguments; |
29 } | 29 } |
30 | 30 |
31 namespace test_runner { | 31 namespace test_runner { |
32 | 32 |
33 class WebTestDelegate; | 33 class WebTestDelegate; |
34 class WebTestProxyBase; | 34 class WebViewTestProxyBase; |
35 | 35 |
36 // TestRunnerForSpecificView implements part of |testRunner| javascript bindings | 36 // TestRunnerForSpecificView implements part of |testRunner| javascript bindings |
37 // that work with a view where the javascript call originated from. Examples: | 37 // that work with a view where the javascript call originated from. Examples: |
38 // - testRunner.capturePixelsAsyncThen | 38 // - testRunner.capturePixelsAsyncThen |
39 // - testRunner.setPageVisibility | 39 // - testRunner.setPageVisibility |
40 // Note that "global" bindings are handled by TestRunner class. | 40 // Note that "global" bindings are handled by TestRunner class. |
41 class TestRunnerForSpecificView { | 41 class TestRunnerForSpecificView { |
42 public: | 42 public: |
43 explicit TestRunnerForSpecificView(WebTestProxyBase* web_test_proxy_base); | 43 explicit TestRunnerForSpecificView( |
| 44 WebViewTestProxyBase* web_view_test_proxy_base); |
44 ~TestRunnerForSpecificView(); | 45 ~TestRunnerForSpecificView(); |
45 | 46 |
46 // Installs view-specific bindings (handled by |this|) and *also* global | 47 // Installs view-specific bindings (handled by |this|) and *also* global |
47 // TestRunner bindings (both kinds of bindings are exposed via a single | 48 // TestRunner bindings (both kinds of bindings are exposed via a single |
48 // |testRunner| object in javascript). | 49 // |testRunner| object in javascript). |
49 void Install(blink::WebLocalFrame* frame); | 50 void Install(blink::WebLocalFrame* frame); |
50 | 51 |
51 void Reset(); | 52 void Reset(); |
52 | 53 |
53 // Pointer lock methods used by WebViewTestClient. | 54 // Pointer lock methods used by WebViewTestClient. |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 void EvaluateScriptInIsolatedWorld(int world_id, const std::string& script); | 210 void EvaluateScriptInIsolatedWorld(int world_id, const std::string& script); |
210 void SetIsolatedWorldSecurityOrigin(int world_id, | 211 void SetIsolatedWorldSecurityOrigin(int world_id, |
211 v8::Local<v8::Value> origin); | 212 v8::Local<v8::Value> origin); |
212 void SetIsolatedWorldContentSecurityPolicy(int world_id, | 213 void SetIsolatedWorldContentSecurityPolicy(int world_id, |
213 const std::string& policy); | 214 const std::string& policy); |
214 bool FindString(const std::string& search_text, | 215 bool FindString(const std::string& search_text, |
215 const std::vector<std::string>& options_array); | 216 const std::vector<std::string>& options_array); |
216 std::string SelectionAsMarkup(); | 217 std::string SelectionAsMarkup(); |
217 void SetViewSourceForFrame(const std::string& name, bool enabled); | 218 void SetViewSourceForFrame(const std::string& name, bool enabled); |
218 | 219 |
219 // Helpers for accessing pointers exposed by |web_test_proxy_base_|. | 220 // Helpers for accessing pointers exposed by |web_view_test_proxy_base_|. |
220 blink::WebView* web_view(); | 221 blink::WebView* web_view(); |
221 WebTestDelegate* delegate(); | 222 WebTestDelegate* delegate(); |
222 WebTestProxyBase* web_test_proxy_base_; | 223 WebViewTestProxyBase* web_view_test_proxy_base_; |
223 | 224 |
224 base::WeakPtrFactory<TestRunnerForSpecificView> weak_factory_; | 225 base::WeakPtrFactory<TestRunnerForSpecificView> weak_factory_; |
225 | 226 |
226 DISALLOW_COPY_AND_ASSIGN(TestRunnerForSpecificView); | 227 DISALLOW_COPY_AND_ASSIGN(TestRunnerForSpecificView); |
227 }; | 228 }; |
228 | 229 |
229 } // namespace test_runner | 230 } // namespace test_runner |
230 | 231 |
231 #endif // COMPONENTS_TEST_RUNNER_TEST_RUNNER_FOR_SPECIFIC_VIEW_H_ | 232 #endif // COMPONENTS_TEST_RUNNER_TEST_RUNNER_FOR_SPECIFIC_VIEW_H_ |
OLD | NEW |