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

Unified Diff: base/bind_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/bind_helpers.h ('k') | base/callback.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/bind_unittest.cc
diff --git a/base/bind_unittest.cc b/base/bind_unittest.cc
index daf8c1288840fa86e83eba603bd2f6219c350e13..f8278011df6c2e70ac5b127adba78e3bd9d72ab9 100644
--- a/base/bind_unittest.cc
+++ b/base/bind_unittest.cc
@@ -10,8 +10,8 @@
#include "base/callback.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "build/build_config.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -817,7 +817,7 @@ struct CustomDeleter {
};
using MoveOnlyTypesToTest =
- ::testing::Types<scoped_ptr<DeleteCounter>,
+ ::testing::Types<std::unique_ptr<DeleteCounter>,
std::unique_ptr<DeleteCounter>,
std::unique_ptr<DeleteCounter, CustomDeleter>>;
TYPED_TEST_CASE(BindMoveOnlyTypeTest, MoveOnlyTypesToTest);
@@ -874,23 +874,23 @@ TYPED_TEST(BindMoveOnlyTypeTest, UnboundForwarding) {
EXPECT_EQ(1, deletes);
}
-void VerifyVector(const std::vector<scoped_ptr<int>>& v) {
+void VerifyVector(const std::vector<std::unique_ptr<int>>& v) {
ASSERT_EQ(1u, v.size());
EXPECT_EQ(12345, *v[0]);
}
-std::vector<scoped_ptr<int>> AcceptAndReturnMoveOnlyVector(
- std::vector<scoped_ptr<int>> v) {
+std::vector<std::unique_ptr<int>> AcceptAndReturnMoveOnlyVector(
+ std::vector<std::unique_ptr<int>> v) {
VerifyVector(v);
return v;
}
// Test that a vector containing move-only types can be used with Callback.
TEST_F(BindTest, BindMoveOnlyVector) {
- using MoveOnlyVector = std::vector<scoped_ptr<int>>;
+ using MoveOnlyVector = std::vector<std::unique_ptr<int>>;
MoveOnlyVector v;
- v.push_back(make_scoped_ptr(new int(12345)));
+ v.push_back(WrapUnique(new int(12345)));
// Early binding should work:
base::Callback<MoveOnlyVector()> bound_cb =
« no previous file with comments | « base/bind_helpers.h ('k') | base/callback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698