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

Unified Diff: device/bluetooth/bluetooth_adapter_unittest.cc

Issue 1150833002: bluetooth: android: Initial Low Energy Discovery Sessions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bta-manifest-
Patch Set: Add tests Created 5 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
Index: device/bluetooth/bluetooth_adapter_unittest.cc
diff --git a/device/bluetooth/bluetooth_adapter_unittest.cc b/device/bluetooth/bluetooth_adapter_unittest.cc
index 0719135aadf1dc44d56c90ebc727b5d0f65c296b..3170d3d6932891f248bc6d49fa3a1a635820de8c 100644
--- a/device/bluetooth/bluetooth_adapter_unittest.cc
+++ b/device/bluetooth/bluetooth_adapter_unittest.cc
@@ -444,4 +444,28 @@ TEST_F(BluetoothTest, ConstructFakeAdapter) {
}
#endif
+// TODO(scheib): Enable BluetoothTest fixture tests on all platforms.
+#if defined(OS_ANDROID)
+TEST_F(BluetoothTest, DiscoverySession) {
+ InitWithFakeAdapter();
+ EXPECT_FALSE(adapter_->IsDiscovering());
+
+ adapter_->StartDiscoverySession(GetDiscoverySessionCallback(),
+ GetErrorCallback());
+ base::RunLoop().RunUntilIdle();
+ EXPECT_EQ(1, callback_count_--);
+ EXPECT_EQ(0, error_callback_count_);
+ EXPECT_TRUE(adapter_->IsDiscovering());
+ ASSERT_EQ((size_t)1, discovery_sessions_.size());
+ EXPECT_TRUE(discovery_sessions_[0]->IsActive());
+
+ discovery_sessions_[0]->Stop(GetCallback(), GetErrorCallback());
+ base::RunLoop().RunUntilIdle();
+ EXPECT_EQ(1, callback_count_--);
+ EXPECT_EQ(0, error_callback_count_);
+ EXPECT_FALSE(adapter_->IsDiscovering());
+ EXPECT_FALSE(discovery_sessions_[0]->IsActive());
+}
+#endif
armansito 2015/06/30 20:52:14 #endif // defined(OS_ANDROID)
+
} // namespace device

Powered by Google App Engine
This is Rietveld 408576698