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

Unified Diff: chrome/browser/extensions/api/bluetooth/bluetooth_apitest_chromeos.cc

Issue 11075006: Moved bluetooth adapter files to device/bluetooth/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing try bot failures. Created 8 years, 2 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: chrome/browser/extensions/api/bluetooth/bluetooth_apitest_chromeos.cc
diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_apitest_chromeos.cc b/chrome/browser/extensions/api/bluetooth/bluetooth_apitest_chromeos.cc
index 696f617cb66c693835d345c250c04815244b225a..3f25c006e1dafbc9c3fada9bcc66db198656215b 100644
--- a/chrome/browser/extensions/api/bluetooth/bluetooth_apitest_chromeos.cc
+++ b/chrome/browser/extensions/api/bluetooth/bluetooth_apitest_chromeos.cc
@@ -4,21 +4,25 @@
#include <string.h>
-#include "chrome/browser/chromeos/bluetooth/bluetooth_adapter.h"
-#include "chrome/browser/chromeos/bluetooth/test/mock_bluetooth_adapter.h"
-#include "chrome/browser/chromeos/bluetooth/test/mock_bluetooth_device.h"
-#include "chrome/browser/chromeos/extensions/bluetooth_event_router.h"
#include "chrome/browser/extensions/api/bluetooth/bluetooth_api.h"
+#include "chrome/browser/extensions/bluetooth_event_router.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/extensions/extension_function_test_utils.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_test_message_listener.h"
#include "chrome/browser/ui/browser.h"
-#include "chromeos/dbus/bluetooth_out_of_band_client.h"
-#include "chromeos/dbus/bluetooth_out_of_band_pairing_data.h"
#include "chrome/test/base/ui_test_utils.h"
+#include "device/bluetooth/bluetooth_adapter.h"
+#include "device/bluetooth/bluetooth_out_of_band_pairing_data.h"
+#include "device/bluetooth/test/mock_bluetooth_adapter.h"
+#include "device/bluetooth/test/mock_bluetooth_device.h"
#include "testing/gmock/include/gmock/gmock.h"
+using bluetooth::BluetoothAdapter;
+using bluetooth::BluetoothDevice;
+using bluetooth::BluetoothOutOfBandPairingData;
+using bluetooth::MockBluetoothAdapter;
+using bluetooth::MockBluetoothDevice;
using extensions::Extension;
namespace utils = extension_function_test_utils;
@@ -35,14 +39,14 @@ class BluetoothApiTest : public PlatformAppApiTest {
virtual void SetUpOnMainThread() OVERRIDE {
// The browser will clean this up when it is torn down
- mock_adapter_ = new testing::StrictMock<chromeos::MockBluetoothAdapter>(
+ mock_adapter_ = new testing::StrictMock<MockBluetoothAdapter>(
kAdapterAddress, kName);
event_router()->SetAdapterForTest(mock_adapter_);
- device1_.reset(new testing::NiceMock<chromeos::MockBluetoothDevice>(
+ device1_.reset(new testing::NiceMock<MockBluetoothDevice>(
mock_adapter_, "d1", "11:12:13:14:15:16",
true /* paired */, false /* bonded */, true /* connected */));
- device2_.reset(new testing::NiceMock<chromeos::MockBluetoothDevice>(
+ device2_.reset(new testing::NiceMock<MockBluetoothDevice>(
mock_adapter_, "d2", "21:22:23:24:25:26",
false /* paired */, true /* bonded */, false /* connected */));
}
@@ -81,11 +85,11 @@ class BluetoothApiTest : public PlatformAppApiTest {
}
protected:
- testing::StrictMock<chromeos::MockBluetoothAdapter>* mock_adapter_;
- scoped_ptr<testing::NiceMock<chromeos::MockBluetoothDevice> > device1_;
- scoped_ptr<testing::NiceMock<chromeos::MockBluetoothDevice> > device2_;
+ testing::StrictMock<MockBluetoothAdapter>* mock_adapter_;
+ scoped_ptr<testing::NiceMock<MockBluetoothDevice> > device1_;
+ scoped_ptr<testing::NiceMock<MockBluetoothDevice> > device2_;
- chromeos::ExtensionBluetoothEventRouter* event_router() {
+ extensions::ExtensionBluetoothEventRouter* event_router() {
return browser()->profile()->GetExtensionService()->
bluetooth_event_router();
}
@@ -98,12 +102,12 @@ class BluetoothApiTest : public PlatformAppApiTest {
static const char kOutOfBandPairingDataHash[] = "0123456789ABCDEh";
static const char kOutOfBandPairingDataRandomizer[] = "0123456789ABCDEr";
-static chromeos::BluetoothOutOfBandPairingData GetOutOfBandPairingData() {
- chromeos::BluetoothOutOfBandPairingData data;
+static BluetoothOutOfBandPairingData GetOutOfBandPairingData() {
+ BluetoothOutOfBandPairingData data;
memcpy(&(data.hash), kOutOfBandPairingDataHash,
- chromeos::kBluetoothOutOfBandPairingDataSize);
+ bluetooth::kBluetoothOutOfBandPairingDataSize);
memcpy(&(data.randomizer), kOutOfBandPairingDataRandomizer,
- chromeos::kBluetoothOutOfBandPairingDataSize);
+ bluetooth::kBluetoothOutOfBandPairingDataSize);
return data;
}
@@ -113,16 +117,15 @@ static bool CallClosure(const base::Closure& callback) {
}
static void CallOutOfBandPairingDataCallback(
- const chromeos::BluetoothAdapter::BluetoothOutOfBandPairingDataCallback&
- callback,
- const chromeos::BluetoothAdapter::ErrorCallback& error_callback) {
+ const BluetoothAdapter::BluetoothOutOfBandPairingDataCallback& callback,
+ const BluetoothAdapter::ErrorCallback& error_callback) {
callback.Run(GetOutOfBandPairingData());
}
template <bool Value>
static void CallProvidesServiceCallback(
- const std::string& name,
- const chromeos::BluetoothDevice::ProvidesServiceCallback& callback) {
+ const std::string& name,
+ const BluetoothDevice::ProvidesServiceCallback& callback) {
callback.Run(Value);
}
@@ -359,7 +362,7 @@ IN_PROC_BROWSER_TEST_F(BluetoothApiTest, Events) {
// Load and wait for setup
ExtensionTestMessageListener listener("ready", true);
- const extensions::Extension* extension =
+ const Extension* extension =
LoadExtension(test_data_dir_.AppendASCII("bluetooth"));
GURL page_url = extension->GetResourceURL("test_events.html");
ui_test_utils::NavigateToURL(browser(), page_url);
@@ -381,7 +384,7 @@ IN_PROC_BROWSER_TEST_F(BluetoothApiTest, GetDevices) {
ResultCatcher catcher;
catcher.RestrictToProfile(browser()->profile());
- chromeos::BluetoothAdapter::ConstDeviceList devices;
+ BluetoothAdapter::ConstDeviceList devices;
devices.push_back(device1_.get());
devices.push_back(device2_.get());
@@ -401,7 +404,7 @@ IN_PROC_BROWSER_TEST_F(BluetoothApiTest, GetDevices) {
// Load and wait for setup
ExtensionTestMessageListener listener("ready", true);
- const extensions::Extension* extension =
+ const Extension* extension =
LoadExtension(test_data_dir_.AppendASCII("bluetooth"));
GURL page_url = extension->GetResourceURL("test_getdevices.html");
ui_test_utils::NavigateToURL(browser(), page_url);
@@ -416,12 +419,12 @@ IN_PROC_BROWSER_TEST_F(BluetoothApiTest, GetDevicesConcurrently) {
ResultCatcher catcher;
catcher.RestrictToProfile(browser()->profile());
- chromeos::BluetoothAdapter::ConstDeviceList devices;
+ BluetoothAdapter::ConstDeviceList devices;
devices.push_back(device1_.get());
// Save the callback to delay execution so that we can force the calls to
// happen concurrently. This will be called after the listener is satisfied.
- chromeos::BluetoothDevice::ProvidesServiceCallback callback;
+ BluetoothDevice::ProvidesServiceCallback callback;
EXPECT_CALL(*device1_, ProvidesServiceWithName(testing::_, testing::_))
.WillOnce(testing::SaveArg<1>(&callback));
@@ -430,7 +433,7 @@ IN_PROC_BROWSER_TEST_F(BluetoothApiTest, GetDevicesConcurrently) {
// Load and wait for setup
ExtensionTestMessageListener listener("ready", true);
- const extensions::Extension* extension =
+ const Extension* extension =
LoadExtension(test_data_dir_.AppendASCII("bluetooth"));
GURL page_url =
extension->GetResourceURL("test_getdevices_concurrently.html");

Powered by Google App Engine
This is Rietveld 408576698