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

Unified Diff: chromeos/dbus/gsm_sms_client_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/dbus/fake_gsm_sms_client.cc ('k') | chromeos/dbus/shill_manager_client_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/gsm_sms_client_unittest.cc
diff --git a/chromeos/dbus/gsm_sms_client_unittest.cc b/chromeos/dbus/gsm_sms_client_unittest.cc
index 80c9a41e290457b704502d8590076c701bfd821a..e6498fd006c55b6100200b1e15f84b38cec56357 100644
--- a/chromeos/dbus/gsm_sms_client_unittest.cc
+++ b/chromeos/dbus/gsm_sms_client_unittest.cc
@@ -6,8 +6,12 @@
#include <stdint.h>
+#include <memory>
+#include <utility>
+
#include "base/bind.h"
#include "base/location.h"
+#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
@@ -312,11 +316,11 @@ TEST_F(GsmSMSClientTest, List) {
response_ = response.get();
// Create expected result.
base::ListValue expected_result;
- base::DictionaryValue* sms = new base::DictionaryValue;
+ auto sms = base::MakeUnique<base::DictionaryValue>();
sms->SetWithoutPathExpansion(kNumberKey,
new base::StringValue(kExampleNumber));
sms->SetWithoutPathExpansion(kTextKey, new base::StringValue(kExampleText));
- expected_result.Append(sms);
+ expected_result.Append(std::move(sms));
expected_result_ = &expected_result;
// Call List.
client_->List(kServiceName, dbus::ObjectPath(kObjectPath),
« no previous file with comments | « chromeos/dbus/fake_gsm_sms_client.cc ('k') | chromeos/dbus/shill_manager_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698