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 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" 6 7 #include "content/shell/renderer/test_runner/MockWebMIDIAccessor.h" 8 #include "content/shell/renderer/test_runner/MockWebMediaStreamCenter.h" 9 #include "content/shell/renderer/test_runner/TestInterfaces.h" 10 #include "content/shell/renderer/test_runner/mock_web_audio_device.h" 11 #include "content/shell/renderer/test_runner/mock_webrtc_peer_connection_handler.h" 12 #include "content/shell/renderer/test_runner/test_runner.h" 13 14 using namespace blink; 15 16 namespace content { 17 WebTestInterfaces()18WebTestInterfaces::WebTestInterfaces() 19 : m_interfaces(new TestInterfaces()) 20 { 21 } 22 ~WebTestInterfaces()23WebTestInterfaces::~WebTestInterfaces() 24 { 25 } 26 setWebView(WebView * webView,WebTestProxyBase * proxy)27void WebTestInterfaces::setWebView(WebView* webView, WebTestProxyBase* proxy) 28 { 29 m_interfaces->setWebView(webView, proxy); 30 } 31 setDelegate(WebTestDelegate * delegate)32void WebTestInterfaces::setDelegate(WebTestDelegate* delegate) 33 { 34 m_interfaces->setDelegate(delegate); 35 } 36 bindTo(WebFrame * frame)37void WebTestInterfaces::bindTo(WebFrame* frame) 38 { 39 m_interfaces->bindTo(frame); 40 } 41 resetAll()42void WebTestInterfaces::resetAll() 43 { 44 m_interfaces->resetAll(); 45 } 46 setTestIsRunning(bool running)47void WebTestInterfaces::setTestIsRunning(bool running) 48 { 49 m_interfaces->setTestIsRunning(running); 50 } 51 configureForTestWithURL(const WebURL & testURL,bool generatePixels)52void WebTestInterfaces::configureForTestWithURL(const WebURL& testURL, bool generatePixels) 53 { 54 m_interfaces->configureForTestWithURL(testURL, generatePixels); 55 } 56 testRunner()57WebTestRunner* WebTestInterfaces::testRunner() 58 { 59 return m_interfaces->testRunner(); 60 } 61 themeEngine()62WebThemeEngine* WebTestInterfaces::themeEngine() 63 { 64 return m_interfaces->themeEngine(); 65 } 66 testInterfaces()67TestInterfaces* WebTestInterfaces::testInterfaces() 68 { 69 return m_interfaces.get(); 70 } 71 createMediaStreamCenter(WebMediaStreamCenterClient * client)72WebMediaStreamCenter* WebTestInterfaces::createMediaStreamCenter(WebMediaStreamCenterClient* client) 73 { 74 return new MockWebMediaStreamCenter(client, m_interfaces.get()); 75 } 76 createWebRTCPeerConnectionHandler(WebRTCPeerConnectionHandlerClient * client)77WebRTCPeerConnectionHandler* WebTestInterfaces::createWebRTCPeerConnectionHandler(WebRTCPeerConnectionHandlerClient* client) 78 { 79 return new MockWebRTCPeerConnectionHandler(client, m_interfaces.get()); 80 } 81 createMIDIAccessor(WebMIDIAccessorClient * client)82WebMIDIAccessor* WebTestInterfaces::createMIDIAccessor(WebMIDIAccessorClient* client) 83 { 84 return new MockWebMIDIAccessor(client, m_interfaces.get()); 85 } 86 createAudioDevice(double sampleRate)87WebAudioDevice* WebTestInterfaces::createAudioDevice(double sampleRate) 88 { 89 return new MockWebAudioDevice(sampleRate); 90 } 91 92 } // namespace content 93