| 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 kTetherHasConnectedToHost, &tether_has_connected_to_host)); | 283 kTetherHasConnectedToHost, &tether_has_connected_to_host)); |
| 284 EXPECT_TRUE(tether_has_connected_to_host); | 284 EXPECT_TRUE(tether_has_connected_to_host); |
| 285 | 285 |
| 286 std::string carrier; | 286 std::string carrier; |
| 287 EXPECT_TRUE( | 287 EXPECT_TRUE( |
| 288 dictionary.GetStringWithoutPathExpansion(kTetherCarrier, &carrier)); | 288 dictionary.GetStringWithoutPathExpansion(kTetherCarrier, &carrier)); |
| 289 EXPECT_EQ("Project Fi", carrier); | 289 EXPECT_EQ("Project Fi", carrier); |
| 290 } | 290 } |
| 291 | 291 |
| 292 } // namespace chromeos | 292 } // namespace chromeos |
| OLD | NEW |