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

Unified Diff: device/bluetooth/bluetooth_socket_chromeos_unittest.cc

Issue 868753006: Revert of Manage profiles in BluetoothAdapter on ChromeOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « device/bluetooth/bluetooth_socket_chromeos.cc ('k') | device/device_tests.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_socket_chromeos_unittest.cc
diff --git a/device/bluetooth/bluetooth_socket_chromeos_unittest.cc b/device/bluetooth/bluetooth_socket_chromeos_unittest.cc
index 79d43ae8bb5f25d5cd67d181ba018614a8c4d18e..1a4aa96853b9937e6bcf82ae6a04dd853112ebc7 100644
--- a/device/bluetooth/bluetooth_socket_chromeos_unittest.cc
+++ b/device/bluetooth/bluetooth_socket_chromeos_unittest.cc
@@ -12,7 +12,6 @@
#include "chromeos/dbus/fake_bluetooth_gatt_service_client.h"
#include "chromeos/dbus/fake_bluetooth_input_client.h"
#include "chromeos/dbus/fake_bluetooth_profile_manager_client.h"
-#include "chromeos/dbus/fake_bluetooth_profile_service_provider.h"
#include "device/bluetooth/bluetooth_adapter.h"
#include "device/bluetooth/bluetooth_adapter_chromeos.h"
#include "device/bluetooth/bluetooth_adapter_factory.h"
@@ -145,9 +144,6 @@
void CreateServiceSuccessCallback(scoped_refptr<BluetoothSocket> socket) {
++success_callback_count_;
last_socket_ = socket;
-
- if (message_loop_.is_running())
- message_loop_.Quit();
}
void AcceptSuccessCallback(const BluetoothDevice* device,
@@ -191,6 +187,7 @@
base::Unretained(this)),
base::Bind(&BluetoothSocketChromeOSTest::ErrorCallback,
base::Unretained(this)));
+
message_loop_.Run();
EXPECT_EQ(1U, success_callback_count_);
@@ -299,8 +296,6 @@
base::Unretained(this)),
base::Bind(&BluetoothSocketChromeOSTest::ErrorCallback,
base::Unretained(this)));
-
- message_loop_.Run();
EXPECT_EQ(1U, success_callback_count_);
EXPECT_EQ(0U, error_callback_count_);
@@ -330,8 +325,6 @@
base::Bind(&base::DoNothing),
base::Bind(&DoNothingDBusErrorCallback));
- message_loop_.RunUntilIdle();
-
server_socket->Accept(
base::Bind(&BluetoothSocketChromeOSTest::AcceptSuccessCallback,
base::Unretained(this)),
@@ -369,8 +362,6 @@
base::Unretained(this)),
base::Bind(&BluetoothSocketChromeOSTest::ErrorCallback,
base::Unretained(this)));
-
- message_loop_.RunUntilIdle();
fake_bluetooth_device_client->ConnectProfile(
static_cast<BluetoothDeviceChromeOS*>(device)->object_path(),
@@ -406,8 +397,6 @@
server_socket->Disconnect(
base::Bind(&BluetoothSocketChromeOSTest::ImmediateSuccessCallback,
base::Unretained(this)));
-
- message_loop_.RunUntilIdle();
EXPECT_EQ(1U, success_callback_count_);
}
@@ -427,7 +416,6 @@
base::Unretained(this)),
base::Bind(&BluetoothSocketChromeOSTest::ErrorCallback,
base::Unretained(this)));
- message_loop_.Run();
EXPECT_EQ(1U, success_callback_count_);
EXPECT_EQ(0U, error_callback_count_);
@@ -451,8 +439,6 @@
// Make the adapter visible. This should register a profile.
fake_bluetooth_adapter_client->SetVisible(true);
- message_loop_.RunUntilIdle();
-
profile_service_provider =
fake_bluetooth_profile_manager_client->GetProfileServiceProvider(
FakeBluetoothProfileManagerClient::kRfcommUuid);
@@ -462,8 +448,6 @@
socket->Disconnect(
base::Bind(&BluetoothSocketChromeOSTest::ImmediateSuccessCallback,
base::Unretained(this)));
-
- message_loop_.RunUntilIdle();
EXPECT_EQ(1U, success_callback_count_);
}
@@ -481,7 +465,6 @@
base::Unretained(this)),
base::Bind(&BluetoothSocketChromeOSTest::ErrorCallback,
base::Unretained(this)));
- message_loop_.Run();
EXPECT_EQ(1U, success_callback_count_);
EXPECT_EQ(0U, error_callback_count_);
@@ -505,13 +488,13 @@
// Make the adapter invisible, and fiddle with the profile fake to unregister
// the profile since this doesn't happen automatically.
fake_bluetooth_adapter_client->SetVisible(false);
-
- message_loop_.RunUntilIdle();
+ fake_bluetooth_profile_manager_client->UnregisterProfile(
+ static_cast<BluetoothSocketChromeOS*>(socket.get())->object_path(),
+ base::Bind(&base::DoNothing),
+ base::Bind(&DoNothingDBusErrorCallback));
// Then make the adapter visible again. This should re-register the profile.
fake_bluetooth_adapter_client->SetVisible(true);
-
- message_loop_.RunUntilIdle();
profile_service_provider =
fake_bluetooth_profile_manager_client->GetProfileServiceProvider(
@@ -523,8 +506,6 @@
base::Bind(&BluetoothSocketChromeOSTest::ImmediateSuccessCallback,
base::Unretained(this)));
- message_loop_.RunUntilIdle();
-
EXPECT_EQ(1U, success_callback_count_);
}
« no previous file with comments | « device/bluetooth/bluetooth_socket_chromeos.cc ('k') | device/device_tests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698