Index: chrome/browser/extensions/api/bluetooth/bluetooth_apitest.cc |
diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_apitest.cc b/chrome/browser/extensions/api/bluetooth/bluetooth_apitest.cc |
index cbd4043d6344bb2266996b192009d498054d05ee..1dc82bc090a802ae75c69e9d677c962bf84145f8 100644 |
--- a/chrome/browser/extensions/api/bluetooth/bluetooth_apitest.cc |
+++ b/chrome/browser/extensions/api/bluetooth/bluetooth_apitest.cc |
@@ -101,8 +101,11 @@ class BluetoothApiTest : public ExtensionApiTest { |
scoped_ptr<testing::NiceMock<MockBluetoothProfile> > profile2_; |
extensions::ExtensionBluetoothEventRouter* event_router() { |
- return extensions::BluetoothAPI::Get(browser()->profile()) |
- ->bluetooth_event_router(); |
+ return bluetooth_api()->event_router(); |
+ } |
+ |
+ extensions::BluetoothAPI* bluetooth_api() { |
+ return extensions::BluetoothAPI::Get(browser()->profile()); |
} |
private: |
@@ -150,6 +153,11 @@ static bool CallClosure(const base::Closure& callback) { |
return true; |
} |
+static bool CallErrorClosure(const BluetoothDevice::ErrorCallback& callback) { |
+ callback.Run("<error>"); |
+ return true; |
+} |
+ |
static void StopDiscoverySessionCallback(const base::Closure& callback, |
const base::Closure& error_callback) { |
callback.Run(); |
@@ -314,9 +322,9 @@ IN_PROC_BROWSER_TEST_F(BluetoothApiTest, SetOutOfBandPairingData) { |
testing::Mock::VerifyAndClearExpectations(device1_.get()); |
EXPECT_CALL(*mock_adapter_, GetDevice(device1_->GetAddress())) |
.WillOnce(testing::Return(device1_.get())); |
- EXPECT_CALL(*device1_, |
- ClearOutOfBandPairingData(testing::_, |
- testing::Truly(CallClosure))); |
+ EXPECT_CALL( |
+ *device1_, |
+ ClearOutOfBandPairingData(testing::_, testing::Truly(CallErrorClosure))); |
set_oob_function = setupFunction( |
new api::BluetoothSetOutOfBandPairingDataFunction); |
@@ -559,7 +567,7 @@ IN_PROC_BROWSER_TEST_F(BluetoothApiTest, OnConnection) { |
new device::MockBluetoothSocket(); |
event_router()->AddProfile("1234", extension->id(), profile1_.get()); |
- event_router()->DispatchConnectionEvent( |
+ bluetooth_api()->DispatchConnectionEvent( |
extension->id(), "1234", device1_.get(), socket); |
listener.Reply("go"); |