Chromium Code Reviews| 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 |
| 11 #include "webrtc/api/rtcstatscollector.h" | 11 #include "webrtc/api/rtcstatscollector.h" |
| 12 | 12 |
| 13 #include <memory> | 13 #include <memory> |
| 14 #include <string> | 14 #include <string> |
| 15 #include <vector> | 15 #include <vector> |
| 16 | 16 |
| 17 #include "webrtc/api/jsepsessiondescription.h" | 17 #include "webrtc/api/jsepsessiondescription.h" |
| 18 #include "webrtc/api/stats/rtcstats_objects.h" | 18 #include "webrtc/api/stats/rtcstats_objects.h" |
| 19 #include "webrtc/api/stats/rtcstatsreport.h" | 19 #include "webrtc/api/stats/rtcstatsreport.h" |
| 20 #include "webrtc/api/test/mock_datachannel.h" | 20 #include "webrtc/api/test/mock_datachannel.h" |
| 21 #include "webrtc/api/test/mock_peerconnection.h" | 21 #include "webrtc/api/test/mock_peerconnection.h" |
| 22 #include "webrtc/api/test/mock_webrtcsession.h" | 22 #include "webrtc/api/test/mock_webrtcsession.h" |
| 23 #include "webrtc/base/checks.h" | 23 #include "webrtc/base/checks.h" |
| 24 #include "webrtc/base/fakeclock.h" | 24 #include "webrtc/base/fakeclock.h" |
| 25 #include "webrtc/base/fakesslidentity.h" | |
| 25 #include "webrtc/base/gunit.h" | 26 #include "webrtc/base/gunit.h" |
| 26 #include "webrtc/base/logging.h" | 27 #include "webrtc/base/logging.h" |
| 27 #include "webrtc/base/thread_checker.h" | 28 #include "webrtc/base/thread_checker.h" |
| 28 #include "webrtc/base/timedelta.h" | 29 #include "webrtc/base/timedelta.h" |
| 29 #include "webrtc/base/timeutils.h" | 30 #include "webrtc/base/timeutils.h" |
| 30 #include "webrtc/media/base/fakemediaengine.h" | 31 #include "webrtc/media/base/fakemediaengine.h" |
| 31 | 32 |
| 33 using testing::_; | |
| 34 using testing::Invoke; | |
| 32 using testing::Return; | 35 using testing::Return; |
| 33 using testing::ReturnRef; | 36 using testing::ReturnRef; |
| 34 | 37 |
| 35 namespace webrtc { | 38 namespace webrtc { |
| 36 | 39 |
| 37 namespace { | 40 namespace { |
| 38 | 41 |
| 39 const int64_t kGetStatsReportTimeoutMs = 1000; | 42 const int64_t kGetStatsReportTimeoutMs = 1000; |
| 40 | 43 |
| 44 struct CertificateInfo { | |
| 45 rtc::scoped_refptr<rtc::RTCCertificate> certificate; | |
| 46 std::vector<std::string> ders; | |
| 47 std::vector<std::string> pems; | |
| 48 std::vector<std::string> fingerprints; | |
| 49 }; | |
| 50 | |
| 51 CertificateInfo CreateFakeCertificateAndInfoFromDers( | |
|
hta-webrtc
2016/09/29 13:22:58
This is in the test, so the copying overhead doesn
hbos
2016/10/03 12:11:59
Done.
| |
| 52 const std::vector<std::string>& ders) { | |
| 53 RTC_CHECK(!ders.empty()); | |
| 54 CertificateInfo info; | |
| 55 info.ders = ders; | |
| 56 for (const std::string& der : ders) { | |
| 57 info.pems.push_back(rtc::SSLIdentity::DerToPem( | |
| 58 "CERTIFICATE", | |
| 59 reinterpret_cast<const unsigned char*>(der.c_str()), | |
| 60 der.length())); | |
| 61 } | |
| 62 info.certificate = | |
| 63 rtc::RTCCertificate::Create(std::unique_ptr<rtc::FakeSSLIdentity>( | |
| 64 new rtc::FakeSSLIdentity(rtc::FakeSSLCertificate(info.pems)))); | |
| 65 // Strip header/footer and newline characters of PEM strings. | |
| 66 for (size_t i = 0; i < info.pems.size(); ++i) { | |
| 67 rtc::replace_substrs("-----BEGIN CERTIFICATE-----", 27, | |
| 68 "", 0, &info.pems[i]); | |
| 69 rtc::replace_substrs("-----END CERTIFICATE-----", 25, | |
| 70 "", 0, &info.pems[i]); | |
| 71 rtc::replace_substrs("\n", 1, | |
| 72 "", 0, &info.pems[i]); | |
| 73 } | |
| 74 // Fingerprint of leaf certificate. | |
| 75 std::unique_ptr<rtc::SSLFingerprint> fp( | |
| 76 rtc::SSLFingerprint::Create("sha-1", | |
| 77 &info.certificate->ssl_certificate())); | |
| 78 EXPECT_TRUE(fp); | |
| 79 info.fingerprints.push_back(fp->GetRfc4572Fingerprint()); | |
| 80 // Fingerprints of the rest of the chain. | |
| 81 std::unique_ptr<rtc::SSLCertChain> chain = | |
| 82 info.certificate->ssl_certificate().GetChain(); | |
| 83 if (chain) { | |
| 84 for (size_t i = 0; i < chain->GetSize(); i++) { | |
| 85 fp.reset(rtc::SSLFingerprint::Create("sha-1", &chain->Get(i))); | |
| 86 EXPECT_TRUE(fp); | |
| 87 info.fingerprints.push_back(fp->GetRfc4572Fingerprint()); | |
| 88 } | |
| 89 } | |
| 90 EXPECT_EQ(info.ders.size(), info.fingerprints.size()); | |
| 91 return info; | |
| 92 } | |
| 93 | |
| 41 class RTCStatsCollectorTestHelper : public SetSessionDescriptionObserver { | 94 class RTCStatsCollectorTestHelper : public SetSessionDescriptionObserver { |
| 42 public: | 95 public: |
| 43 RTCStatsCollectorTestHelper() | 96 RTCStatsCollectorTestHelper() |
| 44 : worker_thread_(rtc::Thread::Current()), | 97 : worker_thread_(rtc::Thread::Current()), |
| 45 network_thread_(rtc::Thread::Current()), | 98 network_thread_(rtc::Thread::Current()), |
| 46 channel_manager_(new cricket::ChannelManager( | 99 channel_manager_(new cricket::ChannelManager( |
| 47 new cricket::FakeMediaEngine(), | 100 new cricket::FakeMediaEngine(), |
| 48 worker_thread_, | 101 worker_thread_, |
| 49 network_thread_)), | 102 network_thread_)), |
| 50 media_controller_( | 103 media_controller_( |
| 51 MediaControllerInterface::Create(cricket::MediaConfig(), | 104 MediaControllerInterface::Create(cricket::MediaConfig(), |
| 52 worker_thread_, | 105 worker_thread_, |
| 53 channel_manager_.get())), | 106 channel_manager_.get())), |
| 54 session_(media_controller_.get()), | 107 session_(media_controller_.get()), |
| 55 pc_() { | 108 pc_() { |
| 56 EXPECT_CALL(pc_, session()).WillRepeatedly(Return(&session_)); | 109 EXPECT_CALL(pc_, session()).WillRepeatedly(Return(&session_)); |
|
hta-webrtc
2016/09/29 13:22:58
This number of calls installed with EXPECT_CALL in
hbos
2016/10/03 12:11:59
You're right. I changed it so that only the certif
| |
| 57 EXPECT_CALL(pc_, sctp_data_channels()).WillRepeatedly( | 110 EXPECT_CALL(pc_, sctp_data_channels()).WillRepeatedly( |
| 58 ReturnRef(data_channels_)); | 111 ReturnRef(data_channels_)); |
| 112 EXPECT_CALL(session_, GetTransportStats(_)).WillRepeatedly(Invoke( | |
| 113 [this](SessionStats* stats) { | |
| 114 return session_GetTransportStats(stats); | |
| 115 })); | |
| 116 EXPECT_CALL(session_, GetLocalCertificate(_, _)).WillRepeatedly(Invoke( | |
| 117 [this](const std::string& transport_name, | |
| 118 rtc::scoped_refptr<rtc::RTCCertificate>* certificate) { | |
| 119 return session_GetLocalCertificate(transport_name, certificate); | |
| 120 })); | |
| 121 EXPECT_CALL(session_, | |
| 122 GetRemoteSSLCertificate_ReturnsRawPointer(_)).WillRepeatedly(Invoke( | |
| 123 [this](const std::string& transport_name) { | |
| 124 return session_GetRemoteSSLCertificate(transport_name); | |
| 125 })); | |
| 59 } | 126 } |
| 60 | 127 |
| 61 rtc::ScopedFakeClock& fake_clock() { return fake_clock_; } | 128 rtc::ScopedFakeClock& fake_clock() { return fake_clock_; } |
| 62 MockWebRtcSession& session() { return session_; } | 129 MockWebRtcSession& session() { return session_; } |
| 63 MockPeerConnection& pc() { return pc_; } | 130 MockPeerConnection& pc() { return pc_; } |
| 64 std::vector<rtc::scoped_refptr<DataChannel>>& data_channels() { | 131 std::vector<rtc::scoped_refptr<DataChannel>>& data_channels() { |
| 65 return data_channels_; | 132 return data_channels_; |
| 66 } | 133 } |
| 67 | 134 |
| 135 // The transport names, local and remote certificate added by this method are | |
| 136 // the ones that will be returned through mocking of | |
| 137 // |session_.GetTransportStats|, |session_.GetLocalCertificate| and | |
| 138 // |session_.GetRemoteSSLCertificate|. | |
| 139 void AddTransportCertificatePair( | |
| 140 const std::string& transport_name, | |
| 141 const rtc::scoped_refptr<rtc::RTCCertificate>& local_certificate, | |
| 142 const rtc::scoped_refptr<rtc::RTCCertificate>& remote_certificate) { | |
| 143 transport_certificates_.insert( | |
| 144 std::pair<std::string, CertificatePair>( | |
| 145 transport_name, | |
| 146 CertificatePair(local_certificate, remote_certificate))); | |
| 147 } | |
| 148 | |
| 149 // |session_.GetTransportStats| is mocked to invoke this. | |
| 150 bool session_GetTransportStats(SessionStats* stats) { | |
|
hta-webrtc
2016/09/29 13:22:58
This is a butt-ugly name for a function. Can you p
hbos
2016/10/03 12:11:59
Functions removed.
| |
| 151 for (auto& kv : transport_certificates_) { | |
| 152 stats->transport_stats[kv.first].transport_name = kv.first; | |
| 153 } | |
| 154 return true; | |
| 155 } | |
| 156 // |session_.GetLocalCertificate| is mocked to invoke this. | |
| 157 bool session_GetLocalCertificate( | |
| 158 const std::string& transport_name, | |
| 159 rtc::scoped_refptr<rtc::RTCCertificate>* certificate) { | |
| 160 std::map<std::string, CertificatePair>::iterator it = | |
| 161 transport_certificates_.find(transport_name); | |
| 162 if (it == transport_certificates_.end()) | |
| 163 return false; | |
| 164 *certificate = it->second.first; | |
| 165 return true; | |
| 166 } | |
| 167 // |session_.GetRemoteSSLCertificate| is mocked to invoke this (using the | |
| 168 // |GetRemoteSSLCertificate_ReturnsRawPointer| workaround). | |
| 169 rtc::SSLCertificate* session_GetRemoteSSLCertificate( | |
| 170 const std::string& transport_name) { | |
| 171 std::map<std::string, CertificatePair>::iterator it = | |
| 172 transport_certificates_.find(transport_name); | |
| 173 if (it == transport_certificates_.end()) | |
| 174 return nullptr; | |
| 175 return it->second.second->ssl_certificate().GetReference(); | |
| 176 } | |
| 177 | |
| 68 // SetSessionDescriptionObserver overrides. | 178 // SetSessionDescriptionObserver overrides. |
| 69 void OnSuccess() override {} | 179 void OnSuccess() override {} |
| 70 void OnFailure(const std::string& error) override { | 180 void OnFailure(const std::string& error) override { |
| 71 RTC_NOTREACHED() << error; | 181 RTC_NOTREACHED() << error; |
| 72 } | 182 } |
| 73 | 183 |
| 74 private: | 184 private: |
| 185 typedef std::pair<rtc::scoped_refptr<rtc::RTCCertificate>, | |
| 186 rtc::scoped_refptr<rtc::RTCCertificate>> CertificatePair; | |
| 187 | |
| 75 rtc::ScopedFakeClock fake_clock_; | 188 rtc::ScopedFakeClock fake_clock_; |
| 76 rtc::Thread* const worker_thread_; | 189 rtc::Thread* const worker_thread_; |
| 77 rtc::Thread* const network_thread_; | 190 rtc::Thread* const network_thread_; |
| 78 std::unique_ptr<cricket::ChannelManager> channel_manager_; | 191 std::unique_ptr<cricket::ChannelManager> channel_manager_; |
| 79 std::unique_ptr<webrtc::MediaControllerInterface> media_controller_; | 192 std::unique_ptr<webrtc::MediaControllerInterface> media_controller_; |
| 80 MockWebRtcSession session_; | 193 MockWebRtcSession session_; |
| 81 MockPeerConnection pc_; | 194 MockPeerConnection pc_; |
| 82 | 195 |
| 83 std::vector<rtc::scoped_refptr<DataChannel>> data_channels_; | 196 std::vector<rtc::scoped_refptr<DataChannel>> data_channels_; |
| 197 // Transport name -> (local and remote certificate) map. | |
| 198 std::map<std::string, CertificatePair> transport_certificates_; | |
| 84 }; | 199 }; |
| 85 | 200 |
| 86 class RTCTestStats : public RTCStats { | 201 class RTCTestStats : public RTCStats { |
| 87 public: | 202 public: |
| 88 RTCTestStats(const std::string& id, int64_t timestamp_us) | 203 RTCTestStats(const std::string& id, int64_t timestamp_us) |
| 89 : RTCStats(id, timestamp_us), | 204 : RTCStats(id, timestamp_us), |
| 90 dummy_stat("dummyStat") {} | 205 dummy_stat("dummyStat") {} |
| 91 | 206 |
| 92 WEBRTC_RTCSTATS_IMPL(RTCStats, RTCTestStats, | 207 WEBRTC_RTCSTATS_IMPL(RTCStats, RTCTestStats, |
| 93 &dummy_stat); | 208 &dummy_stat); |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 246 &test_->pc(), 50 * rtc::kNumMicrosecsPerMillisec)) { | 361 &test_->pc(), 50 * rtc::kNumMicrosecsPerMillisec)) { |
| 247 } | 362 } |
| 248 | 363 |
| 249 rtc::scoped_refptr<const RTCStatsReport> GetStatsReport() { | 364 rtc::scoped_refptr<const RTCStatsReport> GetStatsReport() { |
| 250 rtc::scoped_refptr<StatsCallback> callback = StatsCallback::Create(); | 365 rtc::scoped_refptr<StatsCallback> callback = StatsCallback::Create(); |
| 251 collector_->GetStatsReport(callback); | 366 collector_->GetStatsReport(callback); |
| 252 EXPECT_TRUE_WAIT(callback->report(), kGetStatsReportTimeoutMs); | 367 EXPECT_TRUE_WAIT(callback->report(), kGetStatsReportTimeoutMs); |
| 253 return callback->report(); | 368 return callback->report(); |
| 254 } | 369 } |
| 255 | 370 |
| 371 void ExpectReportContainsCertificateInfo( | |
| 372 const rtc::scoped_refptr<const RTCStatsReport>& report, | |
| 373 const CertificateInfo& cert_info) { | |
| 374 for (size_t i = 0; i < cert_info.fingerprints.size(); ++i) { | |
| 375 const RTCStats* stats = report->Get( | |
| 376 "RTCCertificate_" + cert_info.fingerprints[i]); | |
| 377 EXPECT_TRUE(stats); | |
| 378 const RTCCertificateStats& cert_stats = | |
| 379 stats->cast_to<const RTCCertificateStats>(); | |
| 380 EXPECT_EQ(*cert_stats.fingerprint, cert_info.fingerprints[i]); | |
| 381 EXPECT_EQ(*cert_stats.fingerprint_algorithm, "sha-1"); | |
| 382 EXPECT_EQ(*cert_stats.base64_certificate, cert_info.pems[i]); | |
| 383 if (i + 1 < cert_info.fingerprints.size()) { | |
| 384 EXPECT_EQ(*cert_stats.issuer_certificate_id, | |
| 385 "RTCCertificate_" + cert_info.fingerprints[i + 1]); | |
| 386 } else { | |
| 387 EXPECT_FALSE(cert_stats.issuer_certificate_id.is_defined()); | |
| 388 } | |
| 389 } | |
| 390 } | |
| 391 | |
| 256 protected: | 392 protected: |
| 257 rtc::scoped_refptr<RTCStatsCollectorTestHelper> test_; | 393 rtc::scoped_refptr<RTCStatsCollectorTestHelper> test_; |
| 258 rtc::scoped_refptr<RTCStatsCollector> collector_; | 394 rtc::scoped_refptr<RTCStatsCollector> collector_; |
| 259 }; | 395 }; |
| 260 | 396 |
| 261 TEST_F(RTCStatsCollectorTest, SingleCallback) { | 397 TEST_F(RTCStatsCollectorTest, SingleCallback) { |
| 262 rtc::scoped_refptr<const RTCStatsReport> result; | 398 rtc::scoped_refptr<const RTCStatsReport> result; |
| 263 collector_->GetStatsReport(StatsCallback::Create(&result)); | 399 collector_->GetStatsReport(StatsCallback::Create(&result)); |
| 264 EXPECT_TRUE_WAIT(result, kGetStatsReportTimeoutMs); | 400 EXPECT_TRUE_WAIT(result, kGetStatsReportTimeoutMs); |
| 265 } | 401 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 305 collector_->GetStatsReport(StatsCallback::Create(&c)); | 441 collector_->GetStatsReport(StatsCallback::Create(&c)); |
| 306 EXPECT_TRUE_WAIT(a, kGetStatsReportTimeoutMs); | 442 EXPECT_TRUE_WAIT(a, kGetStatsReportTimeoutMs); |
| 307 EXPECT_TRUE_WAIT(b, kGetStatsReportTimeoutMs); | 443 EXPECT_TRUE_WAIT(b, kGetStatsReportTimeoutMs); |
| 308 EXPECT_TRUE_WAIT(c, kGetStatsReportTimeoutMs); | 444 EXPECT_TRUE_WAIT(c, kGetStatsReportTimeoutMs); |
| 309 EXPECT_EQ(a.get(), b.get()); | 445 EXPECT_EQ(a.get(), b.get()); |
| 310 // The act of doing |AdvanceTime| processes all messages. If this was not the | 446 // The act of doing |AdvanceTime| processes all messages. If this was not the |
| 311 // case we might not require |c| to be fresher than |b|. | 447 // case we might not require |c| to be fresher than |b|. |
| 312 EXPECT_NE(c.get(), b.get()); | 448 EXPECT_NE(c.get(), b.get()); |
| 313 } | 449 } |
| 314 | 450 |
| 451 TEST_F(RTCStatsCollectorTest, CollectRTCCertificateStatsSingle) { | |
| 452 CertificateInfo local; | |
| 453 local.ders.push_back("(local) single certificate"); | |
| 454 local = CreateFakeCertificateAndInfoFromDers(local.ders); | |
| 455 CertificateInfo remote; | |
| 456 remote.ders.push_back("(remote) single certificate"); | |
| 457 remote = CreateFakeCertificateAndInfoFromDers(remote.ders); | |
| 458 test_->AddTransportCertificatePair( | |
| 459 "transport", local.certificate, remote.certificate); | |
| 460 | |
| 461 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsReport(); | |
| 462 ExpectReportContainsCertificateInfo(report, local); | |
| 463 ExpectReportContainsCertificateInfo(report, remote); | |
| 464 } | |
| 465 | |
| 466 TEST_F(RTCStatsCollectorTest, CollectRTCCertificateStatsMultiple) { | |
| 467 CertificateInfo first_local; | |
| 468 first_local.ders.push_back("(local) first"); | |
| 469 first_local = CreateFakeCertificateAndInfoFromDers(first_local.ders); | |
| 470 CertificateInfo first_remote; | |
| 471 first_remote.ders.push_back("(remote) first"); | |
| 472 first_remote = CreateFakeCertificateAndInfoFromDers(first_remote.ders); | |
| 473 test_->AddTransportCertificatePair( | |
| 474 "audio", first_local.certificate, first_remote.certificate); | |
| 475 | |
| 476 CertificateInfo second_local; | |
| 477 second_local.ders.push_back("(local) second"); | |
| 478 second_local = CreateFakeCertificateAndInfoFromDers(second_local.ders); | |
| 479 CertificateInfo second_remote; | |
| 480 second_remote.ders.push_back("(remote) second"); | |
| 481 second_remote = CreateFakeCertificateAndInfoFromDers(second_remote.ders); | |
| 482 test_->AddTransportCertificatePair( | |
| 483 "video", second_local.certificate, second_remote.certificate); | |
| 484 | |
| 485 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsReport(); | |
| 486 ExpectReportContainsCertificateInfo(report, first_local); | |
| 487 ExpectReportContainsCertificateInfo(report, first_remote); | |
| 488 ExpectReportContainsCertificateInfo(report, second_local); | |
| 489 ExpectReportContainsCertificateInfo(report, second_remote); | |
| 490 } | |
| 491 | |
| 492 TEST_F(RTCStatsCollectorTest, CollectRTCCertificateStatsChain) { | |
| 493 CertificateInfo local; | |
| 494 local.ders.push_back("(local) this"); | |
| 495 local.ders.push_back("(local) is"); | |
| 496 local.ders.push_back("(local) a"); | |
| 497 local.ders.push_back("(local) chain"); | |
| 498 local = CreateFakeCertificateAndInfoFromDers(local.ders); | |
| 499 CertificateInfo remote; | |
| 500 remote.ders.push_back("(remote) this"); | |
| 501 remote.ders.push_back("(remote) is"); | |
| 502 remote.ders.push_back("(remote) another"); | |
| 503 remote.ders.push_back("(remote) chain"); | |
| 504 remote = CreateFakeCertificateAndInfoFromDers(remote.ders); | |
| 505 test_->AddTransportCertificatePair( | |
| 506 "transport", local.certificate, remote.certificate); | |
| 507 | |
| 508 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsReport(); | |
| 509 ExpectReportContainsCertificateInfo(report, local); | |
| 510 ExpectReportContainsCertificateInfo(report, remote); | |
| 511 } | |
| 512 | |
| 315 TEST_F(RTCStatsCollectorTest, CollectRTCPeerConnectionStats) { | 513 TEST_F(RTCStatsCollectorTest, CollectRTCPeerConnectionStats) { |
| 316 int64_t before = rtc::TimeUTCMicros(); | 514 int64_t before = rtc::TimeUTCMicros(); |
| 317 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsReport(); | 515 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsReport(); |
| 318 int64_t after = rtc::TimeUTCMicros(); | 516 int64_t after = rtc::TimeUTCMicros(); |
| 319 EXPECT_EQ(report->GetStatsOfType<RTCPeerConnectionStats>().size(), | 517 EXPECT_EQ(report->GetStatsOfType<RTCPeerConnectionStats>().size(), |
| 320 static_cast<size_t>(1)) << "Expecting 1 RTCPeerConnectionStats."; | 518 static_cast<size_t>(1)) << "Expecting 1 RTCPeerConnectionStats."; |
| 321 const RTCStats* stats = report->Get("RTCPeerConnection"); | 519 const RTCStats* stats = report->Get("RTCPeerConnection"); |
| 322 EXPECT_TRUE(stats); | 520 EXPECT_TRUE(stats); |
| 323 EXPECT_LE(before, stats->timestamp_us()); | 521 EXPECT_LE(before, stats->timestamp_us()); |
| 324 EXPECT_LE(stats->timestamp_us(), after); | 522 EXPECT_LE(stats->timestamp_us(), after); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 371 rtc::scoped_refptr<FakeRTCStatsCollector> collector_; | 569 rtc::scoped_refptr<FakeRTCStatsCollector> collector_; |
| 372 }; | 570 }; |
| 373 | 571 |
| 374 TEST_F(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) { | 572 TEST_F(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) { |
| 375 collector_->VerifyThreadUsageAndResultsMerging(); | 573 collector_->VerifyThreadUsageAndResultsMerging(); |
| 376 } | 574 } |
| 377 | 575 |
| 378 } // namespace | 576 } // namespace |
| 379 | 577 |
| 380 } // namespace webrtc | 578 } // namespace webrtc |
| OLD | NEW |