| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_TEST_RUNNER_WEB_TEST_INTERFACES_H_ | |
| 6 #define COMPONENTS_TEST_RUNNER_WEB_TEST_INTERFACES_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "base/macros.h" | |
| 12 #include "components/test_runner/test_runner_export.h" | |
| 13 | |
| 14 namespace blink { | |
| 15 class WebAudioDevice; | |
| 16 class WebFrameClient; | |
| 17 class WebMediaStreamCenter; | |
| 18 class WebMediaStreamCenterClient; | |
| 19 class WebMIDIAccessor; | |
| 20 class WebMIDIAccessorClient; | |
| 21 class WebRTCPeerConnectionHandler; | |
| 22 class WebRTCPeerConnectionHandlerClient; | |
| 23 class WebThemeEngine; | |
| 24 class WebURL; | |
| 25 class WebView; | |
| 26 } | |
| 27 | |
| 28 namespace test_runner { | |
| 29 | |
| 30 class TestInterfaces; | |
| 31 class WebFrameTestClient; | |
| 32 class WebFrameTestProxyBase; | |
| 33 class WebTestDelegate; | |
| 34 class WebViewTestProxyBase; | |
| 35 class WebWidgetTestProxyBase; | |
| 36 class WebTestRunner; | |
| 37 class WebViewTestClient; | |
| 38 class WebWidgetTestClient; | |
| 39 | |
| 40 class TEST_RUNNER_EXPORT WebTestInterfaces { | |
| 41 public: | |
| 42 WebTestInterfaces(); | |
| 43 ~WebTestInterfaces(); | |
| 44 | |
| 45 void SetMainView(blink::WebView* web_view); | |
| 46 void SetDelegate(WebTestDelegate* delegate); | |
| 47 void ResetAll(); | |
| 48 void SetTestIsRunning(bool running); | |
| 49 void ConfigureForTestWithURL(const blink::WebURL& test_url, | |
| 50 bool generate_pixels); | |
| 51 | |
| 52 WebTestRunner* TestRunner(); | |
| 53 blink::WebThemeEngine* ThemeEngine(); | |
| 54 | |
| 55 blink::WebMediaStreamCenter* CreateMediaStreamCenter( | |
| 56 blink::WebMediaStreamCenterClient* client); | |
| 57 blink::WebRTCPeerConnectionHandler* CreateWebRTCPeerConnectionHandler( | |
| 58 blink::WebRTCPeerConnectionHandlerClient* client); | |
| 59 | |
| 60 blink::WebMIDIAccessor* CreateMIDIAccessor( | |
| 61 blink::WebMIDIAccessorClient* client); | |
| 62 | |
| 63 blink::WebAudioDevice* CreateAudioDevice(double sample_rate, | |
| 64 int frames_per_buffer); | |
| 65 | |
| 66 TestInterfaces* GetTestInterfaces(); | |
| 67 | |
| 68 // Creates a WebFrameClient implementation providing test behavior (i.e. | |
| 69 // forwarding javascript console output to the test harness). The caller | |
| 70 // should guarantee that the returned object won't be used beyond the lifetime | |
| 71 // of WebTestInterfaces and/or the lifetime of |web_view_test_proxy_base|. | |
| 72 std::unique_ptr<WebFrameTestClient> CreateWebFrameTestClient( | |
| 73 WebViewTestProxyBase* web_view_test_proxy_base, | |
| 74 WebFrameTestProxyBase* web_frame_test_proxy_base); | |
| 75 | |
| 76 // Creates a WebViewClient implementation providing test behavior (i.e. | |
| 77 // providing a mocked speech recognizer). The caller should guarantee that | |
| 78 // the returned pointer won't be used beyond the lifetime of WebTestInterfaces | |
| 79 // and/or the lifetime of |web_view_test_proxy_base|. | |
| 80 std::unique_ptr<WebViewTestClient> CreateWebViewTestClient( | |
| 81 WebViewTestProxyBase* web_view_test_proxy_base); | |
| 82 | |
| 83 // Creates a WebWidgetClient implementation providing test behavior (i.e. | |
| 84 // providing a mocked screen orientation). The caller should guarantee that | |
| 85 // the returned pointer won't be used beyond the lifetime of WebTestInterfaces | |
| 86 // and/or the lifetime of |web_widget_test_proxy_base|. | |
| 87 std::unique_ptr<WebWidgetTestClient> CreateWebWidgetTestClient( | |
| 88 WebWidgetTestProxyBase* web_widget_test_proxy_base); | |
| 89 | |
| 90 // Gets a list of currently opened windows created by the current test. | |
| 91 std::vector<blink::WebView*> GetWindowList(); | |
| 92 | |
| 93 private: | |
| 94 std::unique_ptr<TestInterfaces> interfaces_; | |
| 95 | |
| 96 DISALLOW_COPY_AND_ASSIGN(WebTestInterfaces); | |
| 97 }; | |
| 98 | |
| 99 } // namespace test_runner | |
| 100 | |
| 101 #endif // COMPONENTS_TEST_RUNNER_WEB_TEST_INTERFACES_H_ | |
| OLD | NEW |