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

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

Issue 24348002: Migrate DBus service constants from flimflam namespace to shill namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased to ToT 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
« no previous file with comments | « chromeos/network/shill_property_util.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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/shill_property_util.h" 5 #include "chromeos/network/shill_property_util.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "third_party/cros_system_api/dbus/service_constants.h" 8 #include "third_party/cros_system_api/dbus/service_constants.h"
9 9
10 namespace chromeos { 10 namespace chromeos {
(...skipping 24 matching lines...) Expand all
35 const NetworkTypePattern ethernet_; 35 const NetworkTypePattern ethernet_;
36 const NetworkTypePattern mobile_; 36 const NetworkTypePattern mobile_;
37 const NetworkTypePattern non_virtual_; 37 const NetworkTypePattern non_virtual_;
38 const NetworkTypePattern wimax_; 38 const NetworkTypePattern wimax_;
39 const NetworkTypePattern wireless_; 39 const NetworkTypePattern wireless_;
40 }; 40 };
41 41
42 } // namespace 42 } // namespace
43 43
44 TEST_F(NetworkTypePatternTest, MatchesType) { 44 TEST_F(NetworkTypePatternTest, MatchesType) {
45 EXPECT_TRUE(mobile_.MatchesType(flimflam::kTypeCellular)); 45 EXPECT_TRUE(mobile_.MatchesType(shill::kTypeCellular));
46 EXPECT_TRUE(mobile_.MatchesType(flimflam::kTypeWimax)); 46 EXPECT_TRUE(mobile_.MatchesType(shill::kTypeWimax));
47 EXPECT_FALSE(mobile_.MatchesType(flimflam::kTypeWifi)); 47 EXPECT_FALSE(mobile_.MatchesType(shill::kTypeWifi));
48 48
49 EXPECT_TRUE(wireless_.MatchesType(flimflam::kTypeWifi)); 49 EXPECT_TRUE(wireless_.MatchesType(shill::kTypeWifi));
50 EXPECT_TRUE(wireless_.MatchesType(flimflam::kTypeCellular)); 50 EXPECT_TRUE(wireless_.MatchesType(shill::kTypeCellular));
51 EXPECT_TRUE(wireless_.MatchesType(flimflam::kTypeWimax)); 51 EXPECT_TRUE(wireless_.MatchesType(shill::kTypeWimax));
52 EXPECT_FALSE(wireless_.MatchesType(flimflam::kTypeEthernet)); 52 EXPECT_FALSE(wireless_.MatchesType(shill::kTypeEthernet));
53 } 53 }
54 54
55 TEST_F(NetworkTypePatternTest, MatchesPattern) { 55 TEST_F(NetworkTypePatternTest, MatchesPattern) {
56 // Each pair of {Mobile, Wireless, Cellular} is matching. Matching is 56 // Each pair of {Mobile, Wireless, Cellular} is matching. Matching is
57 // reflexive and symmetric (checked in MatchesPattern). 57 // reflexive and symmetric (checked in MatchesPattern).
58 EXPECT_TRUE(MatchesPattern(mobile_, mobile_)); 58 EXPECT_TRUE(MatchesPattern(mobile_, mobile_));
59 EXPECT_TRUE(MatchesPattern(wireless_, wireless_)); 59 EXPECT_TRUE(MatchesPattern(wireless_, wireless_));
60 EXPECT_TRUE(MatchesPattern(cellular_, cellular_)); 60 EXPECT_TRUE(MatchesPattern(cellular_, cellular_));
61 61
62 EXPECT_TRUE(MatchesPattern(mobile_, wireless_)); 62 EXPECT_TRUE(MatchesPattern(mobile_, wireless_));
(...skipping 13 matching lines...) Expand all
76 } 76 }
77 77
78 TEST_F(NetworkTypePatternTest, Equals) { 78 TEST_F(NetworkTypePatternTest, Equals) {
79 EXPECT_TRUE(mobile_.Equals(mobile_)); 79 EXPECT_TRUE(mobile_.Equals(mobile_));
80 EXPECT_FALSE(mobile_.Equals(cellular_)); 80 EXPECT_FALSE(mobile_.Equals(cellular_));
81 EXPECT_FALSE(cellular_.Equals(mobile_)); 81 EXPECT_FALSE(cellular_.Equals(mobile_));
82 } 82 }
83 83
84 TEST_F(NetworkTypePatternTest, Primitive) { 84 TEST_F(NetworkTypePatternTest, Primitive) {
85 const NetworkTypePattern primitive_cellular = 85 const NetworkTypePattern primitive_cellular =
86 NetworkTypePattern::Primitive(flimflam::kTypeCellular); 86 NetworkTypePattern::Primitive(shill::kTypeCellular);
87 EXPECT_TRUE(cellular_.Equals(primitive_cellular)); 87 EXPECT_TRUE(cellular_.Equals(primitive_cellular));
88 EXPECT_TRUE(primitive_cellular.Equals(cellular_)); 88 EXPECT_TRUE(primitive_cellular.Equals(cellular_));
89 89
90 const NetworkTypePattern primitive_wimax = 90 const NetworkTypePattern primitive_wimax =
91 NetworkTypePattern::Primitive(flimflam::kTypeWimax); 91 NetworkTypePattern::Primitive(shill::kTypeWimax);
92 EXPECT_TRUE(wimax_.Equals(primitive_wimax)); 92 EXPECT_TRUE(wimax_.Equals(primitive_wimax));
93 EXPECT_TRUE(primitive_wimax.Equals(wimax_)); 93 EXPECT_TRUE(primitive_wimax.Equals(wimax_));
94 } 94 }
95 95
96 TEST_F(NetworkTypePatternTest, ToDebugString) { 96 TEST_F(NetworkTypePatternTest, ToDebugString) {
97 EXPECT_EQ(default_.ToDebugString(), "PatternDefault"); 97 EXPECT_EQ(default_.ToDebugString(), "PatternDefault");
98 EXPECT_EQ(mobile_.ToDebugString(), "PatternMobile"); 98 EXPECT_EQ(mobile_.ToDebugString(), "PatternMobile");
99 EXPECT_EQ(cellular_.ToDebugString(), "cellular"); 99 EXPECT_EQ(cellular_.ToDebugString(), "cellular");
100 } 100 }
101 101
102 } // namespace chromeos 102 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/shill_property_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698