Update WebTask in chromium c++ style
[chromium-blink-merge.git] / content / shell / renderer / test_runner / WebTestInterfaces.cpp
blob513cc591bda6c3a8f5784c2c7fb35588dd1ee63c
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.
5 #include "content/shell/renderer/test_runner/WebTestInterfaces.h"
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"
14 using namespace blink;
16 namespace content {
18 WebTestInterfaces::WebTestInterfaces()
19 : m_interfaces(new TestInterfaces())
23 WebTestInterfaces::~WebTestInterfaces()
27 void WebTestInterfaces::setWebView(WebView* webView, WebTestProxyBase* proxy)
29 m_interfaces->SetWebView(webView, proxy);
32 void WebTestInterfaces::setDelegate(WebTestDelegate* delegate)
34 m_interfaces->SetDelegate(delegate);
37 void WebTestInterfaces::bindTo(WebFrame* frame)
39 m_interfaces->BindTo(frame);
42 void WebTestInterfaces::resetAll()
44 m_interfaces->ResetAll();
47 void WebTestInterfaces::setTestIsRunning(bool running)
49 m_interfaces->SetTestIsRunning(running);
52 void WebTestInterfaces::configureForTestWithURL(const WebURL& testURL, bool generatePixels)
54 m_interfaces->ConfigureForTestWithURL(testURL, generatePixels);
57 WebTestRunner* WebTestInterfaces::testRunner()
59 return m_interfaces->GetTestRunner();
62 WebThemeEngine* WebTestInterfaces::themeEngine()
64 return m_interfaces->GetThemeEngine();
67 TestInterfaces* WebTestInterfaces::testInterfaces()
69 return m_interfaces.get();
72 WebMediaStreamCenter* WebTestInterfaces::createMediaStreamCenter(WebMediaStreamCenterClient* client)
74 return new MockWebMediaStreamCenter(client, m_interfaces.get());
77 WebRTCPeerConnectionHandler* WebTestInterfaces::createWebRTCPeerConnectionHandler(WebRTCPeerConnectionHandlerClient* client)
79 return new MockWebRTCPeerConnectionHandler(client, m_interfaces.get());
82 WebMIDIAccessor* WebTestInterfaces::createMIDIAccessor(WebMIDIAccessorClient* client)
84 return new MockWebMIDIAccessor(client, m_interfaces.get());
87 WebAudioDevice* WebTestInterfaces::createAudioDevice(double sampleRate)
89 return new MockWebAudioDevice(sampleRate);
92 } // namespace content