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

Side by Side Diff: components/wifi_sync/wifi_security_class_chromeos_unittest.cc

Issue 675993005: components: add wifi_sync component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@local-master
Patch Set: rebase Created 6 years, 1 month 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 | « components/wifi_sync/wifi_security_class_chromeos.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "components/wifi_sync/wifi_security_class.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "third_party/cros_system_api/dbus/service_constants.h"
9
10 namespace wifi_sync {
11
12 TEST(WifiSecurityClassTest, FromShillStringToEnum) {
13 EXPECT_EQ(SECURITY_CLASS_NONE,
14 WifiSecurityClassFromShillString(shill::kSecurityNone));
15 EXPECT_EQ(SECURITY_CLASS_WEP,
16 WifiSecurityClassFromShillString(shill::kSecurityWep));
17 EXPECT_EQ(SECURITY_CLASS_PSK,
18 WifiSecurityClassFromShillString(shill::kSecurityPsk));
19 EXPECT_EQ(SECURITY_CLASS_802_1X,
20 WifiSecurityClassFromShillString(shill::kSecurity8021x));
21 EXPECT_EQ(SECURITY_CLASS_INVALID,
22 WifiSecurityClassFromShillString("bogus-security-class"));
23 }
24
25 TEST(WifiSecurityClassTest, FromEnumToShillString) {
26 std::string security_class_string;
27
28 EXPECT_TRUE(WifiSecurityClassToShillString(SECURITY_CLASS_NONE,
29 &security_class_string));
30 EXPECT_EQ(shill::kSecurityNone, security_class_string);
31
32 EXPECT_TRUE(WifiSecurityClassToShillString(SECURITY_CLASS_WEP,
33 &security_class_string));
34 EXPECT_EQ(shill::kSecurityWep, security_class_string);
35
36 EXPECT_TRUE(WifiSecurityClassToShillString(SECURITY_CLASS_PSK,
37 &security_class_string));
38 EXPECT_EQ(shill::kSecurityPsk, security_class_string);
39
40 EXPECT_TRUE(WifiSecurityClassToShillString(SECURITY_CLASS_802_1X,
41 &security_class_string));
42 EXPECT_EQ(shill::kSecurity8021x, security_class_string);
43
44 EXPECT_FALSE(WifiSecurityClassToShillString(SECURITY_CLASS_INVALID,
45 &security_class_string));
46 }
47
48 } // namespace wifi_sync
OLDNEW
« no previous file with comments | « components/wifi_sync/wifi_security_class_chromeos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698