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