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

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

Issue 1125133005: bluetooth: Move testing IPC from BluetoothDispatcher to BlinkTestRunner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for stable release mode tests 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 b440cdb5c9e84bf16aafa96a7018164b9da9264b..6212690f5d9b467d8f8cefcdf93149977b4d1ea6 100644
--- a/content/browser/bluetooth/bluetooth_dispatcher_host.cc
+++ b/content/browser/bluetooth/bluetooth_dispatcher_host.cc
@@ -50,13 +50,28 @@ bool BluetoothDispatcherHost::OnMessageReceived(const IPC::Message& message) {
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() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Clear adapter, releasing observer references.
@@ -135,23 +150,6 @@ void BluetoothDispatcherHost::OnConnectGATT(
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,

Powered by Google App Engine
This is Rietveld 408576698