OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 std::unique_ptr<cricket::ChannelManager> channel_manager_; | 133 std::unique_ptr<cricket::ChannelManager> channel_manager_; |
134 std::unique_ptr<webrtc::MediaControllerInterface> media_controller_; | 134 std::unique_ptr<webrtc::MediaControllerInterface> media_controller_; |
135 MockWebRtcSession session_; | 135 MockWebRtcSession session_; |
136 MockPeerConnection pc_; | 136 MockPeerConnection pc_; |
137 | 137 |
138 std::vector<rtc::scoped_refptr<DataChannel>> data_channels_; | 138 std::vector<rtc::scoped_refptr<DataChannel>> data_channels_; |
139 }; | 139 }; |
140 | 140 |
141 class RTCTestStats : public RTCStats { | 141 class RTCTestStats : public RTCStats { |
142 public: | 142 public: |
| 143 WEBRTC_RTCSTATS_DECL(); |
| 144 |
143 RTCTestStats(const std::string& id, int64_t timestamp_us) | 145 RTCTestStats(const std::string& id, int64_t timestamp_us) |
144 : RTCStats(id, timestamp_us), | 146 : RTCStats(id, timestamp_us), |
145 dummy_stat("dummyStat") {} | 147 dummy_stat("dummyStat") {} |
146 | 148 |
147 WEBRTC_RTCSTATS_IMPL(RTCStats, RTCTestStats, | |
148 &dummy_stat); | |
149 | |
150 RTCStatsMember<int32_t> dummy_stat; | 149 RTCStatsMember<int32_t> dummy_stat; |
151 }; | 150 }; |
152 | 151 |
153 const char RTCTestStats::kType[] = "test-stats"; | 152 WEBRTC_RTCSTATS_IMPL(RTCTestStats, RTCStats, "test-stats", |
| 153 &dummy_stat); |
154 | 154 |
155 // Overrides the stats collection to verify thread usage and that the resulting | 155 // Overrides the stats collection to verify thread usage and that the resulting |
156 // partial reports are merged. | 156 // partial reports are merged. |
157 class FakeRTCStatsCollector : public RTCStatsCollector, | 157 class FakeRTCStatsCollector : public RTCStatsCollector, |
158 public RTCStatsCollectorCallback { | 158 public RTCStatsCollectorCallback { |
159 public: | 159 public: |
160 static rtc::scoped_refptr<FakeRTCStatsCollector> Create( | 160 static rtc::scoped_refptr<FakeRTCStatsCollector> Create( |
161 PeerConnection* pc, | 161 PeerConnection* pc, |
162 int64_t cache_lifetime_us) { | 162 int64_t cache_lifetime_us) { |
163 return rtc::scoped_refptr<FakeRTCStatsCollector>( | 163 return rtc::scoped_refptr<FakeRTCStatsCollector>( |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 rtc::scoped_refptr<FakeRTCStatsCollector> collector_; | 593 rtc::scoped_refptr<FakeRTCStatsCollector> collector_; |
594 }; | 594 }; |
595 | 595 |
596 TEST_F(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) { | 596 TEST_F(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) { |
597 collector_->VerifyThreadUsageAndResultsMerging(); | 597 collector_->VerifyThreadUsageAndResultsMerging(); |
598 } | 598 } |
599 | 599 |
600 } // namespace | 600 } // namespace |
601 | 601 |
602 } // namespace webrtc | 602 } // namespace webrtc |
OLD | NEW |