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