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

Unified Diff: chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_apitest.cc

Issue 501263002: Remove implicit conversions from scoped_refptr to T* in chrome/browser/extensions/api/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Just in case Created 6 years, 4 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: chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_apitest.cc
diff --git a/chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_apitest.cc b/chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_apitest.cc
index 186fb3891beb5b73d85e90c8321d20ea02078e4d..ac8e0f7f7f28fd06d3e9803d0a7c3eb652858b62 100644
--- a/chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_apitest.cc
+++ b/chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_apitest.cc
@@ -96,9 +96,9 @@ IN_PROC_BROWSER_TEST_F(BluetoothSocketApiTest, Connect) {
// Return the right mock device object for the address used by the test,
// return NULL for the "Device not found" test.
- EXPECT_CALL(*mock_adapter_, GetDevice(mock_device1_->GetAddress()))
+ EXPECT_CALL(*mock_adapter_.get(), GetDevice(mock_device1_->GetAddress()))
.WillRepeatedly(testing::Return(mock_device1_.get()));
- EXPECT_CALL(*mock_adapter_, GetDevice(std::string("aa:aa:aa:aa:aa:aa")))
+ EXPECT_CALL(*mock_adapter_.get(), GetDevice(std::string("aa:aa:aa:aa:aa:aa")))
.WillOnce(testing::Return(static_cast<BluetoothDevice*>(NULL)));
// Return a mock socket object as a successful result to the connect() call.
@@ -111,12 +111,12 @@ IN_PROC_BROWSER_TEST_F(BluetoothSocketApiTest, Connect) {
// Since the socket is unpaused, expect a call to Receive() from the socket
// dispatcher. Since there is no data, this will not call its callback.
- EXPECT_CALL(*mock_socket, Receive(testing::_, testing::_, testing::_));
+ EXPECT_CALL(*mock_socket.get(), Receive(testing::_, testing::_, testing::_));
// The test also cleans up by calling Disconnect and Close.
- EXPECT_CALL(*mock_socket, Disconnect(testing::_))
+ EXPECT_CALL(*mock_socket.get(), Disconnect(testing::_))
.WillOnce(InvokeCallbackArgument<0>());
- EXPECT_CALL(*mock_socket, Close());
+ EXPECT_CALL(*mock_socket.get(), Close());
// Run the test.
ExtensionTestMessageListener listener("ready", true);
@@ -147,13 +147,13 @@ IN_PROC_BROWSER_TEST_F(BluetoothSocketApiTest, MAYBE_Listen) {
BluetoothAdapter::ServiceOptions service_options;
service_options.name.reset(new std::string("MyServiceName"));
EXPECT_CALL(
- *mock_adapter_,
+ *mock_adapter_.get(),
CreateRfcommService(
service_uuid,
testing::Field(&BluetoothAdapter::ServiceOptions::name,
testing::Pointee(testing::Eq("MyServiceName"))),
- testing::_, testing::_))
- .WillOnce(InvokeCallbackArgument<2>(mock_server_socket));
+ testing::_,
+ testing::_)).WillOnce(InvokeCallbackArgument<2>(mock_server_socket));
// Since the socket is unpaused, expect a call to Accept() from the socket
// dispatcher. We'll immediately send back another mock socket to represent
@@ -161,10 +161,10 @@ IN_PROC_BROWSER_TEST_F(BluetoothSocketApiTest, MAYBE_Listen) {
// pending.
scoped_refptr<testing::StrictMock<MockBluetoothSocket> > mock_client_socket
= new testing::StrictMock<MockBluetoothSocket>();
- EXPECT_CALL(*mock_server_socket, Accept(testing::_, testing::_))
+ EXPECT_CALL(*mock_server_socket.get(), Accept(testing::_, testing::_))
.Times(2)
- .WillOnce(InvokeCallbackArgument<0>(mock_device1_.get(),
- mock_client_socket))
+ .WillOnce(
+ InvokeCallbackArgument<0>(mock_device1_.get(), mock_client_socket))
.WillOnce(testing::Return());
// Run the test, it sends a ready signal once it's ready for us to dispatch
@@ -184,13 +184,13 @@ IN_PROC_BROWSER_TEST_F(BluetoothSocketApiTest, MAYBE_Listen) {
// Second stage of tests checks for error conditions, and will clean up
// the existing server and client sockets.
- EXPECT_CALL(*mock_server_socket, Disconnect(testing::_))
+ EXPECT_CALL(*mock_server_socket.get(), Disconnect(testing::_))
.WillOnce(InvokeCallbackArgument<0>());
- EXPECT_CALL(*mock_server_socket, Close());
+ EXPECT_CALL(*mock_server_socket.get(), Close());
- EXPECT_CALL(*mock_client_socket, Disconnect(testing::_))
+ EXPECT_CALL(*mock_client_socket.get(), Disconnect(testing::_))
.WillOnce(InvokeCallbackArgument<0>());
- EXPECT_CALL(*mock_client_socket, Close());
+ EXPECT_CALL(*mock_client_socket.get(), Close());
EXPECT_TRUE(listener.WaitUntilSatisfied());
listener.Reply("go");

Powered by Google App Engine
This is Rietveld 408576698