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

Unified Diff: content/browser/bluetooth/bluetooth_dispatcher_host.cc

Issue 1142303002: Revert of bluetooth: Move testing IPC from BluetoothDispatcher to BlinkTestRunner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/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,
« no previous file with comments | « content/browser/bluetooth/bluetooth_dispatcher_host.h ('k') | content/browser/renderer_host/render_process_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698