OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/media/mock_data_channel_impl.h" | 5 #include "content/renderer/media/mock_data_channel_impl.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 namespace content { | 9 namespace content { |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 bool MockDataChannel::negotiated() const { return config_.negotiated; } | 47 bool MockDataChannel::negotiated() const { return config_.negotiated; } |
48 | 48 |
49 int MockDataChannel::id() const { | 49 int MockDataChannel::id() const { |
50 NOTIMPLEMENTED(); | 50 NOTIMPLEMENTED(); |
51 return 0; | 51 return 0; |
52 } | 52 } |
53 | 53 |
54 MockDataChannel::DataState MockDataChannel::state() const { return state_; } | 54 MockDataChannel::DataState MockDataChannel::state() const { return state_; } |
55 | 55 |
| 56 uint32_t MockDataChannel::messages_sent() const { |
| 57 NOTIMPLEMENTED(); |
| 58 return 0; |
| 59 } |
| 60 |
| 61 uint64_t MockDataChannel::bytes_sent() const { |
| 62 NOTIMPLEMENTED(); |
| 63 return 0; |
| 64 } |
| 65 |
| 66 uint32_t MockDataChannel::messages_received() const { |
| 67 NOTIMPLEMENTED(); |
| 68 return 0; |
| 69 } |
| 70 |
| 71 uint64_t MockDataChannel::bytes_received() const { |
| 72 NOTIMPLEMENTED(); |
| 73 return 0; |
| 74 } |
| 75 |
56 // For testing. | 76 // For testing. |
57 void MockDataChannel::changeState(DataState state) { | 77 void MockDataChannel::changeState(DataState state) { |
58 state_ = state; | 78 state_ = state; |
59 if (observer_) | 79 if (observer_) |
60 observer_->OnStateChange(); | 80 observer_->OnStateChange(); |
61 } | 81 } |
62 | 82 |
63 uint64_t MockDataChannel::buffered_amount() const { | 83 uint64_t MockDataChannel::buffered_amount() const { |
64 NOTIMPLEMENTED(); | 84 NOTIMPLEMENTED(); |
65 return 0; | 85 return 0; |
66 } | 86 } |
67 | 87 |
68 void MockDataChannel::Close() { | 88 void MockDataChannel::Close() { |
69 changeState(webrtc::DataChannelInterface::kClosing); | 89 changeState(webrtc::DataChannelInterface::kClosing); |
70 } | 90 } |
71 | 91 |
72 bool MockDataChannel::Send(const webrtc::DataBuffer& buffer) { | 92 bool MockDataChannel::Send(const webrtc::DataBuffer& buffer) { |
73 return state_ == webrtc::DataChannelInterface::kOpen; | 93 return state_ == webrtc::DataChannelInterface::kOpen; |
74 } | 94 } |
75 | 95 |
76 } // namespace content | 96 } // namespace content |
OLD | NEW |