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

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

Issue 663673002: Convert the few remaining ARRAYSIZE_UNSAFE -> arraysize. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « chromeos/network/network_cert_migrator.cc ('k') | crypto/hmac_unittest.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 "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
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
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
OLDNEW
« no previous file with comments | « chromeos/network/network_cert_migrator.cc ('k') | crypto/hmac_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698