| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_TEST_INTERFACES_H_ | 5 #ifndef COMPONENTS_TEST_RUNNER_WEB_TEST_INTERFACES_H_ |
| 6 #define COMPONENTS_TEST_RUNNER_WEB_TEST_INTERFACES_H_ | 6 #define COMPONENTS_TEST_RUNNER_WEB_TEST_INTERFACES_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 class WebTestRunner; | 37 class WebTestRunner; |
| 38 class WebViewTestClient; | 38 class WebViewTestClient; |
| 39 | 39 |
| 40 class TEST_RUNNER_EXPORT WebTestInterfaces { | 40 class TEST_RUNNER_EXPORT WebTestInterfaces { |
| 41 public: | 41 public: |
| 42 WebTestInterfaces(); | 42 WebTestInterfaces(); |
| 43 ~WebTestInterfaces(); | 43 ~WebTestInterfaces(); |
| 44 | 44 |
| 45 void SetWebView(blink::WebView* web_view, WebTestProxyBase* proxy); | 45 void SetWebView(blink::WebView* web_view, WebTestProxyBase* proxy); |
| 46 void SetDelegate(WebTestDelegate* delegate); | 46 void SetDelegate(WebTestDelegate* delegate); |
| 47 void BindTo(blink::WebFrame* frame); | |
| 48 void ResetAll(); | 47 void ResetAll(); |
| 49 void SetTestIsRunning(bool running); | 48 void SetTestIsRunning(bool running); |
| 50 void ConfigureForTestWithURL(const blink::WebURL& test_url, | 49 void ConfigureForTestWithURL(const blink::WebURL& test_url, |
| 51 bool generate_pixels); | 50 bool generate_pixels); |
| 52 void SetSendWheelGestures(bool send_gestures); | |
| 53 | 51 |
| 54 WebTestRunner* TestRunner(); | 52 WebTestRunner* TestRunner(); |
| 55 blink::WebThemeEngine* ThemeEngine(); | 53 blink::WebThemeEngine* ThemeEngine(); |
| 56 | 54 |
| 57 blink::WebMediaStreamCenter* CreateMediaStreamCenter( | 55 blink::WebMediaStreamCenter* CreateMediaStreamCenter( |
| 58 blink::WebMediaStreamCenterClient* client); | 56 blink::WebMediaStreamCenterClient* client); |
| 59 blink::WebRTCPeerConnectionHandler* CreateWebRTCPeerConnectionHandler( | 57 blink::WebRTCPeerConnectionHandler* CreateWebRTCPeerConnectionHandler( |
| 60 blink::WebRTCPeerConnectionHandlerClient* client); | 58 blink::WebRTCPeerConnectionHandlerClient* client); |
| 61 | 59 |
| 62 blink::WebMIDIAccessor* CreateMIDIAccessor( | 60 blink::WebMIDIAccessor* CreateMIDIAccessor( |
| 63 blink::WebMIDIAccessorClient* client); | 61 blink::WebMIDIAccessorClient* client); |
| 64 | 62 |
| 65 blink::WebAudioDevice* CreateAudioDevice(double sample_rate); | 63 blink::WebAudioDevice* CreateAudioDevice(double sample_rate); |
| 66 | 64 |
| 67 scoped_ptr<blink::WebAppBannerClient> CreateAppBannerClient(); | 65 scoped_ptr<blink::WebAppBannerClient> CreateAppBannerClient(); |
| 68 | 66 |
| 69 TestInterfaces* GetTestInterfaces(); | 67 TestInterfaces* GetTestInterfaces(); |
| 70 | 68 |
| 71 // Creates a WebFrameClient implementation providing test behavior (i.e. | 69 // Creates a WebFrameClient implementation providing test behavior (i.e. |
| 72 // forwarding javascript console output to the test harness). The caller | 70 // forwarding javascript console output to the test harness). The caller |
| 73 // should guarantee that the returned object won't be used beyond the lifetime | 71 // should guarantee that the returned object won't be used beyond the lifetime |
| 74 // of WebTestInterfaces. | 72 // of WebTestInterfaces and/or the lifetime of |web_test_proxy_base|. |
| 75 scoped_ptr<WebFrameTestClient> CreateWebFrameTestClient(); | 73 scoped_ptr<WebFrameTestClient> CreateWebFrameTestClient( |
| 74 WebTestProxyBase* web_test_proxy_base); |
| 76 | 75 |
| 77 // Creates a WebViewClient implementation providing test behavior (i.e. | 76 // Creates a WebViewClient implementation providing test behavior (i.e. |
| 78 // providing a mocked speech recognizer). The caller should guarantee that | 77 // providing a mocked speech recognizer). The caller should guarantee that |
| 79 // the returned pointer won't be used beyond the lifetime of WebTestInterfaces | 78 // the returned pointer won't be used beyond the lifetime of WebTestInterfaces |
| 80 // and/or the lifetime of |web_test_proxy_base|. | 79 // and/or the lifetime of |web_test_proxy_base|. |
| 81 scoped_ptr<WebViewTestClient> CreateWebViewTestClient( | 80 scoped_ptr<WebViewTestClient> CreateWebViewTestClient( |
| 82 WebTestProxyBase* web_test_proxy_base); | 81 WebTestProxyBase* web_test_proxy_base); |
| 83 | 82 |
| 84 // Gets a list of currently opened windows created by the current test. | 83 // Gets a list of currently opened windows created by the current test. |
| 85 std::vector<blink::WebView*> GetWindowList(); | 84 std::vector<blink::WebView*> GetWindowList(); |
| 86 | 85 |
| 87 private: | 86 private: |
| 88 scoped_ptr<TestInterfaces> interfaces_; | 87 scoped_ptr<TestInterfaces> interfaces_; |
| 89 | 88 |
| 90 DISALLOW_COPY_AND_ASSIGN(WebTestInterfaces); | 89 DISALLOW_COPY_AND_ASSIGN(WebTestInterfaces); |
| 91 }; | 90 }; |
| 92 | 91 |
| 93 } // namespace test_runner | 92 } // namespace test_runner |
| 94 | 93 |
| 95 #endif // COMPONENTS_TEST_RUNNER_WEB_TEST_INTERFACES_H_ | 94 #endif // COMPONENTS_TEST_RUNNER_WEB_TEST_INTERFACES_H_ |
| OLD | NEW |