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

Issue 10831360: bluetooth: Improve testability (Closed)

Created:
8 years, 4 months ago by keybuk
Modified:
8 years, 4 months ago
Reviewers:
bryeung, Nico, satorux1
CC:
chromium-reviews, oshima+watch_chromium.org, stevenjb+watch_chromium.org, nkostylev+watch_chromium.org, davemoore+watch_chromium.org
Visibility:
Public.

Description

bluetooth: Improve testability Make a bunch of changes to the bluetooth code to improve its testability: - BluetoothAdapter and BluetoothDevice base observer and delegate classes made public, allows a test to static cast the pointer and call those methods as if it were the dbus client. - Add MockBluetoothAdapter::Observer and MockBluetoothDevice::Observer classes; these can be used by tests to check BluetoothAdapter and BluetoothDevice call observer methods at the correct time, with the correct arguments. - Add MockBluetooth*Client::Properties classes; these mock out the Get(), GetAll() and Set() methods so a test can verify whether or not they're called. Tests can also use MockBluetooth*Client::GetProperties() to return one of these mock classes constructed statically in the test, using ReplaceValue() on each property to set values. BUG=none TEST=can write a unit test Change-Id: I9eaeb6412de891f9b1b3cdaae66d32dfecbac8c9 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=152234

Patch Set 1 #

Patch Set 2 : fix observer issues picked up by clang #

Patch Set 3 : also mock out ConnectSignals and ChangedReceive #

Total comments: 1

Patch Set 4 : corect speling oof received #

Unified diffs Side-by-side diffs Delta from patch set Stats (+126 lines, -5 lines) Patch
M chrome/browser/chromeos/bluetooth/bluetooth_adapter.h View 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/bluetooth/bluetooth_device.h View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/bluetooth/test/mock_bluetooth_adapter.h View 1 1 chunk +13 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/bluetooth/test/mock_bluetooth_adapter.cc View 1 1 chunk +3 lines, -0 lines 0 comments Download
M chromeos/dbus/mock_bluetooth_adapter_client.h View 1 2 3 1 chunk +15 lines, -0 lines 0 comments Download
M chromeos/dbus/mock_bluetooth_adapter_client.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M chromeos/dbus/mock_bluetooth_device_client.h View 1 2 3 1 chunk +15 lines, -0 lines 0 comments Download
M chromeos/dbus/mock_bluetooth_device_client.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M chromeos/dbus/mock_bluetooth_input_client.h View 1 2 3 1 chunk +15 lines, -0 lines 0 comments Download
M chromeos/dbus/mock_bluetooth_input_client.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M chromeos/dbus/mock_bluetooth_manager_client.h View 1 2 3 1 chunk +15 lines, -0 lines 0 comments Download
M chromeos/dbus/mock_bluetooth_manager_client.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M chromeos/dbus/mock_bluetooth_node_client.h View 1 2 3 1 chunk +15 lines, -0 lines 0 comments Download
M chromeos/dbus/mock_bluetooth_node_client.cc View 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
keybuk
satorux for OWNERS bryeung for "omg finally"
8 years, 4 months ago (2012-08-16 23:09:58 UTC) #1
Nico
https://chromiumcodereview.appspot.com/10831360/diff/2002/chromeos/dbus/mock_bluetooth_adapter_client.h File chromeos/dbus/mock_bluetooth_adapter_client.h (right): https://chromiumcodereview.appspot.com/10831360/diff/2002/chromeos/dbus/mock_bluetooth_adapter_client.h#newcode29 chromeos/dbus/mock_bluetooth_adapter_client.h:29: MOCK_METHOD1(ChangedRecevied, void(dbus::Signal*)); Typo Recevied.
8 years, 4 months ago (2012-08-17 22:02:12 UTC) #2
satorux1
LGTM except Recevied found in many places.
8 years, 4 months ago (2012-08-17 22:24:28 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/keybuk@chromium.org/10831360/14001
8 years, 4 months ago (2012-08-18 00:49:19 UTC) #4
commit-bot: I haz the power
8 years, 4 months ago (2012-08-18 03:19:07 UTC) #5
Change committed as 152234

Powered by Google App Engine
This is Rietveld 408576698