| OLD | NEW |
| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 { shill::kTypeCellular, shill::kNetworkTechnologyHspaPlus, | 85 { shill::kTypeCellular, shill::kNetworkTechnologyHspaPlus, |
| 86 NetworkChangeNotifier::CONNECTION_4G }, | 86 NetworkChangeNotifier::CONNECTION_4G }, |
| 87 { shill::kTypeCellular, shill::kNetworkTechnologyLte, | 87 { shill::kTypeCellular, shill::kNetworkTechnologyLte, |
| 88 NetworkChangeNotifier::CONNECTION_4G }, | 88 NetworkChangeNotifier::CONNECTION_4G }, |
| 89 { shill::kTypeCellular, shill::kNetworkTechnologyLteAdvanced, | 89 { shill::kTypeCellular, shill::kNetworkTechnologyLteAdvanced, |
| 90 NetworkChangeNotifier::CONNECTION_4G }, | 90 NetworkChangeNotifier::CONNECTION_4G }, |
| 91 { shill::kTypeCellular, "unknown technology", | 91 { shill::kTypeCellular, "unknown technology", |
| 92 NetworkChangeNotifier::CONNECTION_2G } | 92 NetworkChangeNotifier::CONNECTION_2G } |
| 93 }; | 93 }; |
| 94 | 94 |
| 95 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(type_mappings); ++i) { | 95 for (size_t i = 0; i < arraysize(type_mappings); ++i) { |
| 96 NetworkChangeNotifier::ConnectionType type = | 96 NetworkChangeNotifier::ConnectionType type = |
| 97 NetworkChangeNotifierChromeos::ConnectionTypeFromShill( | 97 NetworkChangeNotifierChromeos::ConnectionTypeFromShill( |
| 98 type_mappings[i].shill_type, type_mappings[i].technology); | 98 type_mappings[i].shill_type, type_mappings[i].technology); |
| 99 EXPECT_EQ(type_mappings[i].connection_type, type); | 99 EXPECT_EQ(type_mappings[i].connection_type, type); |
| 100 } | 100 } |
| 101 } | 101 } |
| 102 | 102 |
| 103 class NetworkChangeNotifierChromeosUpdateTest : public testing::Test { | 103 class NetworkChangeNotifierChromeosUpdateTest : public testing::Test { |
| 104 protected: | 104 protected: |
| 105 NetworkChangeNotifierChromeosUpdateTest() : default_network_("") { | 105 NetworkChangeNotifierChromeosUpdateTest() : default_network_("") { |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 bool type_changed = false, ip_changed = false, dns_changed = false; | 226 bool type_changed = false, ip_changed = false, dns_changed = false; |
| 227 ProcessDefaultNetworkUpdate(&type_changed, &ip_changed, &dns_changed); | 227 ProcessDefaultNetworkUpdate(&type_changed, &ip_changed, &dns_changed); |
| 228 VerifyNotifierState(test_cases[i].expected_state); | 228 VerifyNotifierState(test_cases[i].expected_state); |
| 229 EXPECT_TRUE(type_changed == test_cases[i].expected_type_changed); | 229 EXPECT_TRUE(type_changed == test_cases[i].expected_type_changed); |
| 230 EXPECT_TRUE(ip_changed == test_cases[i].expected_ip_changed); | 230 EXPECT_TRUE(ip_changed == test_cases[i].expected_ip_changed); |
| 231 EXPECT_TRUE(dns_changed == test_cases[i].expected_dns_changed); | 231 EXPECT_TRUE(dns_changed == test_cases[i].expected_dns_changed); |
| 232 } | 232 } |
| 233 } | 233 } |
| 234 | 234 |
| 235 } // namespace chromeos | 235 } // namespace chromeos |
| OLD | NEW |