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

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 991 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 1002
1003 void VerifyBestConnectionAfterIceConverge( 1003 void VerifyBestConnectionAfterIceConverge(
1004 const rtc::scoped_refptr<FakeMetricsObserver> metrics_observer) const { 1004 const rtc::scoped_refptr<FakeMetricsObserver> metrics_observer) const {
1005 Verify(metrics_observer, best_connection_after_initial_ice_converged_); 1005 Verify(metrics_observer, best_connection_after_initial_ice_converged_);
1006 } 1006 }
1007 1007
1008 private: 1008 private:
1009 void Verify(const rtc::scoped_refptr<FakeMetricsObserver> metrics_observer, 1009 void Verify(const rtc::scoped_refptr<FakeMetricsObserver> metrics_observer,
1010 const ExpectedBestConnection& expected) const { 1010 const ExpectedBestConnection& expected) const {
1011 EXPECT_EQ( 1011 EXPECT_EQ(
1012 metrics_observer->GetCounter(webrtc::kBestConnections_IPv4), 1012 metrics_observer->GetEnumCounter(webrtc::kEnumCounterAddressFamily,
1013 webrtc::kBestConnections_IPv4),
1013 expected.ipv4_count_); 1014 expected.ipv4_count_);
1014 EXPECT_EQ( 1015 EXPECT_EQ(
1015 metrics_observer->GetCounter(webrtc::kBestConnections_IPv6), 1016 metrics_observer->GetEnumCounter(webrtc::kEnumCounterAddressFamily,
1017 webrtc::kBestConnections_IPv6),
1016 expected.ipv6_count_); 1018 expected.ipv6_count_);
1019 // This is used in the loopback call so there is only single host to host
1020 // candidate pair.
1021 EXPECT_EQ(metrics_observer->GetEnumCounter(
1022 webrtc::kEnumCounterIceCandidatePairTypeUdp,
1023 webrtc::kIceCandidatePairHostHost),
1024 1);
1017 } 1025 }
1018 }; 1026 };
1019 1027
1020 class LoopbackNetworkManager { 1028 class LoopbackNetworkManager {
1021 public: 1029 public:
1022 LoopbackNetworkManager(WebRtcSessionTest* session, 1030 LoopbackNetworkManager(WebRtcSessionTest* session,
1023 const LoopbackNetworkConfiguration& config) 1031 const LoopbackNetworkConfiguration& config)
1024 : config_(config) { 1032 : config_(config) {
1025 session->AddInterface( 1033 session->AddInterface(
1026 rtc::SocketAddress(kClientAddrHost1, kClientAddrPort)); 1034 rtc::SocketAddress(kClientAddrHost1, kClientAddrPort));
(...skipping 2917 matching lines...) Expand 10 before | Expand all | Expand 10 after
3944 // terminated. The offer creation may or may not have succeeded, but we 3952 // terminated. The offer creation may or may not have succeeded, but we
3945 // must have received a notification which, so the only invalid state 3953 // must have received a notification which, so the only invalid state
3946 // is kInit. 3954 // is kInit.
3947 EXPECT_NE(WebRtcSessionCreateSDPObserverForTest::kInit, o->state()); 3955 EXPECT_NE(WebRtcSessionCreateSDPObserverForTest::kInit, o->state());
3948 } 3956 }
3949 } 3957 }
3950 3958
3951 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test 3959 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test
3952 // currently fails because upon disconnection and reconnection OnIceComplete is 3960 // currently fails because upon disconnection and reconnection OnIceComplete is
3953 // called more than once without returning to IceGatheringGathering. 3961 // called more than once without returning to IceGatheringGathering.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698