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 "base/macros.h"
11 #include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h"
15 class MockDataChannel
: public webrtc::DataChannelInterface
{
17 MockDataChannel(const std::string
& label
,
18 const webrtc::DataChannelInit
* config
);
20 void RegisterObserver(webrtc::DataChannelObserver
* observer
) override
;
21 void UnregisterObserver() override
;
22 std::string
label() const override
;
23 bool reliable() const override
;
24 bool ordered() const override
;
25 unsigned short maxRetransmitTime() const override
;
26 unsigned short maxRetransmits() const override
;
27 std::string
protocol() const override
;
28 bool negotiated() const override
;
29 int id() const override
;
30 DataState
state() const override
;
31 uint64
buffered_amount() const override
;
32 void Close() override
;
33 bool Send(const webrtc::DataBuffer
& buffer
) override
;
36 void changeState(DataState state
);
39 ~MockDataChannel() override
;
44 webrtc::DataChannelInterface::DataState state_
;
45 webrtc::DataChannelInit config_
;
46 webrtc::DataChannelObserver
* observer_
;
48 DISALLOW_COPY_AND_ASSIGN(MockDataChannel
);
51 } // namespace content
53 #endif // CONTENT_RENDERER_MEDIA_MOCK_DATA_CHANNEL_IMPL_H_