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

Unified Diff: device/bluetooth/bluez/bluetooth_bluez_unittest.cc

Issue 2381493005: Add bluetooth device type icons on MD system tray. (Closed)
Patch Set: Move BluetoothDeviceType to device/bluetooth/bluetooth_common.h Created 4 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: device/bluetooth/bluez/bluetooth_bluez_unittest.cc
diff --git a/device/bluetooth/bluez/bluetooth_bluez_unittest.cc b/device/bluetooth/bluez/bluetooth_bluez_unittest.cc
index 85e12959c8f6b01d3cb67813ea3c37a1647ab668..000abf9cfc5a424a3eea2478c313d07728957679 100644
--- a/device/bluetooth/bluez/bluetooth_bluez_unittest.cc
+++ b/device/bluetooth/bluez/bluetooth_bluez_unittest.cc
@@ -36,6 +36,7 @@ using device::BluetoothAdapter;
using device::BluetoothAdapterFactory;
using device::BluetoothAudioSink;
using device::BluetoothDevice;
+using device::BluetoothDeviceType;
using device::BluetoothDiscoveryFilter;
using device::BluetoothDiscoverySession;
using device::BluetoothUUID;
@@ -2157,7 +2158,7 @@ TEST_F(BluetoothBlueZTest, DeviceProperties) {
EXPECT_EQ(
base::UTF8ToUTF16(bluez::FakeBluetoothDeviceClient::kPairedDeviceAlias),
devices[idx]->GetNameForDisplay());
- EXPECT_EQ(BluetoothDevice::DEVICE_COMPUTER, devices[idx]->GetDeviceType());
+ EXPECT_EQ(BluetoothDeviceType::COMPUTER, devices[idx]->GetDeviceType());
EXPECT_TRUE(devices[idx]->IsPaired());
EXPECT_FALSE(devices[idx]->IsConnected());
EXPECT_FALSE(devices[idx]->IsConnecting());
@@ -2187,7 +2188,7 @@ TEST_F(BluetoothBlueZTest, DeviceClassChanged) {
int idx = GetDeviceIndexByAddress(
devices, bluez::FakeBluetoothDeviceClient::kPairedDeviceAddress);
ASSERT_NE(-1, idx);
- ASSERT_EQ(BluetoothDevice::DEVICE_COMPUTER, devices[idx]->GetDeviceType());
+ ASSERT_EQ(BluetoothDeviceType::COMPUTER, devices[idx]->GetDeviceType());
// Install an observer; expect the DeviceChanged method to be called when
// we change the class of the device.
@@ -2202,7 +2203,7 @@ TEST_F(BluetoothBlueZTest, DeviceClassChanged) {
EXPECT_EQ(1, observer.device_changed_count());
EXPECT_EQ(devices[idx], observer.last_device());
- EXPECT_EQ(BluetoothDevice::DEVICE_MOUSE, devices[idx]->GetDeviceType());
+ EXPECT_EQ(BluetoothDeviceType::MOUSE, devices[idx]->GetDeviceType());
}
TEST_F(BluetoothBlueZTest, DeviceAppearance) {
@@ -2215,7 +2216,7 @@ TEST_F(BluetoothBlueZTest, DeviceAppearance) {
int idx = GetDeviceIndexByAddress(
devices, bluez::FakeBluetoothDeviceClient::kPairedDeviceAddress);
ASSERT_NE(-1, idx);
- ASSERT_EQ(BluetoothDevice::DEVICE_COMPUTER, devices[idx]->GetDeviceType());
+ ASSERT_EQ(BluetoothDeviceType::COMPUTER, devices[idx]->GetDeviceType());
// Install an observer; expect the DeviceChanged method to be called when
// we change the appearance of the device.
@@ -2271,7 +2272,7 @@ TEST_F(BluetoothBlueZTest, DeviceTypebyAppearanceNotBluetoothClass) {
int idx = GetDeviceIndexByAddress(
devices, bluez::FakeBluetoothDeviceClient::kPairedDeviceAddress);
ASSERT_NE(-1, idx);
- ASSERT_EQ(BluetoothDevice::DEVICE_COMPUTER, devices[idx]->GetDeviceType());
+ ASSERT_EQ(BluetoothDeviceType::COMPUTER, devices[idx]->GetDeviceType());
// Install an observer; expect the DeviceChanged method to be called when
// we change the appearance of the device.
@@ -2284,14 +2285,14 @@ TEST_F(BluetoothBlueZTest, DeviceTypebyAppearanceNotBluetoothClass) {
// Let the device come without bluetooth_class.
properties->bluetooth_class.ReplaceValue(0); // DeviceChanged method called
properties->appearance.ReplaceValue(0); // DeviceChanged method called
- EXPECT_EQ(BluetoothDevice::DEVICE_UNKNOWN, devices[idx]->GetDeviceType());
+ EXPECT_EQ(BluetoothDeviceType::UNKNOWN, devices[idx]->GetDeviceType());
EXPECT_EQ(2, observer.device_changed_count());
EXPECT_EQ(devices[idx], observer.last_device());
// Set the device appearance as keyboard.
properties->appearance.ReplaceValue(961); // DeviceChanged method called
properties->appearance.set_valid(true);
- EXPECT_EQ(BluetoothDevice::DEVICE_KEYBOARD, devices[idx]->GetDeviceType());
+ EXPECT_EQ(BluetoothDeviceType::KEYBOARD, devices[idx]->GetDeviceType());
EXPECT_EQ(3, observer.device_changed_count());
EXPECT_EQ(devices[idx], observer.last_device());
// When discovery is over, the value should be invalidated.
@@ -2300,12 +2301,12 @@ TEST_F(BluetoothBlueZTest, DeviceTypebyAppearanceNotBluetoothClass) {
properties->NotifyPropertyChanged(properties->appearance.name());
EXPECT_EQ(4, observer.device_changed_count());
EXPECT_EQ(devices[idx], observer.last_device());
- EXPECT_EQ(BluetoothDevice::DEVICE_UNKNOWN, devices[idx]->GetDeviceType());
+ EXPECT_EQ(BluetoothDeviceType::UNKNOWN, devices[idx]->GetDeviceType());
// Change the device appearance to mouse.
properties->appearance.ReplaceValue(962); // DeviceChanged method called
properties->appearance.set_valid(true);
- EXPECT_EQ(BluetoothDevice::DEVICE_MOUSE, devices[idx]->GetDeviceType());
+ EXPECT_EQ(BluetoothDeviceType::MOUSE, devices[idx]->GetDeviceType());
EXPECT_EQ(5, observer.device_changed_count());
EXPECT_EQ(devices[idx], observer.last_device());
// When discovery is over, the value should be invalidated.
@@ -2314,7 +2315,7 @@ TEST_F(BluetoothBlueZTest, DeviceTypebyAppearanceNotBluetoothClass) {
properties->NotifyPropertyChanged(properties->appearance.name());
EXPECT_EQ(6, observer.device_changed_count());
EXPECT_EQ(devices[idx], observer.last_device());
- EXPECT_EQ(BluetoothDevice::DEVICE_UNKNOWN, devices[idx]->GetDeviceType());
+ EXPECT_EQ(BluetoothDeviceType::UNKNOWN, devices[idx]->GetDeviceType());
}
TEST_F(BluetoothBlueZTest, DeviceNameChanged) {

Powered by Google App Engine
This is Rietveld 408576698