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

Side by Side Diff: chromeos/network/network_change_notifier_chromeos_unittest.cc

Issue 23712002: Cleanup network type matching. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Generalized network type matching. Created 7 years, 3 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
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 "chromeos/network/network_change_notifier_chromeos.h" 5 #include "chromeos/network/network_change_notifier_chromeos.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 using net::NetworkChangeNotifier; 57 using net::NetworkChangeNotifier;
58 58
59 TEST(NetworkChangeNotifierChromeosTest, ConnectionTypeFromShill) { 59 TEST(NetworkChangeNotifierChromeosTest, ConnectionTypeFromShill) {
60 struct TypeMapping { 60 struct TypeMapping {
61 const char* shill_type; 61 const char* shill_type;
62 const char* technology; 62 const char* technology;
63 NetworkChangeNotifier::ConnectionType connection_type; 63 NetworkChangeNotifier::ConnectionType connection_type;
64 }; 64 };
65 TypeMapping type_mappings[] = { 65 TypeMapping type_mappings[] = {
66 { flimflam::kTypeEthernet, "", NetworkChangeNotifier::CONNECTION_ETHERNET }, 66 { flimflam::kTypeEthernet, "", NetworkChangeNotifier::CONNECTION_ETHERNET },
67 { shill::kTypeEthernetEap, "", NetworkChangeNotifier::CONNECTION_ETHERNET },
67 { flimflam::kTypeWifi, "", NetworkChangeNotifier::CONNECTION_WIFI }, 68 { flimflam::kTypeWifi, "", NetworkChangeNotifier::CONNECTION_WIFI },
68 { flimflam::kTypeWimax, "", NetworkChangeNotifier::CONNECTION_4G }, 69 { flimflam::kTypeWimax, "", NetworkChangeNotifier::CONNECTION_4G },
69 { "unknown type", "unknown technology", 70 { "unknown type", "unknown technology",
70 NetworkChangeNotifier::CONNECTION_UNKNOWN }, 71 NetworkChangeNotifier::CONNECTION_UNKNOWN },
71 { flimflam::kTypeCellular, flimflam::kNetworkTechnology1Xrtt, 72 { flimflam::kTypeCellular, flimflam::kNetworkTechnology1Xrtt,
72 NetworkChangeNotifier::CONNECTION_2G }, 73 NetworkChangeNotifier::CONNECTION_2G },
73 { flimflam::kTypeCellular, flimflam::kNetworkTechnologyGprs, 74 { flimflam::kTypeCellular, flimflam::kNetworkTechnologyGprs,
74 NetworkChangeNotifier::CONNECTION_2G }, 75 NetworkChangeNotifier::CONNECTION_2G },
75 { flimflam::kTypeCellular, flimflam::kNetworkTechnologyEdge, 76 { flimflam::kTypeCellular, flimflam::kNetworkTechnologyEdge,
76 NetworkChangeNotifier::CONNECTION_2G }, 77 NetworkChangeNotifier::CONNECTION_2G },
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 bool type_changed = false, ip_changed = false, dns_changed = false; 226 bool type_changed = false, ip_changed = false, dns_changed = false;
226 ProcessDefaultNetworkUpdate(&type_changed, &ip_changed, &dns_changed); 227 ProcessDefaultNetworkUpdate(&type_changed, &ip_changed, &dns_changed);
227 VerifyNotifierState(test_cases[i].expected_state); 228 VerifyNotifierState(test_cases[i].expected_state);
228 EXPECT_TRUE(type_changed == test_cases[i].expected_type_changed); 229 EXPECT_TRUE(type_changed == test_cases[i].expected_type_changed);
229 EXPECT_TRUE(ip_changed == test_cases[i].expected_ip_changed); 230 EXPECT_TRUE(ip_changed == test_cases[i].expected_ip_changed);
230 EXPECT_TRUE(dns_changed == test_cases[i].expected_dns_changed); 231 EXPECT_TRUE(dns_changed == test_cases[i].expected_dns_changed);
231 } 232 }
232 } 233 }
233 234
234 } // namespace chromeos 235 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698