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

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

Issue 2843813002: Remove SetWithoutPathExpansion (Closed)
Patch Set: Fix CrOS Error Created 3 years, 7 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/network_state.cc ('k') | chromeos/network/network_ui_data.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chromeos/network/network_state.cc ('k') | chromeos/network/network_ui_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698