OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |