Descriptionbluetooth: 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 #Messages
Total messages: 5 (0 generated)
|