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

Unified Diff: components/safe_json/json_sanitizer_unittest.cc

Issue 1921923002: Convert //components/[o-t]* from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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 | « components/safe_json/json_sanitizer.cc ('k') | components/safe_json/safe_json_parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/safe_json/json_sanitizer_unittest.cc
diff --git a/components/safe_json/json_sanitizer_unittest.cc b/components/safe_json/json_sanitizer_unittest.cc
index 6571eb69c5cbe166c5035f3a431bce724dc3d6a7..7caa0992e2b607b93d101a78784fc0a313f39111 100644
--- a/components/safe_json/json_sanitizer_unittest.cc
+++ b/components/safe_json/json_sanitizer_unittest.cc
@@ -2,15 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "components/safe_json/json_sanitizer.h"
+
+#include <memory>
+
#include "base/bind.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
-#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/values.h"
#include "build/build_config.h"
-#include "components/safe_json/json_sanitizer.h"
#include "components/safe_json/safe_json_parser.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -54,20 +56,20 @@ class JsonSanitizerTest : public ::testing::Test {
std::string error_;
State state_;
- scoped_ptr<base::RunLoop> run_loop_;
+ std::unique_ptr<base::RunLoop> run_loop_;
};
void JsonSanitizerTest::CheckSuccess(const std::string& json) {
SCOPED_TRACE(json);
Sanitize(json);
- scoped_ptr<base::Value> parsed = base::JSONReader::Read(json);
+ std::unique_ptr<base::Value> parsed = base::JSONReader::Read(json);
ASSERT_TRUE(parsed);
EXPECT_EQ(State::STATE_SUCCESS, state_) << "Error: " << error_;
// The JSON parser should accept the result.
int error_code;
std::string error;
- scoped_ptr<base::Value> reparsed = base::JSONReader::ReadAndReturnError(
+ std::unique_ptr<base::Value> reparsed = base::JSONReader::ReadAndReturnError(
result_, base::JSON_PARSE_RFC, &error_code, &error);
EXPECT_TRUE(reparsed)
<< "Invalid result: " << error;
« no previous file with comments | « components/safe_json/json_sanitizer.cc ('k') | components/safe_json/safe_json_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698