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

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

Issue 675993005: components: add wifi_sync component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@local-master
Patch Set: fix style issues, and unnecessary virtual functions 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
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 #if defined(OS_CHROMEOS)
erikwright (departed) 2014/10/29 18:18:25 same question about file suffix
mukesh agrawal 2014/10/30 18:41:29 Done.
9 #include "third_party/cros_system_api/dbus/service_constants.h"
10 #endif
11
12 namespace wifi_sync {
13
14 #if defined(OS_CHROMEOS)
15 TEST(WifiSecurityClassTest, FromShillStringToEnum) {
16 EXPECT_EQ(SECURITY_CLASS_NONE,
17 WifiSecurityClassFromShillString(shill::kSecurityNone));
18 EXPECT_EQ(SECURITY_CLASS_WEP,
19 WifiSecurityClassFromShillString(shill::kSecurityWep));
20 EXPECT_EQ(SECURITY_CLASS_PSK,
21 WifiSecurityClassFromShillString(shill::kSecurityPsk));
22 EXPECT_EQ(SECURITY_CLASS_802_1X,
23 WifiSecurityClassFromShillString(shill::kSecurity8021x));
24 EXPECT_EQ(SECURITY_CLASS_INVALID,
25 WifiSecurityClassFromShillString("bogus-security-class"));
26 }
27
28 TEST(WifiSecurityClassTest, FromEnumToShillString) {
29 std::string security_class_string;
30
31 EXPECT_TRUE(WifiSecurityClassToShillString(SECURITY_CLASS_NONE,
32 &security_class_string));
33 EXPECT_EQ(shill::kSecurityNone, security_class_string);
34
35 EXPECT_TRUE(WifiSecurityClassToShillString(SECURITY_CLASS_WEP,
36 &security_class_string));
37 EXPECT_EQ(shill::kSecurityWep, security_class_string);
38
39 EXPECT_TRUE(WifiSecurityClassToShillString(SECURITY_CLASS_PSK,
40 &security_class_string));
41 EXPECT_EQ(shill::kSecurityPsk, security_class_string);
42
43 EXPECT_TRUE(WifiSecurityClassToShillString(SECURITY_CLASS_802_1X,
44 &security_class_string));
45 EXPECT_EQ(shill::kSecurity8021x, security_class_string);
46
47 EXPECT_FALSE(WifiSecurityClassToShillString(SECURITY_CLASS_INVALID,
48 &security_class_string));
49 }
50 #endif // OS_CHROMEOS
51
52 } // namespace wifi_sync
OLDNEW
« components/wifi_sync/wifi_security_class.cc ('K') | « components/wifi_sync/wifi_security_class.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698