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

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

Issue 1218293016: Tighten link-local IPv6 routing exclusion check (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 5 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/port.cc ('k') | no next file » | 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 fb7fc17709539679b73d7945b7438564fd961973..84133af238ef1c80c0a79862bb2bf972983378ea 100644
--- a/webrtc/p2p/base/port_unittest.cc
+++ b/webrtc/p2p/base/port_unittest.cc
@@ -1394,6 +1394,34 @@ TEST_F(PortTest, TestSkipCrossFamilyUdp) {
TestCrossFamilyPorts(SOCK_DGRAM);
}
+TEST_F(PortTest, TestUdpV6CrossTypePorts) {
+ FakePacketSocketFactory factory;
+ scoped_ptr<Port> ports[3];
+ SocketAddress addresses[3] = {SocketAddress("2001:db8::1", 0),
+ SocketAddress("fe80::1", 0),
+ SocketAddress("::1", 0)};
+ for (int i = 0; i < 3; i++) {
+ FakeAsyncPacketSocket *socket = new FakeAsyncPacketSocket();
+ factory.set_next_udp_socket(socket);
+ ports[i].reset(CreateUdpPort(addresses[i], &factory));
+ socket->set_state(AsyncPacketSocket::STATE_BINDING);
+ socket->SignalAddressReady(socket, addresses[i]);
+ ports[i]->PrepareAddress();
+ }
+
+ // Standard address connecting to link-local should fail.
+ Connection* c = ports[0]->CreateConnection(GetCandidate(ports[1].get()),
+ Port::ORIGIN_MESSAGE);
+ EXPECT_TRUE(NULL == c);
+ EXPECT_EQ(0U, ports[0]->connections().size());
pthatcher1 2015/07/07 18:11:16 Should we also need a test cases for other combina
bemasc2 2015/07/07 19:26:00 Done.
+
+ // Standard address connecting to localhost should succeed.
+ c = ports[0]->CreateConnection(GetCandidate(ports[2].get()),
+ Port::ORIGIN_MESSAGE);
+ EXPECT_FALSE(NULL == c);
+ EXPECT_EQ(1U, ports[0]->connections().size());
+}
+
// This test verifies DSCP value set through SetOption interface can be
// get through DefaultDscpValue.
TEST_F(PortTest, TestDefaultDscpValue) {
« no previous file with comments | « webrtc/p2p/base/port.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698