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

Unified Diff: content/shell/renderer/layout_test/blink_test_runner.cc

Issue 1815483003: bluetooth: Create Mojo equivalent of SetBluetoothMockDataSet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-mojo
Patch Set: Add gyp Created 4 years, 9 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: content/shell/renderer/layout_test/blink_test_runner.cc
diff --git a/content/shell/renderer/layout_test/blink_test_runner.cc b/content/shell/renderer/layout_test/blink_test_runner.cc
index 147d4d70dd3a497f02cd0ec42694613051ce0de6..e1794f0719f3cdf72ff33450127bf41f0371d5e1 100644
--- a/content/shell/renderer/layout_test/blink_test_runner.cc
+++ b/content/shell/renderer/layout_test/blink_test_runner.cc
@@ -41,6 +41,7 @@
#include "components/test_runner/web_test_proxy.h"
#include "components/test_runner/web_test_runner.h"
#include "content/public/common/content_switches.h"
+#include "content/public/common/service_registry.h"
#include "content/public/common/url_constants.h"
#include "content/public/common/web_preferences.h"
#include "content/public/renderer/media_stream_api.h"
@@ -529,6 +530,11 @@ void BlinkTestRunner::SetBluetoothMockDataSet(const std::string& name) {
Send(new ShellViewHostMsg_SetBluetoothManualChooser(routing_id(), false));
}
+void BlinkTestRunner::SetBluetoothFakeAdapter(const std::string& adapter_name,
+ const base::Closure& callback) {
+ GetBluetoothFakeAdapterSetter()->Set(adapter_name, callback);
+}
+
void BlinkTestRunner::SetBluetoothManualChooser() {
Send(new ShellViewHostMsg_SetBluetoothManualChooser(routing_id(), true));
}
@@ -998,6 +1004,15 @@ void BlinkTestRunner::CaptureDumpComplete() {
new ShellViewHostMsg_TestFinished(routing_id())));
}
+mojom::LayoutTestBluetoothFakeAdapterSetterPtr&
+BlinkTestRunner::GetBluetoothFakeAdapterSetter() {
+ if (!bluetooth_fake_adapter_setter_) {
+ RenderThread::Get()->GetServiceRegistry()->ConnectToRemoteService(
+ mojo::GetProxy(&bluetooth_fake_adapter_setter_));
+ }
+ return bluetooth_fake_adapter_setter_;
+}
+
void BlinkTestRunner::OnReplicateTestConfiguration(
const ShellTestConfiguration& params) {
test_config_ = params;

Powered by Google App Engine
This is Rietveld 408576698