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

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

Issue 2255093003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 } 59 }
60 60
61 protected: 61 protected:
62 bool SetProperty(const std::string& key, std::unique_ptr<base::Value> value) { 62 bool SetProperty(const std::string& key, std::unique_ptr<base::Value> value) {
63 const bool result = network_state_.PropertyChanged(key, *value); 63 const bool result = network_state_.PropertyChanged(key, *value);
64 properties_.SetWithoutPathExpansion(key, value.release()); 64 properties_.SetWithoutPathExpansion(key, value.release());
65 return result; 65 return result;
66 } 66 }
67 67
68 bool SetStringProperty(const std::string& key, const std::string& value) { 68 bool SetStringProperty(const std::string& key, const std::string& value) {
69 return SetProperty(key, base::WrapUnique(new TestStringValue(value))); 69 return SetProperty(key, base::MakeUnique<TestStringValue>(value));
70 } 70 }
71 71
72 bool SignalInitialPropertiesReceived() { 72 bool SignalInitialPropertiesReceived() {
73 return network_state_.InitialPropertiesReceived(properties_); 73 return network_state_.InitialPropertiesReceived(properties_);
74 } 74 }
75 75
76 NetworkState network_state_; 76 NetworkState network_state_;
77 77
78 private: 78 private:
79 base::DictionaryValue properties_; 79 base::DictionaryValue properties_;
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 provider->SetStringWithoutPathExpansion( 232 provider->SetStringWithoutPathExpansion(
233 shill::kHostProperty, "third-party-vpn-provider-extension-id"); 233 shill::kHostProperty, "third-party-vpn-provider-extension-id");
234 EXPECT_TRUE(SetProperty(shill::kProviderProperty, std::move(provider))); 234 EXPECT_TRUE(SetProperty(shill::kProviderProperty, std::move(provider)));
235 SignalInitialPropertiesReceived(); 235 SignalInitialPropertiesReceived();
236 EXPECT_EQ(network_state_.vpn_provider_type(), shill::kProviderThirdPartyVpn); 236 EXPECT_EQ(network_state_.vpn_provider_type(), shill::kProviderThirdPartyVpn);
237 EXPECT_EQ(network_state_.third_party_vpn_provider_extension_id(), 237 EXPECT_EQ(network_state_.third_party_vpn_provider_extension_id(),
238 "third-party-vpn-provider-extension-id"); 238 "third-party-vpn-provider-extension-id");
239 } 239 }
240 240
241 } // namespace chromeos 241 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698