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

Side by Side Diff: device/bluetooth/bluetooth_experimental_chromeos_unittest.cc

Issue 13872017: Bluetooth: gather usage metrics (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase since Cellular.* appeared under us Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « device/bluetooth/bluetooth_device_win.cc ('k') | device/bluetooth/test/mock_bluetooth_device.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/message_loop.h" 6 #include "base/message_loop.h"
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chromeos/chromeos_switches.h" 8 #include "chromeos/chromeos_switches.h"
9 #include "chromeos/dbus/fake_bluetooth_adapter_client.h" 9 #include "chromeos/dbus/fake_bluetooth_adapter_client.h"
10 #include "chromeos/dbus/fake_bluetooth_device_client.h" 10 #include "chromeos/dbus/fake_bluetooth_device_client.h"
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 EXPECT_FALSE(devices[0]->IsConnected()); 757 EXPECT_FALSE(devices[0]->IsConnected());
758 EXPECT_FALSE(devices[0]->IsConnecting()); 758 EXPECT_FALSE(devices[0]->IsConnecting());
759 759
760 // Non HID devices are always connectable. 760 // Non HID devices are always connectable.
761 EXPECT_TRUE(devices[0]->IsConnectable()); 761 EXPECT_TRUE(devices[0]->IsConnectable());
762 762
763 BluetoothDevice::ServiceList uuids = devices[0]->GetServices(); 763 BluetoothDevice::ServiceList uuids = devices[0]->GetServices();
764 ASSERT_EQ(2U, uuids.size()); 764 ASSERT_EQ(2U, uuids.size());
765 EXPECT_EQ(uuids[0], "00001800-0000-1000-8000-00805f9b34fb"); 765 EXPECT_EQ(uuids[0], "00001800-0000-1000-8000-00805f9b34fb");
766 EXPECT_EQ(uuids[1], "00001801-0000-1000-8000-00805f9b34fb"); 766 EXPECT_EQ(uuids[1], "00001801-0000-1000-8000-00805f9b34fb");
767
768 EXPECT_EQ(0x05ac, devices[0]->GetVendorID());
769 EXPECT_EQ(0x030d, devices[0]->GetProductID());
770 EXPECT_EQ(0x0306, devices[0]->GetDeviceID());
767 } 771 }
768 772
769 TEST_F(BluetoothExperimentalChromeOSTest, DeviceClassChanged) { 773 TEST_F(BluetoothExperimentalChromeOSTest, DeviceClassChanged) {
770 // Simulate a change of class of a device, as sometimes occurs 774 // Simulate a change of class of a device, as sometimes occurs
771 // during discovery. 775 // during discovery.
772 GetAdapter(); 776 GetAdapter();
773 777
774 BluetoothAdapter::DeviceList devices = adapter_->GetDevices(); 778 BluetoothAdapter::DeviceList devices = adapter_->GetDevices();
775 ASSERT_EQ(1U, devices.size()); 779 ASSERT_EQ(1U, devices.size());
776 ASSERT_EQ(FakeBluetoothDeviceClient::kPairedDeviceAddress, 780 ASSERT_EQ(FakeBluetoothDeviceClient::kPairedDeviceAddress,
(...skipping 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after
1978 EXPECT_FALSE(device->IsConnected()); 1982 EXPECT_FALSE(device->IsConnected());
1979 EXPECT_FALSE(device->IsConnecting()); 1983 EXPECT_FALSE(device->IsConnecting());
1980 EXPECT_FALSE(device->IsPaired()); 1984 EXPECT_FALSE(device->IsPaired());
1981 1985
1982 // Pairing dialog should be dismissed 1986 // Pairing dialog should be dismissed
1983 EXPECT_EQ(1, pairing_delegate.call_count_); 1987 EXPECT_EQ(1, pairing_delegate.call_count_);
1984 EXPECT_EQ(1, pairing_delegate.dismiss_count_); 1988 EXPECT_EQ(1, pairing_delegate.dismiss_count_);
1985 } 1989 }
1986 1990
1987 } // namespace chromeos 1991 } // namespace chromeos
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_device_win.cc ('k') | device/bluetooth/test/mock_bluetooth_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698