summaryrefslogtreecommitdiffstats
path: root/device
diff options
context:
space:
mode:
authorkeybuk@chromium.org <keybuk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-28 17:03:06 +0000
committerkeybuk@chromium.org <keybuk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-28 17:03:06 +0000
commit5359e057f26d72bab59bc787b59aac937591fd86 (patch)
treed89d690e199e606e00479b497af5020ad105ff95 /device
parentcb86ee6f9f22bc88c27f055e3882a0ea9f9b4525 (diff)
downloadchromium_src-5359e057f26d72bab59bc787b59aac937591fd86.zip
chromium_src-5359e057f26d72bab59bc787b59aac937591fd86.tar.gz
chromium_src-5359e057f26d72bab59bc787b59aac937591fd86.tar.bz2
Bluetooth: gather usage metrics
BUG=233820 TEST=chrome:///histograms R=isherman@chromium.org, satorux@chromium.org, youngki@chromium.org Review URL: https://codereview.chromium.org/13872017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196990 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'device')
-rw-r--r--device/bluetooth/bluetooth_adapter_experimental_chromeos.cc14
-rw-r--r--device/bluetooth/bluetooth_device.h17
-rw-r--r--device/bluetooth/bluetooth_device_chromeos.cc12
-rw-r--r--device/bluetooth/bluetooth_device_chromeos.h5
-rw-r--r--device/bluetooth/bluetooth_device_experimental_chromeos.cc152
-rw-r--r--device/bluetooth/bluetooth_device_experimental_chromeos.h14
-rw-r--r--device/bluetooth/bluetooth_device_mac.h5
-rw-r--r--device/bluetooth/bluetooth_device_mac.mm12
-rw-r--r--device/bluetooth/bluetooth_device_win.cc12
-rw-r--r--device/bluetooth/bluetooth_device_win.h5
-rw-r--r--device/bluetooth/bluetooth_experimental_chromeos_unittest.cc4
-rw-r--r--device/bluetooth/test/mock_bluetooth_device.h3
12 files changed, 248 insertions, 7 deletions
diff --git a/device/bluetooth/bluetooth_adapter_experimental_chromeos.cc b/device/bluetooth/bluetooth_adapter_experimental_chromeos.cc
index 5051690..6a282f3 100644
--- a/device/bluetooth/bluetooth_adapter_experimental_chromeos.cc
+++ b/device/bluetooth/bluetooth_adapter_experimental_chromeos.cc
@@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/logging.h"
+#include "base/metrics/histogram.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/experimental_bluetooth_adapter_client.h"
#include "chromeos/dbus/experimental_bluetooth_device_client.h"
@@ -253,6 +254,19 @@ void BluetoothAdapterExperimentalChromeOS::DevicePropertyChanged(
property_name == properties->connected.name() ||
property_name == properties->uuids.name())
NotifyDeviceChanged(device_chromeos);
+
+ // UMA connection counting
+ if (property_name == properties->connected.name()) {
+ int count = 0;
+
+ for (DevicesMap::iterator iter = devices_.begin();
+ iter != devices_.end(); ++iter) {
+ if (iter->second->IsConnected())
+ ++count;
+ }
+
+ UMA_HISTOGRAM_COUNTS_100("Bluetooth.ConnectedDeviceCount", count);
+ }
}
void BluetoothAdapterExperimentalChromeOS::InputPropertyChanged(
diff --git a/device/bluetooth/bluetooth_device.h b/device/bluetooth/bluetooth_device.h
index c48fff7..e442080 100644
--- a/device/bluetooth/bluetooth_device.h
+++ b/device/bluetooth/bluetooth_device.h
@@ -167,10 +167,24 @@ class BluetoothDevice {
virtual ~BluetoothDevice();
+ // Returns the Bluetooth class of the device, used by GetDeviceType()
+ // and metrics logging,
+ virtual uint32 GetBluetoothClass() const = 0;
+
// Returns the Bluetooth of address the device. This should be used as
// a unique key to identify the device and copied where needed.
virtual std::string GetAddress() const = 0;
+ // Returns the Vendor ID of the device, where available.
+ virtual uint16 GetVendorID() const = 0;
+
+ // Returns the Product ID of the device, where available.
+ virtual uint16 GetProductID() const = 0;
+
+ // Returns the Device ID of the device, typically the release or version
+ // number in BCD format, where available.
+ virtual uint16 GetDeviceID() const = 0;
+
// Returns the name of the device suitable for displaying, this may
// be a synthesied string containing the address and localized type name
// if the device has no obtained name.
@@ -344,9 +358,6 @@ class BluetoothDevice {
protected:
BluetoothDevice();
- // Returns the Bluetooth class of the device, used by GetDeviceType().
- virtual uint32 GetBluetoothClass() const = 0;
-
// Returns the internal name of the Bluetooth device, used by GetName().
virtual std::string GetDeviceName() const = 0;
diff --git a/device/bluetooth/bluetooth_device_chromeos.cc b/device/bluetooth/bluetooth_device_chromeos.cc
index 9d18de0..4f3b5ae 100644
--- a/device/bluetooth/bluetooth_device_chromeos.cc
+++ b/device/bluetooth/bluetooth_device_chromeos.cc
@@ -78,6 +78,18 @@ std::string BluetoothDeviceChromeOS::GetAddress() const {
return address_;
}
+uint16 BluetoothDeviceChromeOS::GetVendorID() const {
+ return 0;
+}
+
+uint16 BluetoothDeviceChromeOS::GetProductID() const {
+ return 0;
+}
+
+uint16 BluetoothDeviceChromeOS::GetDeviceID() const {
+ return 0;
+}
+
bool BluetoothDeviceChromeOS::IsPaired() const {
return paired_ || trusted_;
}
diff --git a/device/bluetooth/bluetooth_device_chromeos.h b/device/bluetooth/bluetooth_device_chromeos.h
index baa1f6e..72718b2 100644
--- a/device/bluetooth/bluetooth_device_chromeos.h
+++ b/device/bluetooth/bluetooth_device_chromeos.h
@@ -40,7 +40,11 @@ class BluetoothDeviceChromeOS
virtual ~BluetoothDeviceChromeOS();
// BluetoothDevice override
+ virtual uint32 GetBluetoothClass() const OVERRIDE;
virtual std::string GetAddress() const OVERRIDE;
+ virtual uint16 GetVendorID() const OVERRIDE;
+ virtual uint16 GetProductID() const OVERRIDE;
+ virtual uint16 GetDeviceID() const OVERRIDE;
virtual bool IsPaired() const OVERRIDE;
virtual bool IsConnected() const OVERRIDE;
virtual bool IsConnectable() const OVERRIDE;
@@ -85,7 +89,6 @@ class BluetoothDeviceChromeOS
protected:
// BluetoothDevice override
- virtual uint32 GetBluetoothClass() const OVERRIDE;
virtual std::string GetDeviceName() const OVERRIDE;
private:
diff --git a/device/bluetooth/bluetooth_device_experimental_chromeos.cc b/device/bluetooth/bluetooth_device_experimental_chromeos.cc
index 09c1ddf..3e11439 100644
--- a/device/bluetooth/bluetooth_device_experimental_chromeos.cc
+++ b/device/bluetooth/bluetooth_device_experimental_chromeos.cc
@@ -5,6 +5,9 @@
#include "device/bluetooth/bluetooth_device_experimental_chromeos.h"
#include "base/bind.h"
+#include "base/metrics/histogram.h"
+#include "base/string_util.h"
+#include "base/strings/string_number_conversions.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/experimental_bluetooth_adapter_client.h"
#include "chromeos/dbus/experimental_bluetooth_agent_manager_client.h"
@@ -25,6 +28,67 @@ namespace {
// (which we fail in OnRegisterAgentError with ERROR_INPROGRESS).
const char kAgentPath[] = "/org/chromium/bluetooth_agent";
+// Histogram enumerations for pairing methods.
+enum UMAPairingMethod {
+ UMA_PAIRING_METHOD_NONE,
+ UMA_PAIRING_METHOD_REQUEST_PINCODE,
+ UMA_PAIRING_METHOD_REQUEST_PASSKEY,
+ UMA_PAIRING_METHOD_DISPLAY_PINCODE,
+ UMA_PAIRING_METHOD_DISPLAY_PASSKEY,
+ UMA_PAIRING_METHOD_CONFIRM_PASSKEY,
+ // NOTE: Add new pairing methods immediately above this line. Make sure to
+ // update the enum list in tools/histogram/histograms.xml accordinly.
+ UMA_PAIRING_METHOD_COUNT
+};
+
+// Histogram enumerations for pairing results.
+enum UMAPairingResult {
+ UMA_PAIRING_RESULT_SUCCESS,
+ UMA_PAIRING_RESULT_INPROGRESS,
+ UMA_PAIRING_RESULT_FAILED,
+ UMA_PAIRING_RESULT_AUTH_FAILED,
+ UMA_PAIRING_RESULT_AUTH_CANCELED,
+ UMA_PAIRING_RESULT_AUTH_REJECTED,
+ UMA_PAIRING_RESULT_AUTH_TIMEOUT,
+ UMA_PAIRING_RESULT_UNSUPPORTED_DEVICE,
+ UMA_PAIRING_RESULT_UNKNOWN_ERROR,
+ // NOTE: Add new pairing results immediately above this line. Make sure to
+ // update the enum list in tools/histogram/histograms.xml accordinly.
+ UMA_PAIRING_RESULT_COUNT
+};
+
+void ParseModalias(const dbus::ObjectPath& object_path,
+ uint16 *vendor_id,
+ uint16 *product_id,
+ uint16 *device_id) {
+ chromeos::ExperimentalBluetoothDeviceClient::Properties* properties =
+ chromeos::DBusThreadManager::Get()->
+ GetExperimentalBluetoothDeviceClient()->GetProperties(object_path);
+ DCHECK(properties);
+
+ std::string modalias = properties->modalias.value();
+ if (StartsWithASCII(modalias, "usb:", false) && modalias.length() == 19) {
+ // usb:vXXXXpXXXXdXXXX
+ if (modalias[4] == 'v' && vendor_id != NULL) {
+ uint64 component = 0;
+ base::HexStringToUInt64(modalias.substr(5, 4), &component);
+ *vendor_id = component;
+ }
+
+ if (modalias[9] == 'p' && product_id != NULL) {
+ uint64 component = 0;
+ base::HexStringToUInt64(modalias.substr(10, 4), &component);
+ *product_id = component;
+ }
+
+ if (modalias[14] == 'd' && device_id != NULL) {
+ uint64 component = 0;
+ base::HexStringToUInt64(modalias.substr(15, 4), &component);
+ *device_id = component;
+ }
+ }
+}
+
} // namespace
namespace chromeos {
@@ -36,6 +100,7 @@ BluetoothDeviceExperimentalChromeOS::BluetoothDeviceExperimentalChromeOS(
object_path_(object_path),
num_connecting_calls_(0),
pairing_delegate_(NULL),
+ pairing_delegate_used_(false),
weak_ptr_factory_(this) {
}
@@ -69,6 +134,24 @@ std::string BluetoothDeviceExperimentalChromeOS::GetAddress() const {
return properties->address.value();
}
+uint16 BluetoothDeviceExperimentalChromeOS::GetVendorID() const {
+ uint16 vendor_id = 0;
+ ParseModalias(object_path_, &vendor_id, NULL, NULL);
+ return vendor_id;
+}
+
+uint16 BluetoothDeviceExperimentalChromeOS::GetProductID() const {
+ uint16 product_id = 0;
+ ParseModalias(object_path_, NULL, &product_id, NULL);
+ return product_id;
+}
+
+uint16 BluetoothDeviceExperimentalChromeOS::GetDeviceID() const {
+ uint16 device_id = 0;
+ ParseModalias(object_path_, NULL, NULL, &device_id);
+ return device_id;
+}
+
bool BluetoothDeviceExperimentalChromeOS::IsPaired() const {
ExperimentalBluetoothDeviceClient::Properties* properties =
DBusThreadManager::Get()->GetExperimentalBluetoothDeviceClient()->
@@ -161,6 +244,7 @@ void BluetoothDeviceExperimentalChromeOS::Connect(
DCHECK(agent_.get() == NULL);
pairing_delegate_ = pairing_delegate;
+ pairing_delegate_used_ = false;
// The agent path is relatively meaningless since BlueZ only supports
// one per application at a time.
@@ -310,6 +394,10 @@ void BluetoothDeviceExperimentalChromeOS::RequestPinCode(
DCHECK(device_path == object_path_);
VLOG(1) << object_path_.value() << ": RequestPinCode";
+ UMA_HISTOGRAM_ENUMERATION("Bluetooth.PairingMethod",
+ UMA_PAIRING_METHOD_REQUEST_PINCODE,
+ UMA_PAIRING_METHOD_COUNT);
+
DCHECK(pairing_delegate_);
DCHECK(pincode_callback_.is_null());
pincode_callback_ = callback;
@@ -323,6 +411,10 @@ void BluetoothDeviceExperimentalChromeOS::DisplayPinCode(
DCHECK(device_path == object_path_);
VLOG(1) << object_path_.value() << ": DisplayPinCode: " << pincode;
+ UMA_HISTOGRAM_ENUMERATION("Bluetooth.PairingMethod",
+ UMA_PAIRING_METHOD_DISPLAY_PINCODE,
+ UMA_PAIRING_METHOD_COUNT);
+
DCHECK(pairing_delegate_);
pairing_delegate_->DisplayPinCode(this, pincode);
}
@@ -334,6 +426,10 @@ void BluetoothDeviceExperimentalChromeOS::RequestPasskey(
DCHECK(device_path == object_path_);
VLOG(1) << object_path_.value() << ": RequestPasskey";
+ UMA_HISTOGRAM_ENUMERATION("Bluetooth.PairingMethod",
+ UMA_PAIRING_METHOD_REQUEST_PASSKEY,
+ UMA_PAIRING_METHOD_COUNT);
+
DCHECK(pairing_delegate_);
DCHECK(passkey_callback_.is_null());
passkey_callback_ = callback;
@@ -349,6 +445,11 @@ void BluetoothDeviceExperimentalChromeOS::DisplayPasskey(
VLOG(1) << object_path_.value() << ": DisplayPasskey: " << passkey
<< " (" << entered << " entered)";
+ if (entered == 0)
+ UMA_HISTOGRAM_ENUMERATION("Bluetooth.PairingMethod",
+ UMA_PAIRING_METHOD_DISPLAY_PASSKEY,
+ UMA_PAIRING_METHOD_COUNT);
+
DCHECK(pairing_delegate_);
if (entered == 0)
pairing_delegate_->DisplayPasskey(this, passkey);
@@ -363,6 +464,10 @@ void BluetoothDeviceExperimentalChromeOS::RequestConfirmation(
DCHECK(device_path == object_path_);
VLOG(1) << object_path_.value() << ": RequestConfirmation: " << passkey;
+ UMA_HISTOGRAM_ENUMERATION("Bluetooth.PairingMethod",
+ UMA_PAIRING_METHOD_CONFIRM_PASSKEY,
+ UMA_PAIRING_METHOD_COUNT);
+
DCHECK(pairing_delegate_);
DCHECK(confirmation_callback_.is_null());
confirmation_callback_ = callback;
@@ -446,6 +551,7 @@ void BluetoothDeviceExperimentalChromeOS::OnConnectError(
error_code = ERROR_UNSUPPORTED_DEVICE;
}
+ RecordPairingResult(false, error_code);
error_callback.Run(error_code);
}
@@ -486,6 +592,7 @@ void BluetoothDeviceExperimentalChromeOS::OnRegisterAgentError(
if (error_name == bluetooth_adapter::kErrorAlreadyExists)
error_code = ERROR_INPROGRESS;
+ RecordPairingResult(false, error_code);
error_callback.Run(error_code);
}
@@ -493,6 +600,11 @@ void BluetoothDeviceExperimentalChromeOS::OnPair(
const base::Closure& callback,
const ConnectErrorCallback& error_callback) {
VLOG(1) << object_path_.value() << ": Paired";
+
+ if (!pairing_delegate_used_)
+ UMA_HISTOGRAM_ENUMERATION("Bluetooth.PairingMethod",
+ UMA_PAIRING_METHOD_NONE,
+ UMA_PAIRING_METHOD_COUNT);
UnregisterAgent();
SetTrusted();
ConnectInternal(callback, error_callback);
@@ -527,6 +639,7 @@ void BluetoothDeviceExperimentalChromeOS::OnPairError(
error_code = ERROR_AUTH_TIMEOUT;
}
+ RecordPairingResult(false, error_code);
error_callback.Run(error_code);
}
@@ -636,4 +749,43 @@ bool BluetoothDeviceExperimentalChromeOS::RunPairingCallbacks(Status status) {
return callback_run;
}
+void BluetoothDeviceExperimentalChromeOS::RecordPairingResult(
+ bool success,
+ ConnectErrorCode error_code) {
+ UMAPairingResult pairing_result;
+ if (success) {
+ pairing_result = UMA_PAIRING_RESULT_SUCCESS;
+ } else {
+ switch (error_code) {
+ case ERROR_INPROGRESS:
+ pairing_result = UMA_PAIRING_RESULT_INPROGRESS;
+ break;
+ case ERROR_FAILED:
+ pairing_result = UMA_PAIRING_RESULT_FAILED;
+ break;
+ case ERROR_AUTH_FAILED:
+ pairing_result = UMA_PAIRING_RESULT_AUTH_FAILED;
+ break;
+ case ERROR_AUTH_CANCELED:
+ pairing_result = UMA_PAIRING_RESULT_AUTH_CANCELED;
+ break;
+ case ERROR_AUTH_REJECTED:
+ pairing_result = UMA_PAIRING_RESULT_AUTH_REJECTED;
+ break;
+ case ERROR_AUTH_TIMEOUT:
+ pairing_result = UMA_PAIRING_RESULT_AUTH_TIMEOUT;
+ break;
+ case ERROR_UNSUPPORTED_DEVICE:
+ pairing_result = UMA_PAIRING_RESULT_UNSUPPORTED_DEVICE;
+ break;
+ default:
+ pairing_result = UMA_PAIRING_RESULT_UNKNOWN_ERROR;
+ }
+ }
+
+ UMA_HISTOGRAM_ENUMERATION("Bluetooth.PairingResult",
+ pairing_result,
+ UMA_PAIRING_RESULT_COUNT);
+}
+
} // namespace chromeos
diff --git a/device/bluetooth/bluetooth_device_experimental_chromeos.h b/device/bluetooth/bluetooth_device_experimental_chromeos.h
index a260bec..0a19d26 100644
--- a/device/bluetooth/bluetooth_device_experimental_chromeos.h
+++ b/device/bluetooth/bluetooth_device_experimental_chromeos.h
@@ -27,7 +27,11 @@ class BluetoothDeviceExperimentalChromeOS
private chromeos::ExperimentalBluetoothAgentServiceProvider::Delegate {
public:
// BluetoothDevice override
+ virtual uint32 GetBluetoothClass() const OVERRIDE;
virtual std::string GetAddress() const OVERRIDE;
+ virtual uint16 GetVendorID() const OVERRIDE;
+ virtual uint16 GetProductID() const OVERRIDE;
+ virtual uint16 GetDeviceID() const OVERRIDE;
virtual bool IsPaired() const OVERRIDE;
virtual bool IsConnected() const OVERRIDE;
virtual bool IsConnectable() const OVERRIDE;
@@ -72,7 +76,6 @@ class BluetoothDeviceExperimentalChromeOS
protected:
// BluetoothDevice override
- virtual uint32 GetBluetoothClass() const OVERRIDE;
virtual std::string GetDeviceName() const OVERRIDE;
private:
@@ -167,6 +170,11 @@ class BluetoothDeviceExperimentalChromeOS
// pairing. Returns true if any callbacks were run, false if not.
bool RunPairingCallbacks(Status status);
+ // Record the result of pairing as a UMA histogram metric; |success| should
+ // be true if pairing succeeded, and |false| if not - in which case
+ // |error_code| specifies the reason for failure.
+ void RecordPairingResult(bool success, ConnectErrorCode error_code);
+
// Return the object path of the device; used by
// BluetoothAdapterExperimentalChromeOS
const dbus::ObjectPath& object_path() const { return object_path_; }
@@ -185,6 +193,10 @@ class BluetoothDeviceExperimentalChromeOS
// Passkeys. Generally it is the object that owns this one.
PairingDelegate* pairing_delegate_;
+ // Flag to indicate whether a pairing delegate method has been called during
+ // pairing.
+ bool pairing_delegate_used_;
+
// During pairing this is set to an instance of a D-Bus agent object
// intialized with our own class as its delegate.
scoped_ptr<ExperimentalBluetoothAgentServiceProvider> agent_;
diff --git a/device/bluetooth/bluetooth_device_mac.h b/device/bluetooth/bluetooth_device_mac.h
index 81ae518..d3beb0f 100644
--- a/device/bluetooth/bluetooth_device_mac.h
+++ b/device/bluetooth/bluetooth_device_mac.h
@@ -24,7 +24,11 @@ class BluetoothDeviceMac : public BluetoothDevice {
virtual ~BluetoothDeviceMac();
// BluetoothDevice override
+ virtual uint32 GetBluetoothClass() const OVERRIDE;
virtual std::string GetAddress() const OVERRIDE;
+ virtual uint16 GetVendorID() const OVERRIDE;
+ virtual uint16 GetProductID() const OVERRIDE;
+ virtual uint16 GetDeviceID() const OVERRIDE;
virtual bool IsPaired() const OVERRIDE;
virtual bool IsConnected() const OVERRIDE;
virtual bool IsConnectable() const OVERRIDE;
@@ -69,7 +73,6 @@ class BluetoothDeviceMac : public BluetoothDevice {
protected:
// BluetoothDevice override
- virtual uint32 GetBluetoothClass() const OVERRIDE;
virtual std::string GetDeviceName() const OVERRIDE;
private:
diff --git a/device/bluetooth/bluetooth_device_mac.mm b/device/bluetooth/bluetooth_device_mac.mm
index 2042eaf..ef54af1 100644
--- a/device/bluetooth/bluetooth_device_mac.mm
+++ b/device/bluetooth/bluetooth_device_mac.mm
@@ -82,6 +82,18 @@ std::string BluetoothDeviceMac::GetAddress() const {
return base::SysNSStringToUTF8([device_ addressString]);
}
+uint16 BluetoothDeviceMac::GetVendorID() const {
+ return 0;
+}
+
+uint16 BluetoothDeviceMac::GetProductID() const {
+ return 0;
+}
+
+uint16 BluetoothDeviceMac::GetDeviceID() const {
+ return 0;
+}
+
bool BluetoothDeviceMac::IsPaired() const {
return [device_ isPaired];
}
diff --git a/device/bluetooth/bluetooth_device_win.cc b/device/bluetooth/bluetooth_device_win.cc
index cfe9ac9..7779166 100644
--- a/device/bluetooth/bluetooth_device_win.cc
+++ b/device/bluetooth/bluetooth_device_win.cc
@@ -71,6 +71,18 @@ std::string BluetoothDeviceWin::GetAddress() const {
return address_;
}
+uint16 BluetoothDeviceWin::GetVendorID() const {
+ return 0;
+}
+
+uint16 BluetoothDeviceWin::GetProductID() const {
+ return 0;
+}
+
+uint16 BluetoothDeviceWin::GetDeviceID() const {
+ return 0;
+}
+
bool BluetoothDeviceWin::IsPaired() const {
return paired_;
}
diff --git a/device/bluetooth/bluetooth_device_win.h b/device/bluetooth/bluetooth_device_win.h
index be0e257..6bfdf92 100644
--- a/device/bluetooth/bluetooth_device_win.h
+++ b/device/bluetooth/bluetooth_device_win.h
@@ -23,7 +23,11 @@ class BluetoothDeviceWin : public BluetoothDevice {
virtual ~BluetoothDeviceWin();
// BluetoothDevice override
+ virtual uint32 GetBluetoothClass() const OVERRIDE;
virtual std::string GetAddress() const OVERRIDE;
+ virtual uint16 GetVendorID() const OVERRIDE;
+ virtual uint16 GetProductID() const OVERRIDE;
+ virtual uint16 GetDeviceID() const OVERRIDE;
virtual bool IsPaired() const OVERRIDE;
virtual bool IsConnected() const OVERRIDE;
virtual bool IsConnectable() const OVERRIDE;
@@ -68,7 +72,6 @@ class BluetoothDeviceWin : public BluetoothDevice {
protected:
// BluetoothDevice override
- virtual uint32 GetBluetoothClass() const OVERRIDE;
virtual std::string GetDeviceName() const OVERRIDE;
private:
diff --git a/device/bluetooth/bluetooth_experimental_chromeos_unittest.cc b/device/bluetooth/bluetooth_experimental_chromeos_unittest.cc
index 9d668f4..d868a5b 100644
--- a/device/bluetooth/bluetooth_experimental_chromeos_unittest.cc
+++ b/device/bluetooth/bluetooth_experimental_chromeos_unittest.cc
@@ -764,6 +764,10 @@ TEST_F(BluetoothExperimentalChromeOSTest, DeviceProperties) {
ASSERT_EQ(2U, uuids.size());
EXPECT_EQ(uuids[0], "00001800-0000-1000-8000-00805f9b34fb");
EXPECT_EQ(uuids[1], "00001801-0000-1000-8000-00805f9b34fb");
+
+ EXPECT_EQ(0x05ac, devices[0]->GetVendorID());
+ EXPECT_EQ(0x030d, devices[0]->GetProductID());
+ EXPECT_EQ(0x0306, devices[0]->GetDeviceID());
}
TEST_F(BluetoothExperimentalChromeOSTest, DeviceClassChanged) {
diff --git a/device/bluetooth/test/mock_bluetooth_device.h b/device/bluetooth/test/mock_bluetooth_device.h
index b2b93d5..d61f6ff 100644
--- a/device/bluetooth/test/mock_bluetooth_device.h
+++ b/device/bluetooth/test/mock_bluetooth_device.h
@@ -29,6 +29,9 @@ class MockBluetoothDevice : public BluetoothDevice {
MOCK_CONST_METHOD0(GetBluetoothClass, uint32());
MOCK_CONST_METHOD0(GetDeviceName, std::string());
MOCK_CONST_METHOD0(GetAddress, std::string());
+ MOCK_CONST_METHOD0(GetVendorID, uint16());
+ MOCK_CONST_METHOD0(GetProductID, uint16());
+ MOCK_CONST_METHOD0(GetDeviceID, uint16());
MOCK_CONST_METHOD0(GetName, string16());
MOCK_CONST_METHOD0(GetDeviceType, BluetoothDevice::DeviceType());
MOCK_CONST_METHOD0(IsPaired, bool());