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

Side by Side Diff: talk/app/webrtc/peerconnection_unittest.cc

Issue 1570563002: Adding unit test to ensure TURN server priorities are unique. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | 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 * 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 2004 matching lines...) Expand 10 before | Expand all | Expand 10 after
2015 PeerConnectionInterface::IceServers servers; 2015 PeerConnectionInterface::IceServers servers;
2016 PeerConnectionInterface::IceServer server; 2016 PeerConnectionInterface::IceServer server;
2017 server.urls.push_back("stun:hostname"); 2017 server.urls.push_back("stun:hostname");
2018 server.urls.push_back("turn:hostname"); 2018 server.urls.push_back("turn:hostname");
2019 servers.push_back(server); 2019 servers.push_back(server);
2020 EXPECT_TRUE(webrtc::ParseIceServers(servers, &stun_servers_, &turn_servers_)); 2020 EXPECT_TRUE(webrtc::ParseIceServers(servers, &stun_servers_, &turn_servers_));
2021 EXPECT_EQ(1U, stun_servers_.size()); 2021 EXPECT_EQ(1U, stun_servers_.size());
2022 EXPECT_EQ(1U, turn_servers_.size()); 2022 EXPECT_EQ(1U, turn_servers_.size());
2023 } 2023 }
2024 2024
2025 // Ensure that TURN servers are given unique priorities,
2026 // so that their resulting candidates have unique priorities.
2027 TEST_F(IceServerParsingTest, TurnServerPrioritiesUnique) {
2028 PeerConnectionInterface::IceServers servers;
2029 PeerConnectionInterface::IceServer server;
2030 server.urls.push_back("turn:hostname");
2031 server.urls.push_back("turn:hostname2");
2032 servers.push_back(server);
2033 EXPECT_TRUE(webrtc::ParseIceServers(servers, &stun_servers_, &turn_servers_));
2034 EXPECT_EQ(2U, turn_servers_.size());
2035 EXPECT_NE(turn_servers_[0].priority, turn_servers_[1].priority);
2036 }
2037
2025 #endif // if !defined(THREAD_SANITIZER) 2038 #endif // if !defined(THREAD_SANITIZER)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698