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

Side by Side Diff: webrtc/api/peerconnection_unittest.cc

Issue 2568833002: Refactor "secure bool" into explicit PROTO_TLS. (Closed)
Patch Set: GetRelayPreference(): Add RTC_DCHECK(proto == PROTO_UDP). Created 4 years 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/api/peerconnection.cc ('k') | webrtc/api/peerconnectionfactory_unittest.cc » ('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 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 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 2630 matching lines...) Expand 10 before | Expand all | Expand 10 after
2641 stun_servers_.clear(); 2641 stun_servers_.clear();
2642 2642
2643 EXPECT_TRUE(ParseUrl("stuns:hostname")); 2643 EXPECT_TRUE(ParseUrl("stuns:hostname"));
2644 EXPECT_EQ(1U, stun_servers_.size()); 2644 EXPECT_EQ(1U, stun_servers_.size());
2645 EXPECT_EQ(0U, turn_servers_.size()); 2645 EXPECT_EQ(0U, turn_servers_.size());
2646 stun_servers_.clear(); 2646 stun_servers_.clear();
2647 2647
2648 EXPECT_TRUE(ParseUrl("turn:hostname")); 2648 EXPECT_TRUE(ParseUrl("turn:hostname"));
2649 EXPECT_EQ(0U, stun_servers_.size()); 2649 EXPECT_EQ(0U, stun_servers_.size());
2650 EXPECT_EQ(1U, turn_servers_.size()); 2650 EXPECT_EQ(1U, turn_servers_.size());
2651 EXPECT_FALSE(turn_servers_[0].ports[0].secure); 2651 EXPECT_EQ(cricket::PROTO_UDP, turn_servers_[0].ports[0].proto);
2652 turn_servers_.clear(); 2652 turn_servers_.clear();
2653 2653
2654 EXPECT_TRUE(ParseUrl("turns:hostname")); 2654 EXPECT_TRUE(ParseUrl("turns:hostname"));
2655 EXPECT_EQ(0U, stun_servers_.size()); 2655 EXPECT_EQ(0U, stun_servers_.size());
2656 EXPECT_EQ(1U, turn_servers_.size()); 2656 EXPECT_EQ(1U, turn_servers_.size());
2657 EXPECT_TRUE(turn_servers_[0].ports[0].secure); 2657 EXPECT_EQ(cricket::PROTO_TLS, turn_servers_[0].ports[0].proto);
2658 turn_servers_.clear(); 2658 turn_servers_.clear();
2659 2659
2660 // invalid prefixes 2660 // invalid prefixes
2661 EXPECT_FALSE(ParseUrl("stunn:hostname")); 2661 EXPECT_FALSE(ParseUrl("stunn:hostname"));
2662 EXPECT_FALSE(ParseUrl(":hostname")); 2662 EXPECT_FALSE(ParseUrl(":hostname"));
2663 EXPECT_FALSE(ParseUrl(":")); 2663 EXPECT_FALSE(ParseUrl(":"));
2664 EXPECT_FALSE(ParseUrl("")); 2664 EXPECT_FALSE(ParseUrl(""));
2665 } 2665 }
2666 2666
2667 TEST_F(IceServerParsingTest, VerifyDefaults) { 2667 TEST_F(IceServerParsingTest, VerifyDefaults) {
2668 // TURNS defaults 2668 // TURNS defaults
2669 EXPECT_TRUE(ParseUrl("turns:hostname")); 2669 EXPECT_TRUE(ParseUrl("turns:hostname"));
2670 EXPECT_EQ(1U, turn_servers_.size()); 2670 EXPECT_EQ(1U, turn_servers_.size());
2671 EXPECT_EQ(5349, turn_servers_[0].ports[0].address.port()); 2671 EXPECT_EQ(5349, turn_servers_[0].ports[0].address.port());
2672 EXPECT_EQ(cricket::PROTO_TCP, turn_servers_[0].ports[0].proto); 2672 EXPECT_EQ(cricket::PROTO_TLS, turn_servers_[0].ports[0].proto);
2673 turn_servers_.clear(); 2673 turn_servers_.clear();
2674 2674
2675 // TURN defaults 2675 // TURN defaults
2676 EXPECT_TRUE(ParseUrl("turn:hostname")); 2676 EXPECT_TRUE(ParseUrl("turn:hostname"));
2677 EXPECT_EQ(1U, turn_servers_.size()); 2677 EXPECT_EQ(1U, turn_servers_.size());
2678 EXPECT_EQ(3478, turn_servers_[0].ports[0].address.port()); 2678 EXPECT_EQ(3478, turn_servers_[0].ports[0].address.port());
2679 EXPECT_EQ(cricket::PROTO_UDP, turn_servers_[0].ports[0].proto); 2679 EXPECT_EQ(cricket::PROTO_UDP, turn_servers_[0].ports[0].proto);
2680 turn_servers_.clear(); 2680 turn_servers_.clear();
2681 2681
2682 // STUN defaults 2682 // STUN defaults
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
2797 server.urls.push_back("turn:hostname2"); 2797 server.urls.push_back("turn:hostname2");
2798 servers.push_back(server); 2798 servers.push_back(server);
2799 EXPECT_TRUE(webrtc::ParseIceServers(servers, &stun_servers_, &turn_servers_)); 2799 EXPECT_TRUE(webrtc::ParseIceServers(servers, &stun_servers_, &turn_servers_));
2800 EXPECT_EQ(2U, turn_servers_.size()); 2800 EXPECT_EQ(2U, turn_servers_.size());
2801 EXPECT_NE(turn_servers_[0].priority, turn_servers_[1].priority); 2801 EXPECT_NE(turn_servers_[0].priority, turn_servers_[1].priority);
2802 } 2802 }
2803 2803
2804 #endif // if !defined(THREAD_SANITIZER) 2804 #endif // if !defined(THREAD_SANITIZER)
2805 2805
2806 } // namespace 2806 } // namespace
OLDNEW
« no previous file with comments | « webrtc/api/peerconnection.cc ('k') | webrtc/api/peerconnectionfactory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698