Commit c54ba227 authored by Reilly Grant's avatar Reilly Grant Committed by Commit Bot

[bluetooth] Fix BluetoothTest.ConstructDefaultAdapter on macOS

This test became flaky on macOS after r763057 because the code to
initialize the adapter when calling BluetoothTest::WithDefaultAdapter()
was accidentally removed on macOS. This patch restores this logic,
copying what is done on other platforms.

Bug: 1076005
Change-Id: If709274183b668022d55c69f8b9d2a09a9c7dd1a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2171442
Auto-Submit: Reilly Grant <reillyg@chromium.org>
Reviewed-by: default avatarOvidio de Jesús Ruiz-Henríquez <odejesush@chromium.org>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#763587}
parent 9b0d8ba2
......@@ -691,8 +691,7 @@ TEST_F(BluetoothAdapterTest, StartDiscoverySessionError_Destroy) {
}
// TODO(scheib): Enable BluetoothTest fixture tests on all platforms.
// TODO(https://crbug.com/1076005) Flaky on Mac
#if defined(OS_ANDROID)
#if defined(OS_ANDROID) || defined(OS_MACOSX)
#define MAYBE_ConstructDefaultAdapter ConstructDefaultAdapter
#else
#define MAYBE_ConstructDefaultAdapter DISABLED_ConstructDefaultAdapter
......
......@@ -111,6 +111,10 @@ void BluetoothTestMac::InitWithDefaultAdapter() {
auto adapter = BluetoothAdapterMac::CreateAdapter();
adapter_mac_ = adapter.get();
adapter_ = std::move(adapter);
base::RunLoop run_loop;
adapter_->Initialize(run_loop.QuitClosure());
run_loop.Run();
}
void BluetoothTestMac::InitWithoutDefaultAdapter() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment