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

Side by Side Diff: webrtc/p2p/stunprober/stunprober_unittest.cc

Issue 1166013002: Better determination of Symmetric NAT (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « webrtc/p2p/stunprober/stunprober.cc ('k') | 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 2015 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2015 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 161
162 StartProbing(resolver.release(), socket_factory.release(), addr, 162 StartProbing(resolver.release(), socket_factory.release(), addr,
163 shared_mode, 3, pings_per_ip); 163 shared_mode, 3, pings_per_ip);
164 164
165 WAIT(stopped_, 1000); 165 WAIT(stopped_, 1000);
166 166
167 StunProber::Stats stats; 167 StunProber::Stats stats;
168 EXPECT_EQ(ss_->num_socket(), total_sockets); 168 EXPECT_EQ(ss_->num_socket(), total_sockets);
169 EXPECT_TRUE(prober->GetStats(&stats)); 169 EXPECT_TRUE(prober->GetStats(&stats));
170 EXPECT_EQ(stats.success_percent, 100); 170 EXPECT_EQ(stats.success_percent, 100);
171 EXPECT_TRUE(stats.behind_nat); 171 EXPECT_TRUE(stats.nat_type > stunprober::NATTYPE_NONE);
172 EXPECT_EQ(stats.host_ip, kLocalAddr.ipaddr().ToString()); 172 EXPECT_EQ(stats.host_ip, kLocalAddr.ipaddr().ToString());
173 EXPECT_EQ(stats.srflx_addrs, srflx_addresses); 173 EXPECT_EQ(stats.srflx_addrs, srflx_addresses);
174 EXPECT_EQ(static_cast<uint32>(stats.num_request_sent), 174 EXPECT_EQ(static_cast<uint32>(stats.num_request_sent),
175 total_pings_reported); 175 total_pings_reported);
176 EXPECT_EQ(static_cast<uint32>(stats.num_response_received), 176 EXPECT_EQ(static_cast<uint32>(stats.num_response_received),
177 total_pings_reported); 177 total_pings_reported);
178 } 178 }
179 179
180 private: 180 private:
181 void StopCallback(int result) { 181 void StopCallback(int result) {
(...skipping 27 matching lines...) Expand all
209 209
210 TEST_F(StunProberTest, NonSharedMode) { 210 TEST_F(StunProberTest, NonSharedMode) {
211 RunProber(false); 211 RunProber(false);
212 } 212 }
213 213
214 TEST_F(StunProberTest, SharedMode) { 214 TEST_F(StunProberTest, SharedMode) {
215 RunProber(true); 215 RunProber(true);
216 } 216 }
217 217
218 } // namespace stunprober 218 } // namespace stunprober
OLDNEW
« no previous file with comments | « webrtc/p2p/stunprober/stunprober.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698