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

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

Issue 2285933003: Remove more usage of the base::ListValue::Append(Value*) overload. (Closed)
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/chromedriver/logging.cc ('k') | chrome/test/chromedriver/window_commands.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 cca0ad3cbd8d8de77d4349b1bac58848e3670e3b..e9126b47de1925c5dde2440ade02ee360fea852f 100644
--- a/chrome/test/chromedriver/performance_logger_unittest.cc
+++ b/chrome/test/chromedriver/performance_logger_unittest.cc
@@ -6,6 +6,9 @@
#include <stddef.h>
+#include <memory>
+#include <utility>
+
#include "base/compiler_specific.h"
#include "base/format_macros.h"
#include "base/json/json_reader.h"
@@ -315,12 +318,12 @@ TEST(PerformanceLogger, RecordTraceEvents) {
logger.OnConnected(&client);
base::DictionaryValue params;
base::ListValue* trace_events = new base::ListValue();
- base::DictionaryValue* event1 = new base::DictionaryValue();
+ std::unique_ptr<base::DictionaryValue> event1(new base::DictionaryValue());
event1->SetString("cat", "foo");
- trace_events->Append(event1);
- base::DictionaryValue* event2 = new base::DictionaryValue();
+ trace_events->Append(event1->CreateDeepCopy());
+ std::unique_ptr<base::DictionaryValue> event2(new base::DictionaryValue());
event2->SetString("cat", "bar");
- trace_events->Append(event2);
+ trace_events->Append(event2->CreateDeepCopy());
params.Set("value", trace_events);
ASSERT_EQ(kOk, client.TriggerEvent("Tracing.dataCollected", params).code());
« no previous file with comments | « chrome/test/chromedriver/logging.cc ('k') | chrome/test/chromedriver/window_commands.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698