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

Unified Diff: base/threading/thread_checker_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
« no previous file with comments | « base/threading/thread.cc ('k') | base/threading/thread_collision_warner_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/thread_checker_unittest.cc
diff --git a/base/threading/thread_checker_unittest.cc b/base/threading/thread_checker_unittest.cc
index fd98f764ed18efcaced1a19afd2c558fbb534d17..bc5b1e473a5fdc21ee01496a1e19f3fd66bde7c6 100644
--- a/base/threading/thread_checker_unittest.cc
+++ b/base/threading/thread_checker_unittest.cc
@@ -2,11 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/threading/thread_checker.h"
+
+#include <memory>
+
#include "base/logging.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "base/threading/simple_thread.h"
-#include "base/threading/thread_checker.h"
#include "testing/gtest/include/gtest/gtest.h"
// Duplicated from base/threading/thread_checker.h so that we can be
@@ -72,7 +74,7 @@ class DeleteThreadCheckerClassOnThread : public base::SimpleThread {
void Run() override { thread_checker_class_.reset(); }
private:
- scoped_ptr<ThreadCheckerClass> thread_checker_class_;
+ std::unique_ptr<ThreadCheckerClass> thread_checker_class_;
DISALLOW_COPY_AND_ASSIGN(DeleteThreadCheckerClassOnThread);
};
@@ -80,7 +82,7 @@ class DeleteThreadCheckerClassOnThread : public base::SimpleThread {
} // namespace
TEST(ThreadCheckerTest, CallsAllowedOnSameThread) {
- scoped_ptr<ThreadCheckerClass> thread_checker_class(
+ std::unique_ptr<ThreadCheckerClass> thread_checker_class(
new ThreadCheckerClass);
// Verify that DoStuff doesn't assert.
@@ -91,7 +93,7 @@ TEST(ThreadCheckerTest, CallsAllowedOnSameThread) {
}
TEST(ThreadCheckerTest, DestructorAllowedOnDifferentThread) {
- scoped_ptr<ThreadCheckerClass> thread_checker_class(
+ std::unique_ptr<ThreadCheckerClass> thread_checker_class(
new ThreadCheckerClass);
// Verify that the destructor doesn't assert
@@ -104,7 +106,7 @@ TEST(ThreadCheckerTest, DestructorAllowedOnDifferentThread) {
}
TEST(ThreadCheckerTest, DetachFromThread) {
- scoped_ptr<ThreadCheckerClass> thread_checker_class(
+ std::unique_ptr<ThreadCheckerClass> thread_checker_class(
new ThreadCheckerClass);
// Verify that DoStuff doesn't assert when called on a different thread after
@@ -119,7 +121,7 @@ TEST(ThreadCheckerTest, DetachFromThread) {
#if GTEST_HAS_DEATH_TEST || !ENABLE_THREAD_CHECKER
void ThreadCheckerClass::MethodOnDifferentThreadImpl() {
- scoped_ptr<ThreadCheckerClass> thread_checker_class(
+ std::unique_ptr<ThreadCheckerClass> thread_checker_class(
new ThreadCheckerClass);
// DoStuff should assert in debug builds only when called on a
@@ -143,7 +145,7 @@ TEST(ThreadCheckerTest, MethodAllowedOnDifferentThreadInRelease) {
#endif // ENABLE_THREAD_CHECKER
void ThreadCheckerClass::DetachThenCallFromDifferentThreadImpl() {
- scoped_ptr<ThreadCheckerClass> thread_checker_class(
+ std::unique_ptr<ThreadCheckerClass> thread_checker_class(
new ThreadCheckerClass);
// DoStuff doesn't assert when called on a different thread
« no previous file with comments | « base/threading/thread.cc ('k') | base/threading/thread_collision_warner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698