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

Issue 2046283003: Add unit test for ArcBluetoothBridge and TypeConverter (Closed)

Created:
4 years, 6 months ago by puthik_chromium
Modified:
4 years, 4 months ago
CC:
chromium-reviews, elijahtaylor+arcwatch_chromium.org, hidehiko+watch_chromium.org, lhchavez+watch_chromium.org, yusukes+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@bt
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add unit test for ArcBluetoothBridge and TypeConverter - Refactor ArcBluetoothBridge to make it easier for testing. - Add new FakeBluetoothInstance class that simulate Android side Bluetooth ARC - Add tests for BluetoothTypeConverter - Add tests for ArcBluetoothBridge BUG=b:28250518 TEST=Build / Run tests Committed: https://crrev.com/7851146bed75ddf054e1b755c337018753951a3a Cr-Commit-Position: refs/heads/master@{#409945}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : WIP: Add fake BT instance #

Patch Set 4 : Add DeviceFound test #

Patch Set 5 : Add AdvertiseData test #

Patch Set 6 : rebase to latest bt #

Patch Set 7 : rebase #

Total comments: 7

Patch Set 8 : Use fake dbus client instead of mock Bluetooth type #

Total comments: 3

Patch Set 9 : Refactor to use instance holder #

Patch Set 10 : Use std::unique_ptr for fake arcbridge #

Total comments: 8

Patch Set 11 : Fix unique pointer #

Total comments: 2

Patch Set 12 : Fix #11 nit #

Total comments: 2

Patch Set 13 : Fix rkc@ nit / buildbot error #

Total comments: 4

Patch Set 14 : Address palmer's nit #

Patch Set 15 : Range check in type_converters #

Unified diffs Side-by-side diffs Delta from patch set Stats (+557 lines, -2 lines) Patch
M components/arc/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +5 lines, -0 lines 0 comments Download
A components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +205 lines, -0 lines 0 comments Download
M components/arc/bluetooth/bluetooth_type_converters.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +10 lines, -2 lines 0 comments Download
A components/arc/bluetooth/bluetooth_type_converters_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +83 lines, -0 lines 0 comments Download
A components/arc/test/fake_bluetooth_instance.h View 1 2 3 4 5 6 7 8 1 chunk +143 lines, -0 lines 0 comments Download
A components/arc/test/fake_bluetooth_instance.cc View 1 2 3 4 5 6 7 8 1 chunk +111 lines, -0 lines 0 comments Download

Messages

