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

Unified Diff: components/sync/engine_impl/js_mutation_event_observer_unittest.cc

Issue 2889163002: Remove raw DictionaryValue::Set in //components (Closed)
Patch Set: Nits 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 side-by-side diff with in-line comments
Download patch
Index: components/sync/engine_impl/js_mutation_event_observer_unittest.cc
diff --git a/components/sync/engine_impl/js_mutation_event_observer_unittest.cc b/components/sync/engine_impl/js_mutation_event_observer_unittest.cc
index 1a8da574aef4618f112f6e3aaa5ee36d6e13644a..cffd8925f7b2a36b1ca6a6454143dad0905783da 100644
--- a/components/sync/engine_impl/js_mutation_event_observer_unittest.cc
+++ b/components/sync/engine_impl/js_mutation_event_observer_unittest.cc
@@ -4,6 +4,9 @@
#include "components/sync/engine_impl/js_mutation_event_observer.h"
+#include <utility>
+
+#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
#include "base/test/scoped_task_environment.h"
#include "base/values.h"
@@ -69,11 +72,11 @@ TEST_F(JsMutationEventObserverTest, OnChangesApplied) {
base::DictionaryValue expected_details;
expected_details.SetString("modelType", model_type_str);
expected_details.SetString("writeTransactionId", "0");
- base::ListValue* expected_changes = new base::ListValue();
- expected_details.Set("changes", expected_changes);
+ auto expected_changes = base::MakeUnique<base::ListValue>();
for (int j = i; j < MODEL_TYPE_COUNT; ++j) {
expected_changes->Append(changes[j].ToValue());
}
+ expected_details.Set("changes", std::move(expected_changes));
EXPECT_CALL(mock_js_event_handler_,
HandleJsEvent("onChangesApplied",
HasDetailsAsDictionary(expected_details)));

Powered by Google App Engine
This is Rietveld 408576698