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

Unified Diff: device/bluetooth/bluetooth_profile_chromeos_unittest.cc

Issue 16998003: Update CrOS to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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/bluetooth/bluetooth_profile_chromeos.cc ('k') | ui/aura/bench/bench_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_profile_chromeos_unittest.cc
diff --git a/device/bluetooth/bluetooth_profile_chromeos_unittest.cc b/device/bluetooth/bluetooth_profile_chromeos_unittest.cc
index 271fe46e813e579849101e7b3099ba4e32161e3d..b59a6353222788868707ab27ed561475a26099d6 100644
--- a/device/bluetooth/bluetooth_profile_chromeos_unittest.cc
+++ b/device/bluetooth/bluetooth_profile_chromeos_unittest.cc
@@ -48,7 +48,7 @@ class BluetoothProfileChromeOSTest : public testing::Test {
device::BluetoothAdapterFactory::GetAdapter(
base::Bind(&BluetoothProfileChromeOSTest::AdapterCallback,
base::Unretained(this)));
- ASSERT_TRUE(adapter_ != NULL);
+ ASSERT_TRUE(adapter_.get() != NULL);
ASSERT_TRUE(adapter_->IsInitialized());
ASSERT_TRUE(adapter_->IsPresent());
@@ -171,7 +171,7 @@ TEST_F(BluetoothProfileChromeOSTest, L2capEndToEnd) {
// Read data from the socket; since no data should be waiting, this should
// return success but no data.
read_buffer = new net::GrowableIOBuffer;
- success = socket->Receive(read_buffer);
+ success = socket->Receive(read_buffer.get());
EXPECT_TRUE(success);
EXPECT_EQ(0, read_buffer->capacity());
EXPECT_EQ(0, read_buffer->offset());
@@ -179,8 +179,9 @@ TEST_F(BluetoothProfileChromeOSTest, L2capEndToEnd) {
// Write data to the socket; the data should be consumed and no bytes should
// be remaining.
- write_buffer = new net::DrainableIOBuffer(base_buffer, base_buffer->size());
- success = socket->Send(write_buffer);
+ write_buffer =
+ new net::DrainableIOBuffer(base_buffer.get(), base_buffer->size());
+ success = socket->Send(write_buffer.get());
EXPECT_TRUE(success);
EXPECT_EQ(base_buffer->size(), write_buffer->BytesConsumed());
EXPECT_EQ(0, write_buffer->BytesRemaining());
@@ -191,7 +192,7 @@ TEST_F(BluetoothProfileChromeOSTest, L2capEndToEnd) {
// to read.
read_buffer = new net::GrowableIOBuffer;
do {
- success = socket->Receive(read_buffer);
+ success = socket->Receive(read_buffer.get());
} while (success && read_buffer->offset() == 0);
EXPECT_TRUE(success);
EXPECT_NE(0, read_buffer->capacity());
@@ -204,8 +205,9 @@ TEST_F(BluetoothProfileChromeOSTest, L2capEndToEnd) {
// Write data to the socket; since the socket is closed, this should return
// an error without writing the data and "Disconnected" as the message.
- write_buffer = new net::DrainableIOBuffer(base_buffer, base_buffer->size());
- success = socket->Send(write_buffer);
+ write_buffer =
+ new net::DrainableIOBuffer(base_buffer.get(), base_buffer->size());
+ success = socket->Send(write_buffer.get());
EXPECT_FALSE(success);
EXPECT_EQ(0, write_buffer->BytesConsumed());
EXPECT_EQ(base_buffer->size(), write_buffer->BytesRemaining());
@@ -214,7 +216,7 @@ TEST_F(BluetoothProfileChromeOSTest, L2capEndToEnd) {
// Read data from the socket; since the socket is closed, this should return
// an error with "Disconnected" as the last message.
read_buffer = new net::GrowableIOBuffer;
- success = socket->Receive(read_buffer);
+ success = socket->Receive(read_buffer.get());
EXPECT_FALSE(success);
EXPECT_EQ(0, read_buffer->capacity());
EXPECT_EQ(0, read_buffer->offset());
@@ -295,15 +297,16 @@ TEST_F(BluetoothProfileChromeOSTest, RfcommEndToEnd) {
// Read data from the socket; since no data should be waiting, this should
// return success but no data.
read_buffer = new net::GrowableIOBuffer;
- success = socket->Receive(read_buffer);
+ success = socket->Receive(read_buffer.get());
EXPECT_TRUE(success);
EXPECT_EQ(0, read_buffer->offset());
EXPECT_EQ("", socket->GetLastErrorMessage());
// Write data to the socket; the data should be consumed and no bytes should
// be remaining.
- write_buffer = new net::DrainableIOBuffer(base_buffer, base_buffer->size());
- success = socket->Send(write_buffer);
+ write_buffer =
+ new net::DrainableIOBuffer(base_buffer.get(), base_buffer->size());
+ success = socket->Send(write_buffer.get());
EXPECT_TRUE(success);
EXPECT_EQ(base_buffer->size(), write_buffer->BytesConsumed());
EXPECT_EQ(0, write_buffer->BytesRemaining());
@@ -314,7 +317,7 @@ TEST_F(BluetoothProfileChromeOSTest, RfcommEndToEnd) {
// to read.
read_buffer = new net::GrowableIOBuffer;
do {
- success = socket->Receive(read_buffer);
+ success = socket->Receive(read_buffer.get());
} while (success && read_buffer->offset() == 0);
EXPECT_TRUE(success);
EXPECT_NE(0, read_buffer->capacity());
@@ -327,8 +330,9 @@ TEST_F(BluetoothProfileChromeOSTest, RfcommEndToEnd) {
// Write data to the socket; since the socket is closed, this should return
// an error without writing the data and "Disconnected" as the message.
- write_buffer = new net::DrainableIOBuffer(base_buffer, base_buffer->size());
- success = socket->Send(write_buffer);
+ write_buffer =
+ new net::DrainableIOBuffer(base_buffer.get(), base_buffer->size());
+ success = socket->Send(write_buffer.get());
EXPECT_FALSE(success);
EXPECT_EQ(0, write_buffer->BytesConsumed());
EXPECT_EQ(base_buffer->size(), write_buffer->BytesRemaining());
@@ -337,7 +341,7 @@ TEST_F(BluetoothProfileChromeOSTest, RfcommEndToEnd) {
// Read data from the socket; since the socket is closed, this should return
// an error with "Disconnected" as the last message.
read_buffer = new net::GrowableIOBuffer;
- success = socket->Receive(read_buffer);
+ success = socket->Receive(read_buffer.get());
EXPECT_FALSE(success);
EXPECT_EQ(0, read_buffer->offset());
EXPECT_EQ("Disconnected", socket->GetLastErrorMessage());
« no previous file with comments | « device/bluetooth/bluetooth_profile_chromeos.cc ('k') | ui/aura/bench/bench_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698