Total messages: 62 (27 generated)
puthik_chromium
4 years, 6 months ago (2016-06-08 23:55:54 UTC) #2
rkc
Any update on this?
4 years, 6 months ago (2016-06-10 21:40:58 UTC) #3
puthik_chromium
Will add lhchavez@ for owner approval once got l-g-t-m from you
4 years, 6 months ago (2016-06-14 22:07:00 UTC) #5
puthik_chromium
I think these tests are probably enough for the easy to break thing.
4 years, 6 months ago (2016-06-15 21:57:02 UTC) #6
puthik_chromium
4 years, 6 months ago (2016-06-18 00:21:11 UTC) #8
rkc
Opal, I apologize for taking so long for this review, but I wanted to create ...
4 years, 6 months ago (2016-06-19 18:45:43 UTC) #9
puthik_chromium
I rewrite the test to use fake dbus layer instead. The bluez::FakeBluetoothDeviceClient::CreateDevice(kLowEnergyPath) will conveniently create ...
4 years, 6 months ago (2016-06-22 23:38:54 UTC) #10
rkc
Excellent! Thanks for doing this! lgtm
4 years, 6 months ago (2016-06-24 17:19:56 UTC) #11
puthik_chromium
lhchavez@ PTAL
4 years, 6 months ago (2016-06-24 18:00:24 UTC) #12
Luis Héctor Chávez
https://codereview.chromium.org/2046283003/diff/140001/components/arc/arc_bridge_service.h File components/arc/arc_bridge_service.h (right): https://codereview.chromium.org/2046283003/diff/140001/components/arc/arc_bridge_service.h#newcode195 components/arc/arc_bridge_service.h:195: virtual mojom::BluetoothInstance* bluetooth_instance(); ouch. you can't have name this ...
4 years, 5 months ago (2016-06-27 20:19:56 UTC) #13
Luis Héctor Chávez
Had an offline discussion. I'm going to migrate _all_ methods of ArcBridgeService to be virtual ...
4 years, 5 months ago (2016-06-27 20:26:29 UTC) #14
rkc
Luis: Ping :) Now that branch is done, we should look at landing this so ...
4 years, 5 months ago (2016-07-01 22:37:10 UTC) #15
Luis Héctor Chávez
On 2016/07/01 22:37:10, rkc wrote: > Luis: Ping :) > Now that branch is done, ...
4 years, 5 months ago (2016-07-06 22:32:58 UTC) #16
Luis Héctor Chávez
https://codereview.chromium.org/2046283003/diff/140001/components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc File components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc (right): https://codereview.chromium.org/2046283003/diff/140001/components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc#newcode87 components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc:87: delete fake_arc_bridge_service_; Try to avoid this raw pointers as ...
4 years, 5 months ago (2016-07-06 22:34:27 UTC) #17
Luis Héctor Chávez
On 2016/07/06 22:34:27, Luis Héctor Chávez wrote: > https://codereview.chromium.org/2046283003/diff/140001/components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc > File components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc (right): > > ...
4 years, 5 months ago (2016-07-08 18:05:03 UTC) #18
Luis Héctor Chávez
On 2016/07/08 18:05:03, Luis Héctor Chávez wrote: > On 2016/07/06 22:34:27, Luis Héctor Chávez wrote: ...
4 years, 5 months ago (2016-07-13 15:20:32 UTC) #19
Luis Héctor Chávez
On 2016/07/13 15:20:32, Luis Héctor Chávez wrote: > On 2016/07/08 18:05:03, Luis Héctor Chávez wrote: ...
4 years, 5 months ago (2016-07-14 16:31:01 UTC) #20
puthik_chromium
Will add more test in another CLs. I don't want it to be too big. ...
4 years, 4 months ago (2016-07-27 01:14:53 UTC) #23
Luis Héctor Chávez
https://codereview.chromium.org/2046283003/diff/180001/components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc File components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc (right): https://codereview.chromium.org/2046283003/diff/180001/components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc#newcode61 components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc:61: base::WrapUnique(fake_bluetooth_device_client_)); This pattern looks very bad (you are keeping ...
4 years, 4 months ago (2016-07-29 23:09:09 UTC) #30
rkc
https://codereview.chromium.org/2046283003/diff/180001/components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc File components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc (right): https://codereview.chromium.org/2046283003/diff/180001/components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc#newcode61 components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc:61: base::WrapUnique(fake_bluetooth_device_client_)); On 2016/07/29 23:09:09, Luis Héctor Chávez wrote: > ...
4 years, 4 months ago (2016-07-30 22:40:55 UTC) #31
puthik_chromium
https://codereview.chromium.org/2046283003/diff/180001/components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc File components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc (right): https://codereview.chromium.org/2046283003/diff/180001/components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc#newcode61 components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc:61: base::WrapUnique(fake_bluetooth_device_client_)); On 2016/07/30 22:40:55, rkc wrote: > On 2016/07/29 ...
4 years, 4 months ago (2016-08-01 18:02:48 UTC) #32
Luis Héctor Chávez
lgtm https://codereview.chromium.org/2046283003/diff/180001/components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc File components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc (right): https://codereview.chromium.org/2046283003/diff/180001/components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc#newcode96 components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc:96: EXPECT_EQ((size_t)0, fake_bluetooth_instance_->device_found_data().size()); On 2016/08/01 18:02:48, puthik_chromium wrote: > ...
4 years, 4 months ago (2016-08-01 18:10:58 UTC) #33
rkc
re-lgtm % comment https://codereview.chromium.org/2046283003/diff/220001/components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc File components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc (right): https://codereview.chromium.org/2046283003/diff/220001/components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc#newcode51 components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc:51: std::unique_ptr<FakeArcBridgeService> fake_arc_bridge_service_; Move to the bottom ...
4 years, 4 months ago (2016-08-01 19:24:39 UTC) #38
puthik_chromium
https://codereview.chromium.org/2046283003/diff/200001/components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc File components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc (right): https://codereview.chromium.org/2046283003/diff/200001/components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc#newcode64 components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc:64: auto fake_bluetooth_device_client_ = On 2016/08/01 18:10:58, Luis Héctor Chávez ...
4 years, 4 months ago (2016-08-01 22:13:05 UTC) #39
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/2046283003/240001
4 years, 4 months ago (2016-08-01 22:13:41 UTC) #42
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/228868)
4 years, 4 months ago (2016-08-01 22:20:03 UTC) #44
puthik_chromium
+palmer Apparently, unit test for bluetooth type converters need security review.
4 years, 4 months ago (2016-08-01 22:35:50 UTC) #46
palmer
Yes, type_converter files count as security-sensitive IPC files. Sorry. :) https://codereview.chromium.org/2046283003/diff/240001/components/arc/bluetooth/bluetooth_type_converters_unittest.cc File components/arc/bluetooth/bluetooth_type_converters_unittest.cc (right): https://codereview.chromium.org/2046283003/diff/240001/components/arc/bluetooth/bluetooth_type_converters_unittest.cc#newcode18 ...
4 years, 4 months ago (2016-08-03 21:16:44 UTC) #47
puthik_chromium
https://codereview.chromium.org/2046283003/diff/240001/components/arc/bluetooth/bluetooth_type_converters_unittest.cc File components/arc/bluetooth/bluetooth_type_converters_unittest.cc (right): https://codereview.chromium.org/2046283003/diff/240001/components/arc/bluetooth/bluetooth_type_converters_unittest.cc#newcode18 components/arc/bluetooth/bluetooth_type_converters_unittest.cc:18: const std::string kAddressStr = "1A:2B:3C:4D:5E:6F"; On 2016/08/03 21:16:44, palmer ...
4 years, 4 months ago (2016-08-03 22:49:42 UTC) #48
palmer
> There is a high chance that it will crash if the input is bogus. ...
4 years, 4 months ago (2016-08-04 20:52:56 UTC) #49
puthik_chromium
On 2016/08/04 20:52:56, palmer (OOO thru August)) wrote: > > There is a high chance ...
4 years, 4 months ago (2016-08-04 22:35:57 UTC) #52
palmer
LGTM. Thank you!
4 years, 4 months ago (2016-08-04 23:51:53 UTC) #53
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/2046283003/280001
4 years, 4 months ago (2016-08-05 00:19:30 UTC) #58
commit-bot: I haz the power
Committed patchset #15 (id:280001)
4 years, 4 months ago (2016-08-05 00:25:41 UTC) #60
commit-bot: I haz the power
4 years, 4 months ago (2016-08-05 00:27:36 UTC) #62
Message was sent while issue was closed.
Patchset 15 (id:??) landed as
https://crrev.com/7851146bed75ddf054e1b755c337018753951a3a
Cr-Commit-Position: refs/heads/master@{#409945}

Powered by Google App Engine
This is Rietveld 408576698