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/web_test_interfaces.h" 6 7 #include "content/shell/renderer/test_runner/mock_web_audio_device.h" 8 #include "content/shell/renderer/test_runner/mock_web_media_stream_center.h" 9 #include "content/shell/renderer/test_runner/mock_web_midi_accessor.h" 10 #include "content/shell/renderer/test_runner/mock_webrtc_peer_connection_handler.h" 11 #include "content/shell/renderer/test_runner/test_interfaces.h" 12 #include "content/shell/renderer/test_runner/test_runner.h" 13 14 using namespace blink; 15 16 namespace content { 17 18 WebTestInterfaces::WebTestInterfaces() : interfaces_(new TestInterfaces()) { 19 } 20 21 WebTestInterfaces::~WebTestInterfaces() { 22 } 23 24 void WebTestInterfaces::SetWebView(WebView* web_view, WebTestProxyBase* proxy) { 25 interfaces_->SetWebView(web_view, proxy); 26 } 27 28 void WebTestInterfaces::SetDelegate(WebTestDelegate* delegate) { 29 interfaces_->SetDelegate(delegate); 30 } 31 32 void WebTestInterfaces::BindTo(WebFrame* frame) { 33 interfaces_->BindTo(frame); 34 } 35 36 void WebTestInterfaces::ResetAll() { 37 interfaces_->ResetAll(); 38 } 39 40 void WebTestInterfaces::SetTestIsRunning(bool running) { 41 interfaces_->SetTestIsRunning(running); 42 } 43 44 void WebTestInterfaces::ConfigureForTestWithURL(const WebURL& test_url, 45 bool generate_pixels) { 46 interfaces_->ConfigureForTestWithURL(test_url, generate_pixels); 47 } 48 49 WebTestRunner* WebTestInterfaces::TestRunner() { 50 return interfaces_->GetTestRunner(); 51 } 52 53 WebThemeEngine* WebTestInterfaces::ThemeEngine() { 54 return interfaces_->GetThemeEngine(); 55 } 56 57 TestInterfaces* WebTestInterfaces::GetTestInterfaces() { 58 return interfaces_.get(); 59 } 60 61 WebMediaStreamCenter* WebTestInterfaces::CreateMediaStreamCenter( 62 WebMediaStreamCenterClient* client) { 63 return new MockWebMediaStreamCenter(client, interfaces_.get()); 64 } 65 66 WebRTCPeerConnectionHandler* 67 WebTestInterfaces::CreateWebRTCPeerConnectionHandler( 68 WebRTCPeerConnectionHandlerClient* client) { 69 return new MockWebRTCPeerConnectionHandler(client, interfaces_.get()); 70 } 71 72 WebMIDIAccessor* WebTestInterfaces::CreateMIDIAccessor( 73 WebMIDIAccessorClient* client) { 74 return new MockWebMIDIAccessor(client, interfaces_.get()); 75 } 76 77 WebAudioDevice* WebTestInterfaces::CreateAudioDevice(double sample_rate) { 78 return new MockWebAudioDevice(sample_rate); 79 } 80 81 } // namespace content 82