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

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: 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 cf419c1f565cbbf216f185a2648246df112a202a..922abe1edd945aa14e894e8e09904dbd1fefd7b8 100644
--- a/chrome/browser/extensions/api/bluetooth/bluetooth_apitest_chromeos.cc
+++ b/chrome/browser/extensions/api/bluetooth/bluetooth_apitest_chromeos.cc
@@ -4,21 +4,23 @@
#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;
bryeung 2012/10/10 15:03:53 might as well add the mocks as well
youngki 2012/10/10 18:34:57 Done.
using extensions::Extension;
namespace utils = extension_function_test_utils;
@@ -35,14 +37,15 @@ 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>(
- kAdapterAddress, kName);
+ mock_adapter_ =
+ new testing::StrictMock<bluetooth::MockBluetoothAdapter>(
+ kAdapterAddress, kName);
event_router()->SetAdapterForTest(mock_adapter_);
- device1_.reset(new testing::NiceMock<chromeos::MockBluetoothDevice>(
+ device1_.reset(new testing::NiceMock<bluetooth::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<bluetooth::MockBluetoothDevice>(
mock_adapter_, "d2", "21:22:23:24:25:26",
false /* paired */, true /* bonded */, false /* connected */));
}
@@ -81,11 +84,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<bluetooth::MockBluetoothAdapter>* mock_adapter_;
+ scoped_ptr<testing::NiceMock<bluetooth::MockBluetoothDevice> > device1_;
+ scoped_ptr<testing::NiceMock<bluetooth::MockBluetoothDevice> > device2_;
- chromeos::ExtensionBluetoothEventRouter* event_router() {
+ extensions::ExtensionBluetoothEventRouter* event_router() {
return browser()->profile()->GetExtensionService()->
bluetooth_event_router();
}
@@ -98,12 +101,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 +116,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 bluetooth::BluetoothAdapter::ErrorCallback& error_callback) {
bryeung 2012/10/10 15:03:53 s/bluetooth:://
youngki 2012/10/10 18:34:57 Done.
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);
}
@@ -385,7 +387,7 @@ IN_PROC_BROWSER_TEST_F(BluetoothApiTest, GetDevices) {
ResultCatcher catcher;
catcher.RestrictToProfile(browser()->profile());
- chromeos::BluetoothAdapter::ConstDeviceList devices;
+ bluetooth::BluetoothAdapter::ConstDeviceList devices;
bryeung 2012/10/10 15:03:53 s/bluetooth:://
youngki 2012/10/10 18:34:57 Done.
devices.push_back(device1_.get());
devices.push_back(device2_.get());
@@ -420,12 +422,12 @@ IN_PROC_BROWSER_TEST_F(BluetoothApiTest, GetDevicesConcurrently) {
ResultCatcher catcher;
catcher.RestrictToProfile(browser()->profile());
- chromeos::BluetoothAdapter::ConstDeviceList devices;
+ bluetooth::BluetoothAdapter::ConstDeviceList devices;
bryeung 2012/10/10 15:03:53 s/bluetooth:://
youngki 2012/10/10 18:34:57 Done.
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));

Powered by Google App Engine
This is Rietveld 408576698