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

Side by Side Diff: webrtc/p2p/base/stunport_unittest.cc

Issue 1362503003: Use suffixed {uint,int}{8,16,32,64}_t types. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase + revert basictypes.h (to be landed separately just in case of a revert due to unexpected us… Created 5 years, 2 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/base/stunport.cc ('k') | webrtc/p2p/base/stunrequest.h » ('j') | 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 2009 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2009 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 12 matching lines...) Expand all
23 using rtc::SocketAddress; 23 using rtc::SocketAddress;
24 24
25 static const SocketAddress kLocalAddr("127.0.0.1", 0); 25 static const SocketAddress kLocalAddr("127.0.0.1", 0);
26 static const SocketAddress kStunAddr1("127.0.0.1", 5000); 26 static const SocketAddress kStunAddr1("127.0.0.1", 5000);
27 static const SocketAddress kStunAddr2("127.0.0.1", 4000); 27 static const SocketAddress kStunAddr2("127.0.0.1", 4000);
28 static const SocketAddress kBadAddr("0.0.0.1", 5000); 28 static const SocketAddress kBadAddr("0.0.0.1", 5000);
29 static const SocketAddress kStunHostnameAddr("localhost", 5000); 29 static const SocketAddress kStunHostnameAddr("localhost", 5000);
30 static const SocketAddress kBadHostnameAddr("not-a-real-hostname", 5000); 30 static const SocketAddress kBadHostnameAddr("not-a-real-hostname", 5000);
31 static const int kTimeoutMs = 10000; 31 static const int kTimeoutMs = 10000;
32 // stun prio = 100 << 24 | 30 (IPV4) << 8 | 256 - 0 32 // stun prio = 100 << 24 | 30 (IPV4) << 8 | 256 - 0
33 static const uint32 kStunCandidatePriority = 1677729535; 33 static const uint32_t kStunCandidatePriority = 1677729535;
34 34
35 // Tests connecting a StunPort to a fake STUN server (cricket::StunServer) 35 // Tests connecting a StunPort to a fake STUN server (cricket::StunServer)
36 // TODO: Use a VirtualSocketServer here. We have to use a 36 // TODO: Use a VirtualSocketServer here. We have to use a
37 // PhysicalSocketServer right now since DNS is not part of SocketServer yet. 37 // PhysicalSocketServer right now since DNS is not part of SocketServer yet.
38 class StunPortTest : public testing::Test, 38 class StunPortTest : public testing::Test,
39 public sigslot::has_slots<> { 39 public sigslot::has_slots<> {
40 public: 40 public:
41 StunPortTest() 41 StunPortTest()
42 : pss_(new rtc::PhysicalSocketServer), 42 : pss_(new rtc::PhysicalSocketServer),
43 ss_(new rtc::VirtualSocketServer(pss_.get())), 43 ss_(new rtc::VirtualSocketServer(pss_.get())),
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 stun_servers.insert(kStunAddr1); 278 stun_servers.insert(kStunAddr1);
279 stun_servers.insert(kStunAddr2); 279 stun_servers.insert(kStunAddr2);
280 CreateStunPort(stun_servers); 280 CreateStunPort(stun_servers);
281 EXPECT_EQ("stun", port()->Type()); 281 EXPECT_EQ("stun", port()->Type());
282 PrepareAddress(); 282 PrepareAddress();
283 EXPECT_TRUE_WAIT(done(), kTimeoutMs); 283 EXPECT_TRUE_WAIT(done(), kTimeoutMs);
284 EXPECT_EQ(2U, port()->Candidates().size()); 284 EXPECT_EQ(2U, port()->Candidates().size());
285 EXPECT_EQ(port()->Candidates()[0].relay_protocol(), ""); 285 EXPECT_EQ(port()->Candidates()[0].relay_protocol(), "");
286 EXPECT_EQ(port()->Candidates()[1].relay_protocol(), ""); 286 EXPECT_EQ(port()->Candidates()[1].relay_protocol(), "");
287 } 287 }
OLDNEW
« no previous file with comments | « webrtc/p2p/base/stunport.cc ('k') | webrtc/p2p/base/stunrequest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698