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

Side by Side Diff: webrtc/base/network_unittest.cc

Issue 1284113003: Move the concept of multiple route into Network (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 Network ipv4_network2("test_eth1", "Test Network Adapter 2", 213 Network ipv4_network2("test_eth1", "Test Network Adapter 2",
214 IPAddress(0x00010000U), 16); 214 IPAddress(0x00010000U), 16);
215 ipv4_network1.AddIP(IPAddress(0x12345678)); 215 ipv4_network1.AddIP(IPAddress(0x12345678));
216 ipv4_network2.AddIP(IPAddress(0x00010004)); 216 ipv4_network2.AddIP(IPAddress(0x00010004));
217 BasicNetworkManager manager; 217 BasicNetworkManager manager;
218 218
219 // Add ipv4_network1 to the list of networks. 219 // Add ipv4_network1 to the list of networks.
220 NetworkManager::NetworkList list; 220 NetworkManager::NetworkList list;
221 list.push_back(new Network(ipv4_network1)); 221 list.push_back(new Network(ipv4_network1));
222 bool changed; 222 bool changed;
223 EXPECT_EQ(manager.network_permission_state(), NetworkManager::STATE_UNKNOWN);
juberti1 2015/08/14 23:25:55 I think this should go into TestUpdateNetworks (wh
223 NetworkManager::Stats stats = MergeNetworkList(manager, list, &changed); 224 NetworkManager::Stats stats = MergeNetworkList(manager, list, &changed);
225 EXPECT_EQ(manager.network_permission_state(), NetworkManager::STATE_ALLOWED);
224 EXPECT_TRUE(changed); 226 EXPECT_TRUE(changed);
225 EXPECT_EQ(stats.ipv6_network_count, 0); 227 EXPECT_EQ(stats.ipv6_network_count, 0);
226 EXPECT_EQ(stats.ipv4_network_count, 1); 228 EXPECT_EQ(stats.ipv4_network_count, 1);
227 list.clear(); 229 list.clear();
228 230
229 manager.GetNetworks(&list); 231 manager.GetNetworks(&list);
230 EXPECT_EQ(1U, list.size()); 232 EXPECT_EQ(1U, list.size());
231 EXPECT_EQ(ipv4_network1.ToString(), list[0]->ToString()); 233 EXPECT_EQ(ipv4_network1.ToString(), list[0]->ToString());
232 Network* net1 = list[0]; 234 Network* net1 = list[0];
233 list.clear(); 235 list.clear();
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 EXPECT_EQ(ipv6_network.GetBestIP(), static_cast<IPAddress>(ip)); 775 EXPECT_EQ(ipv6_network.GetBestIP(), static_cast<IPAddress>(ip));
774 776
775 // Add global dynamic temporary one. 777 // Add global dynamic temporary one.
776 ipstr = "2401:fa00:4:1000:be30:5bff:fee5:c6"; 778 ipstr = "2401:fa00:4:1000:be30:5bff:fee5:c6";
777 ASSERT_TRUE(IPFromString(ipstr, IPV6_ADDRESS_FLAG_TEMPORARY, &ip)); 779 ASSERT_TRUE(IPFromString(ipstr, IPV6_ADDRESS_FLAG_TEMPORARY, &ip));
778 ipv6_network.AddIP(ip); 780 ipv6_network.AddIP(ip);
779 EXPECT_EQ(ipv6_network.GetBestIP(), static_cast<IPAddress>(ip)); 781 EXPECT_EQ(ipv6_network.GetBestIP(), static_cast<IPAddress>(ip));
780 } 782 }
781 783
782 } // namespace rtc 784 } // namespace rtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698