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

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

Issue 2989303002: Make Port (and subclasses) fully "Network"-based, instead of IP-based. (Closed)
Patch Set: Add back Port constructor that takes IP for backwards compatibility. Created 3 years, 4 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/stunport.cc ('k') | webrtc/p2p/base/tcpport.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/stunport_unittest.cc
diff --git a/webrtc/p2p/base/stunport_unittest.cc b/webrtc/p2p/base/stunport_unittest.cc
index 25f5a74fcfede722d6085e034600b33127cfcd61..e994f67832e6f4acf13c5e855f43fb35298afef4 100644
--- a/webrtc/p2p/base/stunport_unittest.cc
+++ b/webrtc/p2p/base/stunport_unittest.cc
@@ -43,7 +43,7 @@ class StunPortTestBase : public testing::Test, public sigslot::has_slots<> {
StunPortTestBase()
: ss_(new rtc::VirtualSocketServer()),
thread_(ss_.get()),
- network_("unittest", "unittest", rtc::IPAddress(INADDR_ANY), 32),
+ network_("unittest", "unittest", kLocalAddr.ipaddr(), 32),
socket_factory_(rtc::Thread::Current()),
stun_server_1_(cricket::TestStunServer::Create(rtc::Thread::Current(),
kStunAddr1)),
@@ -52,7 +52,9 @@ class StunPortTestBase : public testing::Test, public sigslot::has_slots<> {
done_(false),
error_(false),
stun_keepalive_delay_(1),
- stun_keepalive_lifetime_(-1) {}
+ stun_keepalive_lifetime_(-1) {
+ network_.AddIP(kLocalAddr.ipaddr());
+ }
cricket::UDPPort* port() const { return stun_port_.get(); }
bool done() const { return done_; }
@@ -70,9 +72,9 @@ class StunPortTestBase : public testing::Test, public sigslot::has_slots<> {
void CreateStunPort(const ServerAddresses& stun_servers) {
stun_port_.reset(cricket::StunPort::Create(
- rtc::Thread::Current(), &socket_factory_, &network_,
- kLocalAddr.ipaddr(), 0, 0, rtc::CreateRandomString(16),
- rtc::CreateRandomString(22), stun_servers, std::string()));
+ rtc::Thread::Current(), &socket_factory_, &network_, 0, 0,
+ rtc::CreateRandomString(16), rtc::CreateRandomString(22), stun_servers,
+ std::string()));
stun_port_->set_stun_keepalive_delay(stun_keepalive_delay_);
// If |stun_keepalive_lifetime_| is negative, let the stun port
// choose its lifetime from the network type.
« no previous file with comments | « webrtc/p2p/base/stunport.cc ('k') | webrtc/p2p/base/tcpport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698