OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/network_state.h" | 5 #include "chromeos/network/network_state.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 virtual bool GetAsString(std::string* out_value) const OVERRIDE { | 30 virtual bool GetAsString(std::string* out_value) const OVERRIDE { |
31 if (out_value) | 31 if (out_value) |
32 *out_value = value_; | 32 *out_value = value_; |
33 return true; | 33 return true; |
34 } | 34 } |
35 | 35 |
36 virtual TestStringValue* DeepCopy() const OVERRIDE { | 36 virtual TestStringValue* DeepCopy() const OVERRIDE { |
37 return new TestStringValue(value_); | 37 return new TestStringValue(value_); |
38 } | 38 } |
39 | 39 |
40 virtual bool Equals(const Value* other) const OVERRIDE { | 40 virtual bool Equals(const base::Value* other) const OVERRIDE { |
41 if (other->GetType() != GetType()) | 41 if (other->GetType() != GetType()) |
42 return false; | 42 return false; |
43 std::string lhs, rhs; | 43 std::string lhs, rhs; |
44 return GetAsString(&lhs) && other->GetAsString(&rhs) && lhs == rhs; | 44 return GetAsString(&lhs) && other->GetAsString(&rhs) && lhs == rhs; |
45 } | 45 } |
46 | 46 |
47 private: | 47 private: |
48 std::string value_; | 48 std::string value_; |
49 }; | 49 }; |
50 | 50 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 137 |
138 std::string wifi_hex_result = "This is HEX SSID!"; | 138 std::string wifi_hex_result = "This is HEX SSID!"; |
139 std::string wifi_hex = | 139 std::string wifi_hex = |
140 base::HexEncode(wifi_hex_result.c_str(), wifi_hex_result.length()); | 140 base::HexEncode(wifi_hex_result.c_str(), wifi_hex_result.length()); |
141 EXPECT_FALSE(SetStringProperty(shill::kWifiHexSsid, wifi_hex)); | 141 EXPECT_FALSE(SetStringProperty(shill::kWifiHexSsid, wifi_hex)); |
142 EXPECT_TRUE(SignalInitialPropertiesReceived()); | 142 EXPECT_TRUE(SignalInitialPropertiesReceived()); |
143 EXPECT_EQ(network_state_.name(), wifi_hex_result); | 143 EXPECT_EQ(network_state_.name(), wifi_hex_result); |
144 } | 144 } |
145 | 145 |
146 } // namespace chromeos | 146 } // namespace chromeos |
OLD | NEW |