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

Unified Diff: base/message_loop/message_pump_libevent_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/message_loop/message_pump_libevent.cc ('k') | base/message_loop/message_pump_perftest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop/message_pump_libevent_unittest.cc
diff --git a/base/message_loop/message_pump_libevent_unittest.cc b/base/message_loop/message_pump_libevent_unittest.cc
index eb30d535db60c6a90bb53082679a9cfa0bdabcca..81afa5e58c1e8178b65c1f04d97b273f00cc0128 100644
--- a/base/message_loop/message_pump_libevent_unittest.cc
+++ b/base/message_loop/message_pump_libevent_unittest.cc
@@ -6,10 +6,12 @@
#include <unistd.h>
+#include <memory>
+
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/files/file_util.h"
-#include "base/memory/scoped_ptr.h"
+#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/posix/eintr_wrapper.h"
#include "base/run_loop.h"
@@ -55,7 +57,7 @@ class MessagePumpLibeventTest : public testing::Test {
}
int pipefds_[2];
- scoped_ptr<MessageLoop> ui_loop_;
+ std::unique_ptr<MessageLoop> ui_loop_;
private:
Thread io_thread_;
@@ -95,7 +97,7 @@ TEST_F(MessagePumpLibeventTest, MAYBE_TestWatchingFromBadThread) {
}
TEST_F(MessagePumpLibeventTest, QuitOutsideOfRun) {
- scoped_ptr<MessagePumpLibevent> pump(new MessagePumpLibevent);
+ std::unique_ptr<MessagePumpLibevent> pump(new MessagePumpLibevent);
ASSERT_DEATH(pump->Quit(), "Check failed: in_run_. "
"Quit was called outside of Run!");
}
@@ -135,7 +137,7 @@ class DeleteWatcher : public BaseWatcher {
};
TEST_F(MessagePumpLibeventTest, DeleteWatcher) {
- scoped_ptr<MessagePumpLibevent> pump(new MessagePumpLibevent);
+ std::unique_ptr<MessagePumpLibevent> pump(new MessagePumpLibevent);
MessagePumpLibevent::FileDescriptorWatcher* watcher =
new MessagePumpLibevent::FileDescriptorWatcher;
DeleteWatcher delegate(watcher);
@@ -160,7 +162,7 @@ class StopWatcher : public BaseWatcher {
};
TEST_F(MessagePumpLibeventTest, StopWatcher) {
- scoped_ptr<MessagePumpLibevent> pump(new MessagePumpLibevent);
+ std::unique_ptr<MessagePumpLibevent> pump(new MessagePumpLibevent);
MessagePumpLibevent::FileDescriptorWatcher watcher;
StopWatcher delegate(&watcher);
pump->WatchFileDescriptor(pipefds_[1],
@@ -195,7 +197,7 @@ class NestedPumpWatcher : public MessagePumpLibevent::Watcher {
};
TEST_F(MessagePumpLibeventTest, NestedPumpWatcher) {
- scoped_ptr<MessagePumpLibevent> pump(new MessagePumpLibevent);
+ std::unique_ptr<MessagePumpLibevent> pump(new MessagePumpLibevent);
MessagePumpLibevent::FileDescriptorWatcher watcher;
NestedPumpWatcher delegate;
pump->WatchFileDescriptor(pipefds_[1],
@@ -242,12 +244,12 @@ TEST_F(MessagePumpLibeventTest, QuitWatcher) {
ui_loop_.reset();
MessagePumpLibevent* pump = new MessagePumpLibevent; // owned by |loop|.
- MessageLoop loop(make_scoped_ptr(pump));
+ MessageLoop loop(WrapUnique(pump));
RunLoop run_loop;
MessagePumpLibevent::FileDescriptorWatcher controller;
QuitWatcher delegate(&controller, &run_loop);
WaitableEvent event(false /* manual_reset */, false /* initially_signaled */);
- scoped_ptr<WaitableEventWatcher> watcher(new WaitableEventWatcher);
+ std::unique_ptr<WaitableEventWatcher> watcher(new WaitableEventWatcher);
// Tell the pump to watch the pipe.
pump->WatchFileDescriptor(pipefds_[0], false, MessagePumpLibevent::WATCH_READ,
« no previous file with comments | « base/message_loop/message_pump_libevent.cc ('k') | base/message_loop/message_pump_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698