Index: content/browser/bluetooth/bluetooth_dispatcher_host.cc |
diff --git a/content/browser/bluetooth/bluetooth_dispatcher_host.cc b/content/browser/bluetooth/bluetooth_dispatcher_host.cc |
index 6212690f5d9b467d8f8cefcdf93149977b4d1ea6..b440cdb5c9e84bf16aafa96a7018164b9da9264b 100644 |
--- a/content/browser/bluetooth/bluetooth_dispatcher_host.cc |
+++ b/content/browser/bluetooth/bluetooth_dispatcher_host.cc |
@@ -50,26 +50,11 @@ |
IPC_BEGIN_MESSAGE_MAP(BluetoothDispatcherHost, message) |
IPC_MESSAGE_HANDLER(BluetoothHostMsg_RequestDevice, OnRequestDevice) |
IPC_MESSAGE_HANDLER(BluetoothHostMsg_ConnectGATT, OnConnectGATT) |
+ IPC_MESSAGE_HANDLER(BluetoothHostMsg_SetBluetoothMockDataSetForTesting, |
+ OnSetBluetoothMockDataSetForTesting) |
IPC_MESSAGE_UNHANDLED(handled = false) |
IPC_END_MESSAGE_MAP() |
return handled; |
-} |
- |
-void BluetoothDispatcherHost::SetBluetoothAdapterForTesting( |
- const std::string& name) { |
- DCHECK_CURRENTLY_ON(BrowserThread::UI); |
- if (name == "RejectRequestDevice_NotFoundError") { |
- bluetooth_mock_data_set_ = MockData::REJECT; |
- bluetooth_request_device_reject_type_ = BluetoothError::NOT_FOUND; |
- } else if (name == "RejectRequestDevice_SecurityError") { |
- bluetooth_mock_data_set_ = MockData::REJECT; |
- bluetooth_request_device_reject_type_ = BluetoothError::SECURITY; |
- } else if (name == "ResolveRequestDevice_Empty" || // TODO(scheib): Remove. |
- name == "Single Empty Device") { |
- bluetooth_mock_data_set_ = MockData::RESOLVE; |
- } else { |
- bluetooth_mock_data_set_ = MockData::NOT_MOCKING; |
- } |
} |
BluetoothDispatcherHost::~BluetoothDispatcherHost() { |
@@ -150,6 +135,23 @@ |
device_instance_id)); |
} |
+void BluetoothDispatcherHost::OnSetBluetoothMockDataSetForTesting( |
+ const std::string& name) { |
+ DCHECK_CURRENTLY_ON(BrowserThread::UI); |
+ if (name == "RejectRequestDevice_NotFoundError") { |
+ bluetooth_mock_data_set_ = MockData::REJECT; |
+ bluetooth_request_device_reject_type_ = BluetoothError::NOT_FOUND; |
+ } else if (name == "RejectRequestDevice_SecurityError") { |
+ bluetooth_mock_data_set_ = MockData::REJECT; |
+ bluetooth_request_device_reject_type_ = BluetoothError::SECURITY; |
+ } else if (name == "ResolveRequestDevice_Empty" || // TODO(scheib): Remove. |
+ name == "Single Empty Device") { |
+ bluetooth_mock_data_set_ = MockData::RESOLVE; |
+ } else { |
+ bluetooth_mock_data_set_ = MockData::NOT_MOCKING; |
+ } |
+} |
+ |
void BluetoothDispatcherHost::OnDiscoverySessionStarted( |
int thread_id, |
int request_id, |