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

Side by Side Diff: chrome/browser/extensions/api/dial/dial_service_unittest.cc

Issue 231973003: Adding network interface type param to net::NetworkInterface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/local_discovery/privet_traffic_detector.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ref_counted.h" 5 #include "base/memory/ref_counted.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "chrome/browser/extensions/api/dial/dial_device_data.h" 8 #include "chrome/browser/extensions/api/dial/dial_device_data.h"
9 #include "chrome/browser/extensions/api/dial/dial_service.h" 9 #include "chrome/browser/extensions/api/dial/dial_service.h"
10 #include "net/base/capturing_net_log.h" 10 #include "net/base/capturing_net_log.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 TEST_F(DialServiceTest, TestMultipleNetworkInterfaces) { 76 TEST_F(DialServiceTest, TestMultipleNetworkInterfaces) {
77 base::MessageLoopForIO loop; 77 base::MessageLoopForIO loop;
78 // Setting the finish delay to zero disables the timer that invokes 78 // Setting the finish delay to zero disables the timer that invokes
79 // FinishDiscovery(). 79 // FinishDiscovery().
80 dial_service_.finish_delay_ = TimeDelta::FromSeconds(0); 80 dial_service_.finish_delay_ = TimeDelta::FromSeconds(0);
81 dial_service_.request_interval_ = TimeDelta::FromSeconds(0); 81 dial_service_.request_interval_ = TimeDelta::FromSeconds(0);
82 dial_service_.max_requests_ = 4; 82 dial_service_.max_requests_ = 4;
83 dial_service_.discovery_active_ = true; 83 dial_service_.discovery_active_ = true;
84 net::NetworkInterfaceList interface_list; 84 net::NetworkInterfaceList interface_list;
85 interface_list.push_back( 85 interface_list.push_back(
86 net::NetworkInterface("network1", "network1", 0, mock_ip_, 0)); 86 net::NetworkInterface("network1", "network1", 0,
87 net::NETWORK_INTERFACE_UNKNOWN, mock_ip_, 0));
87 interface_list.push_back( 88 interface_list.push_back(
88 net::NetworkInterface("network2", "network2", 1, mock_ip_, 0)); 89 net::NetworkInterface("network2", "network2", 1,
90 net::NETWORK_INTERFACE_UNKNOWN, mock_ip_, 0));
89 interface_list.push_back( 91 interface_list.push_back(
90 net::NetworkInterface("network3", "network3", 2, mock_ip_, 0)); 92 net::NetworkInterface("network3", "network3", 2,
93 net::NETWORK_INTERFACE_UNKNOWN, mock_ip_, 0));
91 94
92 // "network4" is equivalent to "network2" because both the address family 95 // "network4" is equivalent to "network2" because both the address family
93 // and interface index are the same. 96 // and interface index are the same.
94 interface_list.push_back( 97 interface_list.push_back(
95 net::NetworkInterface("network4", "network4", 1, mock_ip_, 0)); 98 net::NetworkInterface("network4", "network4", 1,
99 net::NETWORK_INTERFACE_UNKNOWN, mock_ip_, 0));
96 100
97 // 3 sockets * 4 requests per socket = 12 requests 101 // 3 sockets * 4 requests per socket = 12 requests
98 EXPECT_CALL(mock_observer_, OnDiscoveryRequest(A<DialService*>())).Times(12); 102 EXPECT_CALL(mock_observer_, OnDiscoveryRequest(A<DialService*>())).Times(12);
99 EXPECT_CALL(mock_observer_, OnDiscoveryFinished(A<DialService*>())).Times(1); 103 EXPECT_CALL(mock_observer_, OnDiscoveryFinished(A<DialService*>())).Times(1);
100 104
101 dial_service_.SendNetworkList(interface_list); 105 dial_service_.SendNetworkList(interface_list);
102 EXPECT_EQ(3u, dial_service_.dial_sockets_.size()); 106 EXPECT_EQ(3u, dial_service_.dial_sockets_.size());
103 107
104 loop.RunUntilIdle(); 108 loop.RunUntilIdle();
105 dial_service_.FinishDiscovery(); 109 dial_service_.FinishDiscovery();
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 196
193 // Empty USN 197 // Empty USN
194 EXPECT_FALSE(DialServiceImpl::DialSocket::ParseResponse( 198 EXPECT_FALSE(DialServiceImpl::DialSocket::ParseResponse(
195 "HTTP/1.1 OK\r\n" 199 "HTTP/1.1 OK\r\n"
196 "LOCATION: http://127.0.0.1/dd.xml\r\n" 200 "LOCATION: http://127.0.0.1/dd.xml\r\n"
197 "USN:\r\n\r\n", 201 "USN:\r\n\r\n",
198 now, &not_parsed)); 202 now, &not_parsed));
199 } 203 }
200 204
201 } // namespace extensions 205 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/local_discovery/privet_traffic_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698