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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 std::unique_ptr<cricket::ChannelManager> channel_manager_; | 78 std::unique_ptr<cricket::ChannelManager> channel_manager_; |
79 std::unique_ptr<webrtc::MediaControllerInterface> media_controller_; | 79 std::unique_ptr<webrtc::MediaControllerInterface> media_controller_; |
80 MockWebRtcSession session_; | 80 MockWebRtcSession session_; |
81 MockPeerConnection pc_; | 81 MockPeerConnection pc_; |
82 | 82 |
83 std::vector<rtc::scoped_refptr<DataChannel>> data_channels_; | 83 std::vector<rtc::scoped_refptr<DataChannel>> data_channels_; |
84 }; | 84 }; |
85 | 85 |
86 class RTCTestStats : public RTCStats { | 86 class RTCTestStats : public RTCStats { |
87 public: | 87 public: |
| 88 WEBRTC_RTCSTATS_DECL(); |
| 89 |
88 RTCTestStats(const std::string& id, int64_t timestamp_us) | 90 RTCTestStats(const std::string& id, int64_t timestamp_us) |
89 : RTCStats(id, timestamp_us), | 91 : RTCStats(id, timestamp_us), |
90 dummy_stat("dummyStat") {} | 92 dummy_stat("dummyStat") {} |
91 | 93 |
92 WEBRTC_RTCSTATS_IMPL(RTCStats, RTCTestStats, | |
93 &dummy_stat); | |
94 | |
95 RTCStatsMember<int32_t> dummy_stat; | 94 RTCStatsMember<int32_t> dummy_stat; |
96 }; | 95 }; |
97 | 96 |
98 const char RTCTestStats::kType[] = "test-stats"; | 97 WEBRTC_RTCSTATS_IMPL(RTCTestStats, RTCStats, "test-stats", |
| 98 &dummy_stat); |
99 | 99 |
100 // Overrides the stats collection to verify thread usage and that the resulting | 100 // Overrides the stats collection to verify thread usage and that the resulting |
101 // partial reports are merged. | 101 // partial reports are merged. |
102 class FakeRTCStatsCollector : public RTCStatsCollector, | 102 class FakeRTCStatsCollector : public RTCStatsCollector, |
103 public RTCStatsCollectorCallback { | 103 public RTCStatsCollectorCallback { |
104 public: | 104 public: |
105 static rtc::scoped_refptr<FakeRTCStatsCollector> Create( | 105 static rtc::scoped_refptr<FakeRTCStatsCollector> Create( |
106 PeerConnection* pc, | 106 PeerConnection* pc, |
107 int64_t cache_lifetime_us) { | 107 int64_t cache_lifetime_us) { |
108 return rtc::scoped_refptr<FakeRTCStatsCollector>( | 108 return rtc::scoped_refptr<FakeRTCStatsCollector>( |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 rtc::scoped_refptr<FakeRTCStatsCollector> collector_; | 371 rtc::scoped_refptr<FakeRTCStatsCollector> collector_; |
372 }; | 372 }; |
373 | 373 |
374 TEST_F(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) { | 374 TEST_F(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) { |
375 collector_->VerifyThreadUsageAndResultsMerging(); | 375 collector_->VerifyThreadUsageAndResultsMerging(); |
376 } | 376 } |
377 | 377 |
378 } // namespace | 378 } // namespace |
379 | 379 |
380 } // namespace webrtc | 380 } // namespace webrtc |
OLD | NEW |