Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Side by Side Diff: webrtc/api/rtcstatscollector_unittest.cc

Issue 2445343003: PrintTo functions for RTCStats added in rtcstatscollector_unittest.cc (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <ostream>
14 #include <string> 15 #include <string>
15 #include <vector> 16 #include <vector>
16 17
17 #include "webrtc/api/jsepsessiondescription.h" 18 #include "webrtc/api/jsepsessiondescription.h"
18 #include "webrtc/api/stats/rtcstats_objects.h" 19 #include "webrtc/api/stats/rtcstats_objects.h"
19 #include "webrtc/api/stats/rtcstatsreport.h" 20 #include "webrtc/api/stats/rtcstatsreport.h"
20 #include "webrtc/api/test/mock_datachannel.h" 21 #include "webrtc/api/test/mock_datachannel.h"
21 #include "webrtc/api/test/mock_peerconnection.h" 22 #include "webrtc/api/test/mock_peerconnection.h"
22 #include "webrtc/api/test/mock_webrtcsession.h" 23 #include "webrtc/api/test/mock_webrtcsession.h"
23 #include "webrtc/base/checks.h" 24 #include "webrtc/base/checks.h"
(...skipping 10 matching lines...) Expand all
34 #include "webrtc/p2p/base/p2pconstants.h" 35 #include "webrtc/p2p/base/p2pconstants.h"
35 #include "webrtc/p2p/base/port.h" 36 #include "webrtc/p2p/base/port.h"
36 37
37 using testing::_; 38 using testing::_;
38 using testing::Invoke; 39 using testing::Invoke;
39 using testing::Return; 40 using testing::Return;
40 using testing::ReturnRef; 41 using testing::ReturnRef;
41 42
42 namespace webrtc { 43 namespace webrtc {
43 44
45 // These are used by gtest code, such as if |EXPECT_EQ| fails.
46 void PrintTo(const RTCCertificateStats& stats, ::std::ostream* os) {
47 *os << stats.ToString();
48 }
49
50 void PrintTo(const RTCDataChannelStats& stats, ::std::ostream* os) {
51 *os << stats.ToString();
52 }
53
54 void PrintTo(const RTCIceCandidatePairStats& stats, ::std::ostream* os) {
55 *os << stats.ToString();
56 }
57
58 void PrintTo(const RTCLocalIceCandidateStats& stats, ::std::ostream* os) {
59 *os << stats.ToString();
60 }
61
62 void PrintTo(const RTCRemoteIceCandidateStats& stats, ::std::ostream* os) {
63 *os << stats.ToString();
64 }
65
66 void PrintTo(const RTCPeerConnectionStats& stats, ::std::ostream* os) {
67 *os << stats.ToString();
68 }
69
70 void PrintTo(const RTCTransportStats& stats, ::std::ostream* os) {
71 *os << stats.ToString();
72 }
73
44 namespace { 74 namespace {
45 75
46 const int64_t kGetStatsReportTimeoutMs = 1000; 76 const int64_t kGetStatsReportTimeoutMs = 1000;
47 77
48 struct CertificateInfo { 78 struct CertificateInfo {
49 rtc::scoped_refptr<rtc::RTCCertificate> certificate; 79 rtc::scoped_refptr<rtc::RTCCertificate> certificate;
50 std::vector<std::string> ders; 80 std::vector<std::string> ders;
51 std::vector<std::string> pems; 81 std::vector<std::string> pems;
52 std::vector<std::string> fingerprints; 82 std::vector<std::string> fingerprints;
53 }; 83 };
(...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after
1042 rtc::scoped_refptr<FakeRTCStatsCollector> collector_; 1072 rtc::scoped_refptr<FakeRTCStatsCollector> collector_;
1043 }; 1073 };
1044 1074
1045 TEST_F(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) { 1075 TEST_F(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) {
1046 collector_->VerifyThreadUsageAndResultsMerging(); 1076 collector_->VerifyThreadUsageAndResultsMerging();
1047 } 1077 }
1048 1078
1049 } // namespace 1079 } // namespace
1050 1080
1051 } // namespace webrtc 1081 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698