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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 12 matching lines...) Expand all Loading... |
23 namespace { | 23 namespace { |
24 | 24 |
25 class NetworkStateTest : public testing::Test { | 25 class NetworkStateTest : public testing::Test { |
26 public: | 26 public: |
27 NetworkStateTest() : network_state_("test_path") { | 27 NetworkStateTest() : network_state_("test_path") { |
28 } | 28 } |
29 | 29 |
30 protected: | 30 protected: |
31 bool SetProperty(const std::string& key, std::unique_ptr<base::Value> value) { | 31 bool SetProperty(const std::string& key, std::unique_ptr<base::Value> value) { |
32 const bool result = network_state_.PropertyChanged(key, *value); | 32 const bool result = network_state_.PropertyChanged(key, *value); |
33 properties_.SetWithoutPathExpansion(key, value.release()); | 33 properties_.SetWithoutPathExpansion(key, std::move(value)); |
34 return result; | 34 return result; |
35 } | 35 } |
36 | 36 |
37 bool SetStringProperty(const std::string& key, const std::string& value) { | 37 bool SetStringProperty(const std::string& key, const std::string& value) { |
38 return SetProperty(key, base::MakeUnique<base::Value>(value)); | 38 return SetProperty(key, base::MakeUnique<base::Value>(value)); |
39 } | 39 } |
40 | 40 |
41 bool SignalInitialPropertiesReceived() { | 41 bool SignalInitialPropertiesReceived() { |
42 return network_state_.InitialPropertiesReceived(properties_); | 42 return network_state_.InitialPropertiesReceived(properties_); |
43 } | 43 } |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 kTetherBatteryPercentage, &battery_percentage)); | 277 kTetherBatteryPercentage, &battery_percentage)); |
278 EXPECT_EQ(85, battery_percentage); | 278 EXPECT_EQ(85, battery_percentage); |
279 | 279 |
280 std::string carrier; | 280 std::string carrier; |
281 EXPECT_TRUE( | 281 EXPECT_TRUE( |
282 dictionary.GetStringWithoutPathExpansion(kTetherCarrier, &carrier)); | 282 dictionary.GetStringWithoutPathExpansion(kTetherCarrier, &carrier)); |
283 EXPECT_EQ("Project Fi", carrier); | 283 EXPECT_EQ("Project Fi", carrier); |
284 } | 284 } |
285 | 285 |
286 } // namespace chromeos | 286 } // namespace chromeos |
OLD | NEW |