1 // Copyright 2014 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 #ifndef CONTENT_RENDERER_MEDIA_MOCK_DATA_CHANNEL_IMPL_H_
6 #define CONTENT_RENDERER_MEDIA_MOCK_DATA_CHANNEL_IMPL_H_
10 #include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h"
14 class MockDataChannel
: public webrtc::DataChannelInterface
{
16 MockDataChannel(const std::string
& label
,
17 const webrtc::DataChannelInit
* config
);
19 void RegisterObserver(webrtc::DataChannelObserver
* observer
) override
;
20 void UnregisterObserver() override
;
21 std::string
label() const override
;
22 bool reliable() const override
;
23 bool ordered() const override
;
24 unsigned short maxRetransmitTime() const override
;
25 unsigned short maxRetransmits() const override
;
26 std::string
protocol() const override
;
27 bool negotiated() const override
;
28 int id() const override
;
29 DataState
state() const override
;
30 uint64
buffered_amount() const override
;
31 void Close() override
;
32 bool Send(const webrtc::DataBuffer
& buffer
) override
;
35 void changeState(DataState state
);
38 ~MockDataChannel() override
;
43 webrtc::DataChannelInterface::DataState state_
;
44 webrtc::DataChannelInit config_
;
45 webrtc::DataChannelObserver
* observer_
;
47 DISALLOW_COPY_AND_ASSIGN(MockDataChannel
);
50 } // namespace content
52 #endif // CONTENT_RENDERER_MEDIA_MOCK_DATA_CHANNEL_IMPL_H_