| OLD | NEW |
| (Empty) | |
| 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 /* |
| 6 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 7 * |
| 8 * Redistribution and use in source and binary forms, with or without |
| 9 * modification, are permitted provided that the following conditions are |
| 10 * met: |
| 11 * |
| 12 * * Redistributions of source code must retain the above copyright |
| 13 * notice, this list of conditions and the following disclaimer. |
| 14 * * Redistributions in binary form must reproduce the above |
| 15 * copyright notice, this list of conditions and the following disclaimer |
| 16 * in the documentation and/or other materials provided with the |
| 17 * distribution. |
| 18 * * Neither the name of Google Inc. nor the names of its |
| 19 * contributors may be used to endorse or promote products derived from |
| 20 * this software without specific prior written permission. |
| 21 * |
| 22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 33 */ |
| 34 |
| 35 #include "content/public/test/layout_tests/WebTestInterfaces.h" |
| 36 |
| 37 #include "content/test/layout_tests/runner/MockWebAudioDevice.h" |
| 38 #include "content/test/layout_tests/runner/MockWebMediaStreamCenter.h" |
| 39 #include "content/test/layout_tests/runner/MockWebMIDIAccessor.h" |
| 40 #include "content/test/layout_tests/runner/MockWebRTCPeerConnectionHandler.h" |
| 41 #include "content/test/layout_tests/runner/TestInterfaces.h" |
| 42 #include "content/test/layout_tests/runner/TestRunner.h" |
| 43 |
| 44 using namespace blink; |
| 45 |
| 46 namespace WebTestRunner { |
| 47 |
| 48 WebTestInterfaces::WebTestInterfaces() |
| 49 : m_interfaces(new TestInterfaces()) |
| 50 { |
| 51 } |
| 52 |
| 53 WebTestInterfaces::~WebTestInterfaces() |
| 54 { |
| 55 } |
| 56 |
| 57 void WebTestInterfaces::setWebView(WebView* webView, WebTestProxyBase* proxy) |
| 58 { |
| 59 m_interfaces->setWebView(webView, proxy); |
| 60 } |
| 61 |
| 62 void WebTestInterfaces::setDelegate(WebTestDelegate* delegate) |
| 63 { |
| 64 m_interfaces->setDelegate(delegate); |
| 65 } |
| 66 |
| 67 void WebTestInterfaces::bindTo(WebFrame* frame) |
| 68 { |
| 69 m_interfaces->bindTo(frame); |
| 70 } |
| 71 |
| 72 void WebTestInterfaces::resetAll() |
| 73 { |
| 74 m_interfaces->resetAll(); |
| 75 } |
| 76 |
| 77 void WebTestInterfaces::setTestIsRunning(bool running) |
| 78 { |
| 79 m_interfaces->setTestIsRunning(running); |
| 80 } |
| 81 |
| 82 void WebTestInterfaces::configureForTestWithURL(const WebURL& testURL, bool gene
ratePixels) |
| 83 { |
| 84 m_interfaces->configureForTestWithURL(testURL, generatePixels); |
| 85 } |
| 86 |
| 87 WebTestRunner* WebTestInterfaces::testRunner() |
| 88 { |
| 89 return m_interfaces->testRunner(); |
| 90 } |
| 91 |
| 92 WebThemeEngine* WebTestInterfaces::themeEngine() |
| 93 { |
| 94 return m_interfaces->themeEngine(); |
| 95 } |
| 96 |
| 97 TestInterfaces* WebTestInterfaces::testInterfaces() |
| 98 { |
| 99 return m_interfaces.get(); |
| 100 } |
| 101 |
| 102 WebMediaStreamCenter* WebTestInterfaces::createMediaStreamCenter(WebMediaStreamC
enterClient* client) |
| 103 { |
| 104 return new MockWebMediaStreamCenter(client); |
| 105 } |
| 106 |
| 107 WebRTCPeerConnectionHandler* WebTestInterfaces::createWebRTCPeerConnectionHandle
r(WebRTCPeerConnectionHandlerClient* client) |
| 108 { |
| 109 return new MockWebRTCPeerConnectionHandler(client, m_interfaces.get()); |
| 110 } |
| 111 |
| 112 WebMIDIAccessor* WebTestInterfaces::createMIDIAccessor(WebMIDIAccessorClient* cl
ient) |
| 113 { |
| 114 return new MockWebMIDIAccessor(client, m_interfaces.get()); |
| 115 } |
| 116 |
| 117 WebAudioDevice* WebTestInterfaces::createAudioDevice(double sampleRate) |
| 118 { |
| 119 return new MockWebAudioDevice(sampleRate); |
| 120 } |
| 121 |
| 122 } |
| OLD | NEW |