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

Unified Diff: device/usb/usb_device_handle_unittest.cc

Issue 1874313002: Convert device 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 | « device/usb/usb_device_handle_impl.cc ('k') | device/usb/usb_device_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/usb_device_handle_unittest.cc
diff --git a/device/usb/usb_device_handle_unittest.cc b/device/usb/usb_device_handle_unittest.cc
index 84072dcddca0ab9e44f99d6afdbd546fd1d0969d..410f5ad73ace8f8b4777b43ff594a710bb2af5ad 100644
--- a/device/usb/usb_device_handle_unittest.cc
+++ b/device/usb/usb_device_handle_unittest.cc
@@ -2,8 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "device/usb/usb_device_handle.h"
+
#include <stddef.h>
+#include <memory>
+
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
@@ -12,7 +16,6 @@
#include "device/test/test_device_client.h"
#include "device/test/usb_test_gadget.h"
#include "device/usb/usb_device.h"
-#include "device/usb/usb_device_handle.h"
#include "net/base/io_buffer.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -29,11 +32,11 @@ class UsbDeviceHandleTest : public ::testing::Test {
}
protected:
- scoped_ptr<base::TestIOThread> io_thread_;
+ std::unique_ptr<base::TestIOThread> io_thread_;
private:
- scoped_ptr<base::MessageLoop> message_loop_;
- scoped_ptr<TestDeviceClient> device_client_;
+ std::unique_ptr<base::MessageLoop> message_loop_;
+ std::unique_ptr<TestDeviceClient> device_client_;
};
class TestOpenCallback {
@@ -118,7 +121,7 @@ TEST_F(UsbDeviceHandleTest, InterruptTransfer) {
return;
}
- scoped_ptr<UsbTestGadget> gadget =
+ std::unique_ptr<UsbTestGadget> gadget =
UsbTestGadget::Claim(io_thread_->task_runner());
ASSERT_TRUE(gadget.get());
ASSERT_TRUE(gadget->SetType(UsbTestGadget::ECHO));
@@ -186,7 +189,7 @@ TEST_F(UsbDeviceHandleTest, BulkTransfer) {
return;
}
- scoped_ptr<UsbTestGadget> gadget =
+ std::unique_ptr<UsbTestGadget> gadget =
UsbTestGadget::Claim(io_thread_->task_runner());
ASSERT_TRUE(gadget.get());
ASSERT_TRUE(gadget->SetType(UsbTestGadget::ECHO));
@@ -255,7 +258,7 @@ TEST_F(UsbDeviceHandleTest, SetInterfaceAlternateSetting) {
return;
}
- scoped_ptr<UsbTestGadget> gadget =
+ std::unique_ptr<UsbTestGadget> gadget =
UsbTestGadget::Claim(io_thread_->task_runner());
ASSERT_TRUE(gadget.get());
ASSERT_TRUE(gadget->SetType(UsbTestGadget::ECHO));
« no previous file with comments | « device/usb/usb_device_handle_impl.cc ('k') | device/usb/usb_device_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698