blob: ca8aabda522809911f2c4542d36a92a41722cbd6 [file] [log] [blame]
abhishek.a21bdd07a82014-09-25 06:34:101// 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
jochen73e711c2015-06-03 10:01:465#include "components/test_runner/web_test_interfaces.h"
abhishek.a21bdd07a82014-09-25 06:34:106
jochen73e711c2015-06-03 10:01:467#include "components/test_runner/app_banner_client.h"
8#include "components/test_runner/mock_web_audio_device.h"
9#include "components/test_runner/mock_web_media_stream_center.h"
10#include "components/test_runner/mock_web_midi_accessor.h"
11#include "components/test_runner/mock_webrtc_peer_connection_handler.h"
12#include "components/test_runner/test_interfaces.h"
13#include "components/test_runner/test_runner.h"
abhishek.a21bdd07a82014-09-25 06:34:1014
15using namespace blink;
16
jochenf5f31752015-06-03 12:06:3417namespace test_runner {
abhishek.a21bdd07a82014-09-25 06:34:1018
19WebTestInterfaces::WebTestInterfaces() : interfaces_(new TestInterfaces()) {
20}
21
22WebTestInterfaces::~WebTestInterfaces() {
23}
24
25void WebTestInterfaces::SetWebView(WebView* web_view, WebTestProxyBase* proxy) {
26 interfaces_->SetWebView(web_view, proxy);
27}
28
29void WebTestInterfaces::SetDelegate(WebTestDelegate* delegate) {
30 interfaces_->SetDelegate(delegate);
31}
32
33void WebTestInterfaces::BindTo(WebFrame* frame) {
34 interfaces_->BindTo(frame);
35}
36
37void WebTestInterfaces::ResetAll() {
38 interfaces_->ResetAll();
39}
40
41void WebTestInterfaces::SetTestIsRunning(bool running) {
42 interfaces_->SetTestIsRunning(running);
43}
44
45void WebTestInterfaces::ConfigureForTestWithURL(const WebURL& test_url,
46 bool generate_pixels) {
47 interfaces_->ConfigureForTestWithURL(test_url, generate_pixels);
48}
49
50WebTestRunner* WebTestInterfaces::TestRunner() {
51 return interfaces_->GetTestRunner();
52}
53
54WebThemeEngine* WebTestInterfaces::ThemeEngine() {
55 return interfaces_->GetThemeEngine();
56}
57
58TestInterfaces* WebTestInterfaces::GetTestInterfaces() {
59 return interfaces_.get();
60}
61
62WebMediaStreamCenter* WebTestInterfaces::CreateMediaStreamCenter(
63 WebMediaStreamCenterClient* client) {
64 return new MockWebMediaStreamCenter(client, interfaces_.get());
65}
66
67WebRTCPeerConnectionHandler*
68WebTestInterfaces::CreateWebRTCPeerConnectionHandler(
69 WebRTCPeerConnectionHandlerClient* client) {
70 return new MockWebRTCPeerConnectionHandler(client, interfaces_.get());
71}
72
73WebMIDIAccessor* WebTestInterfaces::CreateMIDIAccessor(
74 WebMIDIAccessorClient* client) {
75 return new MockWebMIDIAccessor(client, interfaces_.get());
76}
77
78WebAudioDevice* WebTestInterfaces::CreateAudioDevice(double sample_rate) {
79 return new MockWebAudioDevice(sample_rate);
80}
81
benwells0c0d3f12015-05-25 01:03:1782scoped_ptr<blink::WebAppBannerClient>
83WebTestInterfaces::CreateAppBannerClient() {
84 scoped_ptr<AppBannerClient> client(new AppBannerClient);
85 interfaces_->SetAppBannerClient(client.get());
86 return client.Pass();
87}
88
jochen746754c52015-06-05 16:40:4189AppBannerClient* WebTestInterfaces::GetAppBannerClient() {
90 return interfaces_->GetAppBannerClient();
91}
92
jochenf5f31752015-06-03 12:06:3493} // namespace test_runner