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

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: https://codereview.chromium.org/1231883004 fixs runtime error. Created 5 years, 5 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 2805a6fb83563b62bbf72a2d15c7c319fa71b1c1..771876d368286e9de306ea630631f46088fb49a3 100644
--- a/device/bluetooth/bluetooth_adapter_unittest.cc
+++ b/device/bluetooth/bluetooth_adapter_unittest.cc
@@ -444,4 +444,28 @@ TEST_F(BluetoothTest, ConstructFakeAdapter) {
}
#endif // defined(OS_ANDROID)
+// 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 // defined(OS_ANDROID)
+
} // namespace device

Powered by Google App Engine
This is Rietveld 408576698