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

Unified Diff: chromeos/network/network_util_unittest.cc

Issue 2392693002: Rewrite simple uses of base::ListValue::Append(base::Value*) on CrOS. (Closed)
Patch Set: MakeUnique Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/network/network_util.cc ('k') | chromeos/network/onc/onc_mapper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/network_util_unittest.cc
diff --git a/chromeos/network/network_util_unittest.cc b/chromeos/network/network_util_unittest.cc
index 032c08c8def2191355eb704b0b595b2dda1bf51b..8bae1db8d589f26e0ed9880e5aa0407d9a9de9bc 100644
--- a/chromeos/network/network_util_unittest.cc
+++ b/chromeos/network/network_util_unittest.cc
@@ -6,6 +6,9 @@
#include <stddef.h>
+#include <utility>
+
+#include "base/memory/ptr_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
@@ -118,24 +121,24 @@ TEST_F(NetworkUtilTest, ParseScanResults) {
// Scan result has no network id.
list.Clear();
- base::DictionaryValue* dict_value = new base::DictionaryValue();
+ auto dict_value = base::MakeUnique<base::DictionaryValue>();
dict_value->SetString(shill::kStatusProperty, "available");
- list.Append(dict_value);
+ list.Append(std::move(dict_value));
EXPECT_TRUE(ParseCellularScanResults(list, &scan_results));
EXPECT_TRUE(scan_results.empty());
// Mixed parse results.
- dict_value = new base::DictionaryValue();
+ dict_value = base::MakeUnique<base::DictionaryValue>();
dict_value->SetString(shill::kNetworkIdProperty, "000001");
dict_value->SetString(shill::kStatusProperty, "unknown");
dict_value->SetString(shill::kTechnologyProperty, "GSM");
- list.Append(dict_value);
+ list.Append(std::move(dict_value));
- dict_value = new base::DictionaryValue();
+ dict_value = base::MakeUnique<base::DictionaryValue>();
dict_value->SetString(shill::kNetworkIdProperty, "000002");
dict_value->SetString(shill::kStatusProperty, "available");
dict_value->SetString(shill::kLongNameProperty, "Long Name");
- list.Append(dict_value);
+ list.Append(std::move(dict_value));
EXPECT_TRUE(ParseCellularScanResults(list, &scan_results));
EXPECT_EQ(static_cast<size_t>(2), scan_results.size());
« no previous file with comments | « chromeos/network/network_util.cc ('k') | chromeos/network/onc/onc_mapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698