summaryrefslogtreecommitdiffstats
path: root/device
diff options
context:
space:
mode:
authorkeybuk@chromium.org <keybuk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-30 01:30:51 +0000
committerkeybuk@chromium.org <keybuk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-30 01:30:51 +0000
commit03e406bf8fd7796568e4a135bf7e2b3bbc3163b8 (patch)
tree23773595076ff281d2c5e561d7b52d96427715a7 /device
parent967d402e91488f4e18f90022aae7dc2d82e933bf (diff)
downloadchromium_src-03e406bf8fd7796568e4a135bf7e2b3bbc3163b8.zip
chromium_src-03e406bf8fd7796568e4a135bf7e2b3bbc3163b8.tar.gz
chromium_src-03e406bf8fd7796568e4a135bf7e2b3bbc3163b8.tar.bz2
Bluetooth: fix fake device classes
Fake devices are used not only in test cases, but also when running a Chrome OS build of Chromium on Linux. Fix the inverted keyboard/mouse classes so that the "Microsoft Mouse" behaves as the real device and returns false for IsPairable(). This means it can be used to exercise the Connect-without-Pairing case. Add a new "Unconnectable Device" for the test that was testing a device actually failing to connect after being paired. BUG=none TEST=device_unittests, -Dchromeos=1, chrome --enable-experimental-bluetooth, pair with MS Mouse, verify no pairing dialog appears R=satorux@chromium.org, youngki@chromium.org Review URL: https://chromiumcodereview.appspot.com/14273033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197215 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'device')
-rw-r--r--device/bluetooth/bluetooth_experimental_chromeos_unittest.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/device/bluetooth/bluetooth_experimental_chromeos_unittest.cc b/device/bluetooth/bluetooth_experimental_chromeos_unittest.cc
index b2abc90..3b8f997 100644
--- a/device/bluetooth/bluetooth_experimental_chromeos_unittest.cc
+++ b/device/bluetooth/bluetooth_experimental_chromeos_unittest.cc
@@ -1612,10 +1612,10 @@ TEST_F(BluetoothExperimentalChromeOSTest, PairingFailsAtConnection) {
GetAdapter();
DiscoverDevices();
- // Everything seems to go according to plan with the Microsoft Mouse, it
- // pairs with 0000, but then you can't make connections to it after.
+ // Everything seems to go according to plan with the unconnectable device;
+ // it pairs, but then you can't make connections to it after.
BluetoothDevice* device = adapter_->GetDevice(
- FakeBluetoothDeviceClient::kMicrosoftMouseAddress);
+ FakeBluetoothDeviceClient::kUnconnectableDeviceAddress);
ASSERT_TRUE(device != NULL);
ASSERT_FALSE(device->IsPaired());
@@ -1639,10 +1639,9 @@ TEST_F(BluetoothExperimentalChromeOSTest, PairingFailsAtConnection) {
EXPECT_EQ(1, error_callback_count_);
EXPECT_EQ(BluetoothDevice::ERROR_FAILED, last_connect_error_);
- // Two changes for connecting, one for paired, one for for trusted
- // after pairing and one for the reconnect mode (IsConnectable).
- // The device should not be connected,
- EXPECT_EQ(5, observer.device_changed_count_);
+ // Two changes for connecting, one for paired and one for trusted after
+ // pairing. The device should not be connected.
+ EXPECT_EQ(4, observer.device_changed_count_);
EXPECT_EQ(device, observer.last_device_);
EXPECT_FALSE(device->IsConnected());
@@ -1658,7 +1657,8 @@ TEST_F(BluetoothExperimentalChromeOSTest, PairingFailsAtConnection) {
// worked).
FakeBluetoothDeviceClient::Properties* properties =
fake_bluetooth_device_client_->GetProperties(
- dbus::ObjectPath(FakeBluetoothDeviceClient::kMicrosoftMousePath));
+ dbus::ObjectPath(
+ FakeBluetoothDeviceClient::kUnconnectableDevicePath));
EXPECT_TRUE(properties->trusted.value());
}