 Chromium Code Reviews
 Chromium Code Reviews Issue 1815483003:
  bluetooth: Create Mojo equivalent of SetBluetoothMockDataSet  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-mojo
    
  
    Issue 1815483003:
  bluetooth: Create Mojo equivalent of SetBluetoothMockDataSet  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-mojo| 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 bb75f498779512d8664fc2b617a8f695d4fd3277..04370392d0e84cf37f0ab93086b06ac25bc7841b 100644 | 
| --- a/content/shell/renderer/layout_test/blink_test_runner.cc | 
| +++ b/content/shell/renderer/layout_test/blink_test_runner.cc | 
| @@ -34,6 +34,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_utils.h" | 
| @@ -479,15 +480,13 @@ void BlinkTestRunner::SetDeviceColorProfile(const std::string& name) { | 
| content::SetDeviceColorProfile(render_view(), name); | 
| } | 
| -void BlinkTestRunner::SetBluetoothMockDataSet(const std::string& name) { | 
| - Send(new LayoutTestHostMsg_SetBluetoothAdapter(name)); | 
| - // Auto-reset the chooser type so we don't get order dependence when some | 
| - // tests forget to do it explicitly. | 
| - 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)); | 
| +void BlinkTestRunner::SetBluetoothManualChooser(bool enable) { | 
| + Send(new ShellViewHostMsg_SetBluetoothManualChooser(routing_id(), enable)); | 
| } | 
| void BlinkTestRunner::GetBluetoothManualChooserEvents( | 
| @@ -945,6 +944,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_; | 
| 
Ken Rockot(use gerrit already)
2016/03/29 20:53:23
nit: I think it's weird to return a reference to a
 
ortuno
2016/03/29 21:17:04
Ha. Makes sense. I saw VR doing the same so I just
 
Jeffrey Yasskin
2016/03/29 22:19:10
Or, since this can never return null, return the m
 
ortuno
2016/03/29 22:30:53
Done.
 | 
| +} | 
| + | 
| void BlinkTestRunner::OnReplicateTestConfiguration( | 
| const ShellTestConfiguration& params) { | 
| test_config_ = params; |