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

Unified Diff: components/proximity_auth/throttled_bluetooth_connection_finder_unittest.cc

Issue 1912433002: Convert //components/proximity_auth from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits 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: components/proximity_auth/throttled_bluetooth_connection_finder_unittest.cc
diff --git a/components/proximity_auth/throttled_bluetooth_connection_finder_unittest.cc b/components/proximity_auth/throttled_bluetooth_connection_finder_unittest.cc
index e979090753913803bd89d7257033829bbdb0e78b..c4753f8090886922e9ecf183b9ddc50dc5970e21 100644
--- a/components/proximity_auth/throttled_bluetooth_connection_finder_unittest.cc
+++ b/components/proximity_auth/throttled_bluetooth_connection_finder_unittest.cc
@@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/test/test_simple_task_runner.h"
#include "base/time/time.h"
#include "components/proximity_auth/bluetooth_connection_finder.h"
@@ -30,8 +31,8 @@ const int kPollingIntervalSeconds = 7;
const char kUuid[] = "DEADBEEF-CAFE-FEED-FOOD-D15EA5EBEEF";
// A callback that stores a found |connection| into |out|.
-void SaveConnection(scoped_ptr<Connection>* out,
- scoped_ptr<Connection> connection) {
+void SaveConnection(std::unique_ptr<Connection>* out,
+ std::unique_ptr<Connection> connection) {
*out = std::move(connection);
}
@@ -58,7 +59,7 @@ class FakeBluetoothConnectionFinder : public BluetoothConnectionFinder {
void Find(const ConnectionCallback& connection_callback) override {
connection_callback.Run(
- make_scoped_ptr(new FakeConnection(RemoteDevice())));
+ base::WrapUnique(new FakeConnection(RemoteDevice())));
}
private:
@@ -83,9 +84,9 @@ TEST_F(ProximityAuthThrottledBluetoothConnectionFinderTest,
ON_CALL(throttler_, GetDelay()).WillByDefault(Return(base::TimeDelta()));
ThrottledBluetoothConnectionFinder connection_finder(
- make_scoped_ptr(new FakeBluetoothConnectionFinder), task_runner_,
+ base::WrapUnique(new FakeBluetoothConnectionFinder), task_runner_,
&throttler_);
- scoped_ptr<Connection> connection;
+ std::unique_ptr<Connection> connection;
connection_finder.Find(base::Bind(&SaveConnection, &connection));
EXPECT_TRUE(connection);
}
@@ -96,9 +97,9 @@ TEST_F(ProximityAuthThrottledBluetoothConnectionFinderTest,
.WillByDefault(Return(base::TimeDelta::FromSeconds(1)));
ThrottledBluetoothConnectionFinder connection_finder(
- make_scoped_ptr(new FakeBluetoothConnectionFinder), task_runner_,
+ base::WrapUnique(new FakeBluetoothConnectionFinder), task_runner_,
&throttler_);
- scoped_ptr<Connection> connection;
+ std::unique_ptr<Connection> connection;
connection_finder.Find(base::Bind(&SaveConnection, &connection));
EXPECT_FALSE(connection);
@@ -113,9 +114,9 @@ TEST_F(ProximityAuthThrottledBluetoothConnectionFinderTest,
ON_CALL(throttler_, GetDelay()).WillByDefault(Return(base::TimeDelta()));
ThrottledBluetoothConnectionFinder connection_finder(
- make_scoped_ptr(new FakeBluetoothConnectionFinder), task_runner_,
+ base::WrapUnique(new FakeBluetoothConnectionFinder), task_runner_,
&throttler_);
- scoped_ptr<Connection> connection;
+ std::unique_ptr<Connection> connection;
EXPECT_CALL(throttler_, OnConnection(_));
connection_finder.Find(base::Bind(&SaveConnection, &connection));
EXPECT_TRUE(connection);
« no previous file with comments | « components/proximity_auth/throttled_bluetooth_connection_finder.cc ('k') | components/proximity_auth/unlock_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698