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

Unified Diff: webrtc/p2p/base/port_unittest.cc

Issue 1848083002: Change the size of the ICE ufrag to 4 bytes (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Modified the constants in unit tests based on new ICE_UFRAG_LENGTH. Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/p2p/base/p2ptransportchannel_unittest.cc ('k') | webrtc/p2p/base/portallocator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/port_unittest.cc
diff --git a/webrtc/p2p/base/port_unittest.cc b/webrtc/p2p/base/port_unittest.cc
index a5cbd92a7b31bbe72ca7f4348d01d018283d4157..43ef084b02e1aa49a970c9d9a10accce7a414236 100644
--- a/webrtc/p2p/base/port_unittest.cc
+++ b/webrtc/p2p/base/port_unittest.cc
@@ -76,6 +76,8 @@ static const int kTiebreaker2 = 22222;
static const char* data = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
+static const int kGturnUserNameLength = 16;
+
static Candidate GetCandidate(Port* port) {
assert(port->Candidates().size() >= 1);
return port->Candidates()[0];
@@ -525,9 +527,10 @@ class PortTest : public testing::Test, public sigslot::has_slots<> {
}
RelayPort* CreateGturnPort(const SocketAddress& addr) {
// TODO(pthatcher): Remove GTURN.
- return RelayPort::Create(main_, &socket_factory_, &network_,
- addr.ipaddr(), 0, 0,
- username_, password_);
+ // Generate a username with length of 16 for Gturn only.
+ std::string username = rtc::CreateRandomString(kGturnUserNameLength);
+ return RelayPort::Create(main_, &socket_factory_, &network_, addr.ipaddr(),
+ 0, 0, username, password_);
// TODO: Add an external address for ext_proto, so that the
// other side can connect to this port using a non-UDP protocol.
}
« no previous file with comments | « webrtc/p2p/base/p2ptransportchannel_unittest.cc ('k') | webrtc/p2p/base/portallocator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698