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

Side by Side Diff: content/renderer/p2p/ipc_network_manager_unittest.cc

Issue 1873783003: Convert //content/renderer from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « content/renderer/p2p/ipc_network_manager.cc ('k') | content/renderer/p2p/ipc_socket_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/memory/scoped_ptr.h"
6 #include "content/renderer/p2p/ipc_network_manager.h" 5 #include "content/renderer/p2p/ipc_network_manager.h"
6
7 #include <memory>
8
7 #include "content/renderer/p2p/network_list_manager.h" 9 #include "content/renderer/p2p/network_list_manager.h"
8 #include "net/base/ip_address.h" 10 #include "net/base/ip_address.h"
9 #include "net/base/network_change_notifier.h" 11 #include "net/base/network_change_notifier.h"
10 #include "net/base/network_interfaces.h" 12 #include "net/base/network_interfaces.h"
11 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
12 14
13 namespace content { 15 namespace content {
14 16
15 namespace { 17 namespace {
16 18
(...skipping 17 matching lines...) Expand all
34 "2401:fa00:4:1000:be30:5b30:50e5:c4"; 36 "2401:fa00:4:1000:be30:5b30:50e5:c4";
35 static const char kIPv4MappedAddrString[] = "::ffff:38.32.0.0"; 37 static const char kIPv4MappedAddrString[] = "::ffff:38.32.0.0";
36 38
37 class IpcNetworkManagerTest : public testing::Test { 39 class IpcNetworkManagerTest : public testing::Test {
38 public: 40 public:
39 IpcNetworkManagerTest() 41 IpcNetworkManagerTest()
40 : network_list_manager_(new MockP2PSocketDispatcher()), 42 : network_list_manager_(new MockP2PSocketDispatcher()),
41 network_manager_(new IpcNetworkManager(network_list_manager_.get())) {} 43 network_manager_(new IpcNetworkManager(network_list_manager_.get())) {}
42 44
43 protected: 45 protected:
44 scoped_ptr<MockP2PSocketDispatcher> network_list_manager_; 46 std::unique_ptr<MockP2PSocketDispatcher> network_list_manager_;
45 scoped_ptr<IpcNetworkManager> network_manager_; 47 std::unique_ptr<IpcNetworkManager> network_manager_;
46 }; 48 };
47 49
48 // Test overall logic of IpcNetworkManager on OnNetworkListChanged 50 // Test overall logic of IpcNetworkManager on OnNetworkListChanged
49 // that it should group addresses with the same network key under 51 // that it should group addresses with the same network key under
50 // single Network class. This also tests the logic inside 52 // single Network class. This also tests the logic inside
51 // IpcNetworkManager in addition to MergeNetworkList. 53 // IpcNetworkManager in addition to MergeNetworkList.
52 // TODO(guoweis): disable this test case for now until fix for webrtc 54 // TODO(guoweis): disable this test case for now until fix for webrtc
53 // issue 19249005 integrated into chromium 55 // issue 19249005 integrated into chromium
54 TEST_F(IpcNetworkManagerTest, TestMergeNetworkList) { 56 TEST_F(IpcNetworkManagerTest, TestMergeNetworkList) {
55 net::NetworkInterfaceList list; 57 net::NetworkInterfaceList list;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 EXPECT_TRUE(rtc::IPFromString(kIPv6PublicAddrString2, &ip_address)); 102 EXPECT_TRUE(rtc::IPFromString(kIPv6PublicAddrString2, &ip_address));
101 EXPECT_EQ(networks[1]->GetIPs()[1], ip_address); 103 EXPECT_EQ(networks[1]->GetIPs()[1], ip_address);
102 // Verify the network with prefix length of 48 has 2 IP addresses. 104 // Verify the network with prefix length of 48 has 2 IP addresses.
103 EXPECT_EQ(48, networks[0]->prefix_length()); 105 EXPECT_EQ(48, networks[0]->prefix_length());
104 EXPECT_EQ(1uL, networks[0]->GetIPs().size()); 106 EXPECT_EQ(1uL, networks[0]->GetIPs().size());
105 EXPECT_TRUE(rtc::IPFromString(kIPv6PublicAddrString2, &ip_address)); 107 EXPECT_TRUE(rtc::IPFromString(kIPv6PublicAddrString2, &ip_address));
106 EXPECT_EQ(networks[0]->GetIPs()[0], ip_address); 108 EXPECT_EQ(networks[0]->GetIPs()[0], ip_address);
107 } 109 }
108 110
109 } // namespace content 111 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/p2p/ipc_network_manager.cc ('k') | content/renderer/p2p/ipc_socket_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698