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

Unified Diff: base/trace_event/heap_profiler_type_name_deduplicator_unittest.cc

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 Created 4 years, 8 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: base/trace_event/heap_profiler_type_name_deduplicator_unittest.cc
diff --git a/base/trace_event/heap_profiler_type_name_deduplicator_unittest.cc b/base/trace_event/heap_profiler_type_name_deduplicator_unittest.cc
index 8ab3f3719aaa82245c95b2fa87a5d60b461e4223..b2e681ab26de025f0060e19ea4a2b16b2469c106 100644
--- a/base/trace_event/heap_profiler_type_name_deduplicator_unittest.cc
+++ b/base/trace_event/heap_profiler_type_name_deduplicator_unittest.cc
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <memory>
#include <string>
#include "base/json/json_reader.h"
-#include "base/memory/scoped_ptr.h"
#include "base/trace_event/heap_profiler_type_name_deduplicator.h"
#include "base/values.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -30,7 +30,8 @@ const char kTaskFileName[] = "..\\..\\base\\memory\\memory_win.cc";
const char kTaskPath[] = "base\\memory";
#endif
-scoped_ptr<Value> DumpAndReadBack(const TypeNameDeduplicator& deduplicator) {
+std::unique_ptr<Value> DumpAndReadBack(
+ const TypeNameDeduplicator& deduplicator) {
std::string json;
deduplicator.AppendAsTraceFormat(&json);
return JSONReader::Read(json);
@@ -41,10 +42,10 @@ scoped_ptr<Value> DumpAndReadBack(const TypeNameDeduplicator& deduplicator) {
// the same as |expected_value|.
void TestInsertTypeAndReadback(const char* type_name,
const char* expected_value) {
- scoped_ptr<TypeNameDeduplicator> dedup(new TypeNameDeduplicator);
+ std::unique_ptr<TypeNameDeduplicator> dedup(new TypeNameDeduplicator);
ASSERT_EQ(1, dedup->Insert(type_name));
- scoped_ptr<Value> type_names = DumpAndReadBack(*dedup);
+ std::unique_ptr<Value> type_names = DumpAndReadBack(*dedup);
ASSERT_NE(nullptr, type_names);
const DictionaryValue* dictionary;
@@ -66,7 +67,7 @@ TEST(TypeNameDeduplicatorTest, Deduplication) {
// 2: bool
// 3: string
- scoped_ptr<TypeNameDeduplicator> dedup(new TypeNameDeduplicator);
+ std::unique_ptr<TypeNameDeduplicator> dedup(new TypeNameDeduplicator);
ASSERT_EQ(1, dedup->Insert(kInt));
ASSERT_EQ(2, dedup->Insert(kBool));
ASSERT_EQ(3, dedup->Insert(kString));

Powered by Google App Engine
This is Rietveld 408576698