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

Unified Diff: extensions/browser/api/bluetooth/bluetooth_private_apitest.cc

Issue 819713002: bluetoothPrivate: Add disconnectAll function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ran update_extension_functions.py Created 6 years 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: extensions/browser/api/bluetooth/bluetooth_private_apitest.cc
diff --git a/extensions/browser/api/bluetooth/bluetooth_private_apitest.cc b/extensions/browser/api/bluetooth/bluetooth_private_apitest.cc
index 1fad1d45d10c65b98e8eccd849f7d2f5f9b5f8b0..666721154492e9dc5bcce54e3a3ef185074ccdc4 100644
--- a/extensions/browser/api/bluetooth/bluetooth_private_apitest.cc
+++ b/extensions/browser/api/bluetooth/bluetooth_private_apitest.cc
@@ -120,6 +120,12 @@ class BluetoothPrivateApiTest : public ExtensionApiTest {
scoped_ptr<NiceMock<MockBluetoothDevice> > mock_device_;
};
+ACTION_TEMPLATE(InvokeCallbackArgument,
+ HAS_1_TEMPLATE_PARAMS(int, k),
+ AND_0_VALUE_PARAMS()) {
+ ::std::tr1::get<k>(args).Run();
+}
+
IN_PROC_BROWSER_TEST_F(BluetoothPrivateApiTest, SetAdapterState) {
ON_CALL(*mock_adapter_.get(), GetName())
.WillByDefault(ReturnPointee(&adapter_name_));
@@ -183,4 +189,17 @@ IN_PROC_BROWSER_TEST_F(BluetoothPrivateApiTest, PasskeyPairing) {
<< message_;
}
+IN_PROC_BROWSER_TEST_F(BluetoothPrivateApiTest, Disconnect) {
+ EXPECT_CALL(*mock_device_, IsConnected())
+ .Times(3)
+ .WillOnce(Return(false))
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_device_, Disconnect(_, _))
+ .Times(2)
+ .WillOnce(InvokeCallbackArgument<1>())
+ .WillOnce(InvokeCallbackArgument<0>());
+ ASSERT_TRUE(RunComponentExtensionTest("bluetooth_private/disconnect"))
+ << message_;
+}
+
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698