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

Unified Diff: base/test/values_test_util.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
« no previous file with comments | « base/test/values_test_util.h ('k') | base/threading/non_thread_safe_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/values_test_util.cc
diff --git a/base/test/values_test_util.cc b/base/test/values_test_util.cc
index f974c147916d853c39e0e8b7c48e0b24dc944227..6c1ee7d7fd4f0d7e86732734220326782596dbf4 100644
--- a/base/test/values_test_util.cc
+++ b/base/test/values_test_util.cc
@@ -4,8 +4,9 @@
#include "base/test/values_test_util.h"
+#include <memory>
+
#include "base/json/json_reader.h"
-#include "base/memory/scoped_ptr.h"
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -54,7 +55,7 @@ void ExpectDictStringValue(const std::string& expected_value,
void ExpectStringValue(const std::string& expected_str,
StringValue* actual) {
- scoped_ptr<StringValue> scoped_actual(actual);
+ std::unique_ptr<StringValue> scoped_actual(actual);
std::string actual_str;
EXPECT_TRUE(scoped_actual->GetAsString(&actual_str));
EXPECT_EQ(expected_str, actual_str);
@@ -62,9 +63,9 @@ void ExpectStringValue(const std::string& expected_str,
namespace test {
-scoped_ptr<Value> ParseJson(base::StringPiece json) {
+std::unique_ptr<Value> ParseJson(base::StringPiece json) {
std::string error_msg;
- scoped_ptr<Value> result = base::JSONReader::ReadAndReturnError(
+ std::unique_ptr<Value> result = base::JSONReader::ReadAndReturnError(
json, base::JSON_ALLOW_TRAILING_COMMAS, NULL, &error_msg);
if (!result) {
ADD_FAILURE() << "Failed to parse \"" << json << "\": " << error_msg;
« no previous file with comments | « base/test/values_test_util.h ('k') | base/threading/non_thread_safe_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698