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

Issue 2744243008: Add unit tests for BluetoothDevice::GetPrimaryServices() etc. (Closed)

Created:
3 years, 9 months ago by juncai
Modified:
3 years, 8 months ago
Reviewers:
scheib, ortuno
CC:
chromium-reviews, ortuno+watch_chromium.org, scheib+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add unit tests for BluetoothDevice::GetPrimaryServices() etc. This CL adds unit tests for the following three functions: BluetoothDevice::GetPrimaryServices() BluetoothDevice::GetPrimaryServicesByUUID() BluetoothDevice::GetCharacteristicsByUUID() BUG=552022 Review-Url: https://codereview.chromium.org/2744243008 Cr-Commit-Position: refs/heads/master@{#458146} Committed: https://chromium.googlesource.com/chromium/src/+/7f94243892116f4266e8f532db6977cd5f540c2d

Patch Set 1 : Add unit tests for BluetoothDevice::GetPrimaryServices() etc. #

Total comments: 14

Patch Set 2 : address scheib@'s comments #

Patch Set 3 : clean up code #

Total comments: 2

Patch Set 4 : address more comments #

Patch Set 5 : move test fixture to the top of the file #

Total comments: 13
Unified diffs Side-by-side diffs Delta from patch set Stats (+136 lines, -0 lines) Patch
M device/bluetooth/bluetooth_device_unittest.cc View 1 2 3 4 2 chunks +136 lines, -0 lines 13 comments Download

Messages

Total messages: 34 (22 generated)
juncai
Please take a look.
3 years, 9 months ago (2017-03-16 23:15:34 UTC) #4
scheib
https://codereview.chromium.org/2744243008/diff/1/device/bluetooth/bluetooth_device_unittest.cc File device/bluetooth/bluetooth_device_unittest.cc (right): https://codereview.chromium.org/2744243008/diff/1/device/bluetooth/bluetooth_device_unittest.cc#newcode1492 device/bluetooth/bluetooth_device_unittest.cc:1492: InitWithFakeAdapter(); There's a lot of boilerplate for these tests. ...
3 years, 9 months ago (2017-03-17 17:38:41 UTC) #7
juncai
https://codereview.chromium.org/2744243008/diff/1/device/bluetooth/bluetooth_device_unittest.cc File device/bluetooth/bluetooth_device_unittest.cc (right): https://codereview.chromium.org/2744243008/diff/1/device/bluetooth/bluetooth_device_unittest.cc#newcode1492 device/bluetooth/bluetooth_device_unittest.cc:1492: InitWithFakeAdapter(); On 2017/03/17 17:38:40, scheib wrote: > There's a ...
3 years, 9 months ago (2017-03-17 21:25:48 UTC) #12
scheib
https://codereview.chromium.org/2744243008/diff/1/device/bluetooth/bluetooth_device_unittest.cc File device/bluetooth/bluetooth_device_unittest.cc (right): https://codereview.chromium.org/2744243008/diff/1/device/bluetooth/bluetooth_device_unittest.cc#newcode1492 device/bluetooth/bluetooth_device_unittest.cc:1492: InitWithFakeAdapter(); On 2017/03/17 21:25:47, juncai wrote: > On 2017/03/17 ...
3 years, 9 months ago (2017-03-17 22:10:47 UTC) #13
juncai
https://codereview.chromium.org/2744243008/diff/1/device/bluetooth/bluetooth_device_unittest.cc File device/bluetooth/bluetooth_device_unittest.cc (right): https://codereview.chromium.org/2744243008/diff/1/device/bluetooth/bluetooth_device_unittest.cc#newcode1492 device/bluetooth/bluetooth_device_unittest.cc:1492: InitWithFakeAdapter(); On 2017/03/17 22:10:47, scheib wrote: > On 2017/03/17 ...
3 years, 9 months ago (2017-03-17 23:33:54 UTC) #16
scheib
lgtm, one last request, please keep fixtures at top of file, and I don't think ...
3 years, 9 months ago (2017-03-18 00:48:14 UTC) #19
juncai
On 2017/03/18 00:48:14, scheib wrote: > lgtm, one last request, please keep fixtures at top ...
3 years, 9 months ago (2017-03-20 18:58:30 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2744243008/80001
3 years, 9 months ago (2017-03-20 19:07:11 UTC) #27
commit-bot: I haz the power
Committed patchset #5 (id:80001) as https://chromium.googlesource.com/chromium/src/+/7f94243892116f4266e8f532db6977cd5f540c2d
3 years, 9 months ago (2017-03-20 19:16:29 UTC) #30
ortuno
Optional comments for follow up. https://codereview.chromium.org/2744243008/diff/80001/device/bluetooth/bluetooth_device_unittest.cc File device/bluetooth/bluetooth_device_unittest.cc (right): https://codereview.chromium.org/2744243008/diff/80001/device/bluetooth/bluetooth_device_unittest.cc#newcode1519 device/bluetooth/bluetooth_device_unittest.cc:1519: #if defined(OS_ANDROID) || defined(OS_MACOSX) ...
3 years, 8 months ago (2017-03-28 03:07:49 UTC) #32
juncai
https://codereview.chromium.org/2744243008/diff/80001/device/bluetooth/bluetooth_device_unittest.cc File device/bluetooth/bluetooth_device_unittest.cc (right): https://codereview.chromium.org/2744243008/diff/80001/device/bluetooth/bluetooth_device_unittest.cc#newcode1519 device/bluetooth/bluetooth_device_unittest.cc:1519: #if defined(OS_ANDROID) || defined(OS_MACOSX) On 2017/03/28 03:07:49, ortuno wrote: ...
3 years, 8 months ago (2017-03-29 17:49:53 UTC) #33
ortuno
3 years, 8 months ago (2017-03-29 22:45:43 UTC) #34
Message was sent while issue was closed.
Thanks!

https://codereview.chromium.org/2744243008/diff/80001/device/bluetooth/blueto...
File device/bluetooth/bluetooth_device_unittest.cc (right):

https://codereview.chromium.org/2744243008/diff/80001/device/bluetooth/blueto...
device/bluetooth/bluetooth_device_unittest.cc:1575:
->GetCharacteristicsByUUID(service_instance_id0,
On 2017/03/29 at 17:49:53, juncai wrote:
> On 2017/03/28 03:07:49, ortuno wrote:
> > Unrelated questions about these methods:
> > 
> > 1. Why is GetCharacteristicsByUUID in BluetoothDevice rather than in
> > BluetoothRemoteGattService? I think that would simplify the code a bit.
> > 2. Why does GetDescriptorByUUID take a characteristic but
> > GetCharacteristicsByUUID takes a characteritistic instance id?
> 
> For 1: it is mentioned in the TODO at:
>
https://codereview.chromium.org/2615323002/diff/40001/content/browser/bluetoo...
> For 2: will investigate more.

I see. Let's move them to the appropriate attribute then. That will simplify our
code and require less tests.

Powered by Google App Engine
This is Rietveld 408576698