bluetooth: Create Mojo equivalent of SetBluetoothMockDataSet
Adds setBluetoothFakeAdapter to testRunner in order to set the
fake adapter on the browser side. Also removes the old SetBluetoothMockDataSet.
Since Web Bluetooth is transitioning to Mojo it can no longer rely
on IPC::Message's ordering to set fake adapters. This is because there are
no order guarantees between IPC::Message and Mojo and even between
Mojo pipes. For this reason we introduce a new function that takes
a callback that is run when the adapter has been set on the browser.
Since IPC::Message is deprecated this new function uses Mojo to communicate
with the browser.
BUG=508771
Review URL: https://codereview.chromium.org/1815483003
Cr-Commit-Position: refs/heads/master@{#384350}
diff --git a/content/shell/BUILD.gn b/content/shell/BUILD.gn
index 4fd4c916..b6d07f39 100644
--- a/content/shell/BUILD.gn
+++ b/content/shell/BUILD.gn
@@ -8,6 +8,7 @@
import("//build/config/win/console_app.gni")
import("//build/config/win/manifest.gni")
import("//media/media_options.gni")
+import("//mojo/public/tools/bindings/mojom.gni")
import("//tools/grit/repack.gni")
import("//tools/grit/grit_rule.gni")
if (is_android) {
@@ -55,6 +56,8 @@
"browser/layout_test/layout_test_bluetooth_adapter_provider.h",
"browser/layout_test/layout_test_bluetooth_chooser_factory.cc",
"browser/layout_test/layout_test_bluetooth_chooser_factory.h",
+ "browser/layout_test/layout_test_bluetooth_fake_adapter_setter_impl.cc",
+ "browser/layout_test/layout_test_bluetooth_fake_adapter_setter_impl.h",
"browser/layout_test/layout_test_browser_context.cc",
"browser/layout_test/layout_test_browser_context.h",
"browser/layout_test/layout_test_browser_main.cc",
@@ -204,6 +207,7 @@
"//content/public/utility",
]
deps = [
+ ":mojo_bindings",
":resources",
"//base",
"//base:base_static",
@@ -530,3 +534,9 @@
]
}
}
+
+mojom("mojo_bindings") {
+ sources = [
+ "common/layout_test/layout_test_bluetooth_fake_adapter_setter.mojom",
+ ]
+}