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

Unified Diff: chrome/test/chromedriver/performance_logger_unittest.cc

Issue 2888073002: Remove raw DictionaryValue::Set in //chrome (Closed)
Patch Set: Fix Tests 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: chrome/test/chromedriver/performance_logger_unittest.cc
diff --git a/chrome/test/chromedriver/performance_logger_unittest.cc b/chrome/test/chromedriver/performance_logger_unittest.cc
index 51572e6b7792a54d7d52108a3dd5ac5bd3ca4cd1..7a2ebf1d1c57b0496af855e46d2368c762e76aa4 100644
--- a/chrome/test/chromedriver/performance_logger_unittest.cc
+++ b/chrome/test/chromedriver/performance_logger_unittest.cc
@@ -332,14 +332,14 @@ TEST(PerformanceLogger, RecordTraceEvents) {
client.AddListener(&logger);
logger.OnConnected(&client);
base::DictionaryValue params;
- base::ListValue* trace_events = new base::ListValue();
- std::unique_ptr<base::DictionaryValue> event1(new base::DictionaryValue());
+ auto trace_events = base::MakeUnique<base::ListValue>();
+ auto event1 = base::MakeUnique<base::DictionaryValue>();
event1->SetString("cat", "foo");
- trace_events->Append(event1->CreateDeepCopy());
- std::unique_ptr<base::DictionaryValue> event2(new base::DictionaryValue());
+ trace_events->GetList().push_back(*event1);
+ auto event2 = base::MakeUnique<base::DictionaryValue>();
event2->SetString("cat", "bar");
- trace_events->Append(event2->CreateDeepCopy());
- params.Set("value", trace_events);
+ trace_events->GetList().push_back(*event2);
+ params.Set("value", std::move(trace_events));
ASSERT_EQ(kOk, client.TriggerEvent("Tracing.dataCollected", params).code());
ASSERT_EQ(2u, log.GetEntries().size());

Powered by Google App Engine
This is Rietveld 408576698