| 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 |
| 10 * are met: |
| 11 * 1. Redistributions of source code must retain the above copyright |
| 12 * notice, this list of conditions and the following disclaimer. |
| 13 * 2. Redistributions in binary form must reproduce the above copyright |
| 14 * notice, this list of conditions and the following disclaimer in the |
| 15 * documentation and/or other materials provided with the distribution. |
| 16 * |
| 17 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND AN
Y |
| 18 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 20 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR AN
Y |
| 21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND O
N |
| 24 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 26 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 */ |
| 28 |
| 29 #ifndef MockWebRTCDataChannelHandler_h |
| 30 #define MockWebRTCDataChannelHandler_h |
| 31 |
| 32 #include "content/public/test/layout_tests/WebTask.h" |
| 33 #include "content/test/layout_tests/runner/TestCommon.h" |
| 34 #include "third_party/WebKit/public/platform/WebNonCopyable.h" |
| 35 #include "third_party/WebKit/public/platform/WebRTCDataChannelHandler.h" |
| 36 #include "third_party/WebKit/public/platform/WebRTCDataChannelInit.h" |
| 37 #include "third_party/WebKit/public/platform/WebString.h" |
| 38 |
| 39 namespace WebTestRunner { |
| 40 |
| 41 class WebTestDelegate; |
| 42 |
| 43 class MockWebRTCDataChannelHandler : public blink::WebRTCDataChannelHandler, pub
lic blink::WebNonCopyable { |
| 44 public: |
| 45 MockWebRTCDataChannelHandler(blink::WebString label, const blink::WebRTCData
ChannelInit&, WebTestDelegate*); |
| 46 |
| 47 virtual void setClient(blink::WebRTCDataChannelHandlerClient*) OVERRIDE; |
| 48 virtual blink::WebString label() OVERRIDE { return m_label; } |
| 49 virtual bool isReliable() OVERRIDE { return m_reliable; } |
| 50 virtual bool ordered() const OVERRIDE; |
| 51 virtual unsigned short maxRetransmitTime() const OVERRIDE; |
| 52 virtual unsigned short maxRetransmits() const OVERRIDE; |
| 53 virtual blink::WebString protocol() const OVERRIDE; |
| 54 virtual bool negotiated() const OVERRIDE; |
| 55 virtual unsigned short id() const OVERRIDE; |
| 56 virtual unsigned long bufferedAmount() OVERRIDE; |
| 57 virtual bool sendStringData(const blink::WebString&) OVERRIDE; |
| 58 virtual bool sendRawData(const char*, size_t) OVERRIDE; |
| 59 virtual void close() OVERRIDE; |
| 60 |
| 61 // WebTask related methods |
| 62 WebTaskList* taskList() { return &m_taskList; } |
| 63 |
| 64 private: |
| 65 MockWebRTCDataChannelHandler(); |
| 66 |
| 67 blink::WebRTCDataChannelHandlerClient* m_client; |
| 68 blink::WebString m_label; |
| 69 blink::WebRTCDataChannelInit m_init; |
| 70 bool m_reliable; |
| 71 WebTaskList m_taskList; |
| 72 WebTestDelegate* m_delegate; |
| 73 }; |
| 74 |
| 75 } |
| 76 |
| 77 #endif // MockWebRTCDataChannelHandler_h |
| OLD | NEW |