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

Side by Side Diff: talk/app/webrtc/webrtcsession_unittest.cc

Issue 1277263002: Add instrumentation to track the IceEndpointType. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 4 months 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
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after
999 999
1000 void VerifyBestConnectionAfterIceConverge( 1000 void VerifyBestConnectionAfterIceConverge(
1001 const rtc::scoped_refptr<FakeMetricsObserver> metrics_observer) const { 1001 const rtc::scoped_refptr<FakeMetricsObserver> metrics_observer) const {
1002 Verify(metrics_observer, best_connection_after_initial_ice_converged_); 1002 Verify(metrics_observer, best_connection_after_initial_ice_converged_);
1003 } 1003 }
1004 1004
1005 private: 1005 private:
1006 void Verify(const rtc::scoped_refptr<FakeMetricsObserver> metrics_observer, 1006 void Verify(const rtc::scoped_refptr<FakeMetricsObserver> metrics_observer,
1007 const ExpectedBestConnection& expected) const { 1007 const ExpectedBestConnection& expected) const {
1008 EXPECT_EQ( 1008 EXPECT_EQ(
1009 metrics_observer->GetCounter(webrtc::kBestConnections_IPv4), 1009 metrics_observer->GetEnumCounter(webrtc::kEnumCounterAddressFamily,
1010 webrtc::kBestConnections_IPv4),
1010 expected.ipv4_count_); 1011 expected.ipv4_count_);
1011 EXPECT_EQ( 1012 EXPECT_EQ(
1012 metrics_observer->GetCounter(webrtc::kBestConnections_IPv6), 1013 metrics_observer->GetEnumCounter(webrtc::kEnumCounterAddressFamily,
1014 webrtc::kBestConnections_IPv6),
1013 expected.ipv6_count_); 1015 expected.ipv6_count_);
1016 // This is used in the loopback call so there is only single host to host
1017 // candidate pair.
1018 EXPECT_EQ(metrics_observer->GetEnumCounter(
1019 webrtc::kEnumCounterIceCandidatePairTypeUdp,
1020 webrtc::kIceCandidatePairHostHost),
1021 1);
1014 } 1022 }
1015 }; 1023 };
1016 1024
1017 class LoopbackNetworkManager { 1025 class LoopbackNetworkManager {
1018 public: 1026 public:
1019 LoopbackNetworkManager(WebRtcSessionTest* session, 1027 LoopbackNetworkManager(WebRtcSessionTest* session,
1020 const LoopbackNetworkConfiguration& config) 1028 const LoopbackNetworkConfiguration& config)
1021 : config_(config) { 1029 : config_(config) {
1022 session->AddInterface( 1030 session->AddInterface(
1023 rtc::SocketAddress(kClientAddrHost1, kClientAddrPort)); 1031 rtc::SocketAddress(kClientAddrHost1, kClientAddrPort));
(...skipping 2860 matching lines...) Expand 10 before | Expand all | Expand 10 after
3884 // terminated. The offer creation may or may not have succeeded, but we 3892 // terminated. The offer creation may or may not have succeeded, but we
3885 // must have received a notification which, so the only invalid state 3893 // must have received a notification which, so the only invalid state
3886 // is kInit. 3894 // is kInit.
3887 EXPECT_NE(WebRtcSessionCreateSDPObserverForTest::kInit, o->state()); 3895 EXPECT_NE(WebRtcSessionCreateSDPObserverForTest::kInit, o->state());
3888 } 3896 }
3889 } 3897 }
3890 3898
3891 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test 3899 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test
3892 // currently fails because upon disconnection and reconnection OnIceComplete is 3900 // currently fails because upon disconnection and reconnection OnIceComplete is
3893 // called more than once without returning to IceGatheringGathering. 3901 // called more than once without returning to IceGatheringGathering.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698