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

Issue 2883903002: Add service unittest for WakeLockServiceImpl. (Closed)

Created:
3 years, 7 months ago by ke.he
Modified:
3 years, 6 months ago
CC:
chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add service unittest for WakeLockServiceImpl. To avoid let service unittest depend on "xvfb", we use the FakeWakeLockServiceImpl which doesn't create the real PowerSaveBlocker instance during testing. BUG=689410 Review-Url: https://codereview.chromium.org/2883903002 Cr-Commit-Position: refs/heads/master@{#477200} Committed: https://chromium.googlesource.com/chromium/src/+/4d8a87f26e4b1027bd9281e4006506ab0f983732

Patch Set 1 #

Total comments: 9

Patch Set 2 : Addressed Colin's review comments #

Total comments: 13

Patch Set 3 : Add service unittest for WakeLockServiceImpl. #

Patch Set 4 : "console_test_launcher" -> "windowed_test_launcher" #

Total comments: 2

Patch Set 5 : Add FakeWakeLockServiceImpl. #

Total comments: 7

Patch Set 6 : Rename Fake* to *ForTesting #

Unified diffs Side-by-side diffs Delta from patch set Stats (+342 lines, -11 lines) Patch
M device/wake_lock/BUILD.gn View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M device/wake_lock/wake_lock_provider.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M device/wake_lock/wake_lock_provider.cc View 1 2 3 4 5 2 chunks +15 lines, -4 lines 0 comments Download
M device/wake_lock/wake_lock_service_impl.h View 1 2 3 4 5 1 chunk +7 lines, -4 lines 0 comments Download
M device/wake_lock/wake_lock_service_impl.cc View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
A device/wake_lock/wake_lock_service_impl_for_testing.h View 1 2 3 4 5 1 chunk +47 lines, -0 lines 0 comments Download
A device/wake_lock/wake_lock_service_impl_for_testing.cc View 1 2 3 4 5 1 chunk +57 lines, -0 lines 0 comments Download
M services/device/BUILD.gn View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M services/device/unittest_manifest.json View 1 chunk +2 lines, -1 line 0 comments Download
A services/device/wake_lock/OWNERS View 1 chunk +1 line, -0 lines 0 comments Download
A services/device/wake_lock/wake_lock_service_impl_unittest.cc View 1 2 3 4 1 chunk +205 lines, -0 lines 0 comments Download

Messages

Total messages: 69 (35 generated)
ke.he
Colin, PTAL. Thanks!
3 years, 7 months ago (2017-05-15 10:45:12 UTC) #6
blundell
This is fantastic, thanks! Exactly along the lines of what I was hoping for. LGTM ...
3 years, 7 months ago (2017-05-16 13:37:55 UTC) #7
ke.he
Thanks Colin! Scottmg@, PTAL on power_save_blocker_x11.cc, Thanks! https://codereview.chromium.org/2883903002/diff/1/device/power_save_blocker/power_save_blocker_x11.cc File device/power_save_blocker/power_save_blocker_x11.cc (right): https://codereview.chromium.org/2883903002/diff/1/device/power_save_blocker/power_save_blocker_x11.cc#newcode444 device/power_save_blocker/power_save_blocker_x11.cc:444: // In ...
3 years, 7 months ago (2017-05-17 07:19:54 UTC) #11
blundell
https://codereview.chromium.org/2883903002/diff/1/device/power_save_blocker/power_save_blocker_x11.cc File device/power_save_blocker/power_save_blocker_x11.cc (right): https://codereview.chromium.org/2883903002/diff/1/device/power_save_blocker/power_save_blocker_x11.cc#newcode444 device/power_save_blocker/power_save_blocker_x11.cc:444: // In service_unittests context, XDisplay is not well initialized. ...
3 years, 7 months ago (2017-05-17 09:01:42 UTC) #14
ke.he
On 2017/05/17 09:01:42, blundell wrote: > https://codereview.chromium.org/2883903002/diff/1/device/power_save_blocker/power_save_blocker_x11.cc > File device/power_save_blocker/power_save_blocker_x11.cc (right): > > https://codereview.chromium.org/2883903002/diff/1/device/power_save_blocker/power_save_blocker_x11.cc#newcode444 > ...
3 years, 7 months ago (2017-05-17 10:20:35 UTC) #15
blundell
On 2017/05/17 10:20:35, ke.he wrote: > On 2017/05/17 09:01:42, blundell wrote: > > > https://codereview.chromium.org/2883903002/diff/1/device/power_save_blocker/power_save_blocker_x11.cc ...
3 years, 7 months ago (2017-05-17 15:22:04 UTC) #16
scottmg
https://codereview.chromium.org/2883903002/diff/20001/device/power_save_blocker/power_save_blocker_x11.cc File device/power_save_blocker/power_save_blocker_x11.cc (right): https://codereview.chromium.org/2883903002/diff/20001/device/power_save_blocker/power_save_blocker_x11.cc#newcode445 device/power_save_blocker/power_save_blocker_x11.cc:445: // nullptr to XScreenSaverQueryExtension() will cause crash. nit; if ...
3 years, 7 months ago (2017-05-17 16:00:33 UTC) #17
ke.he
> Could you recheck this? At the top of WakeLockServiceImplTest::SetUp(), I added > > DCHECK(gfx::InitializeThreadedX11()); ...
3 years, 7 months ago (2017-05-18 06:09:11 UTC) #18
ke.he
I think we should make sure the executable service_unittest pass both with and without the ...
3 years, 7 months ago (2017-05-18 06:22:35 UTC) #19
scottmg
On 2017/05/18 06:22:35, ke.he wrote: > I think we should make sure the executable service_unittest ...
3 years, 7 months ago (2017-05-18 15:35:09 UTC) #22
ke.he
Thanks! https://codereview.chromium.org/2883903002/diff/20001/device/power_save_blocker/power_save_blocker_x11.cc File device/power_save_blocker/power_save_blocker_x11.cc (right): https://codereview.chromium.org/2883903002/diff/20001/device/power_save_blocker/power_save_blocker_x11.cc#newcode445 device/power_save_blocker/power_save_blocker_x11.cc:445: // nullptr to XScreenSaverQueryExtension() will cause crash. On ...
3 years, 7 months ago (2017-05-19 03:46:51 UTC) #24
hashimoto
On 2017/05/18 15:35:09, scottmg wrote: > On 2017/05/18 06:22:35, ke.he wrote: > > I think ...
3 years, 7 months ago (2017-05-19 10:49:10 UTC) #28
blundell
I don't understand why this test is passing on all the bots: it fails for ...
3 years, 7 months ago (2017-05-22 10:05:40 UTC) #29
ke.he
I can see the "service_unittests" did be executed in "linux_chromium_rel_ng" trybot, but cannot find the ...
3 years, 7 months ago (2017-05-22 10:49:16 UTC) #30
ke.he
On 2017/05/22 10:49:16, ke.he wrote: > I can see the "service_unittests" did be executed in ...
3 years, 7 months ago (2017-05-23 08:33:25 UTC) #31
blundell
On 2017/05/23 08:33:25, ke.he wrote: > On 2017/05/22 10:49:16, ke.he wrote: > > I can ...
3 years, 7 months ago (2017-05-23 08:39:10 UTC) #32
ke.he
On 2017/05/23 08:39:10, blundell wrote: > On 2017/05/23 08:33:25, ke.he wrote: > > On 2017/05/22 ...
3 years, 7 months ago (2017-05-23 11:06:55 UTC) #33
scottmg
On 2017/05/23 11:06:55, ke.he wrote: > On 2017/05/23 08:39:10, blundell wrote: > > On 2017/05/23 ...
3 years, 7 months ago (2017-05-23 21:18:14 UTC) #34
ke.he
As hashimoto mentioned, there is other unittest use the XDisplay too. One example is //ui/events/events_unittests. ...
3 years, 7 months ago (2017-05-24 03:43:30 UTC) #35
scottmg
On 2017/05/24 03:43:30, ke.he wrote: > As hashimoto mentioned, there is other unittest use the ...
3 years, 7 months ago (2017-05-24 03:46:14 UTC) #36
ke.he
Scottmg@, Thanks very much!
3 years, 7 months ago (2017-05-24 04:00:40 UTC) #37
ke.he
Jbudorick@, PTAL on "testing/buildbot/gn_isolate_map.pyl". Thanks.
3 years, 7 months ago (2017-05-24 05:30:34 UTC) #42
blundell
lgtm with question https://codereview.chromium.org/2883903002/diff/60001/testing/buildbot/gn_isolate_map.pyl File testing/buildbot/gn_isolate_map.pyl (right): https://codereview.chromium.org/2883903002/diff/60001/testing/buildbot/gn_isolate_map.pyl#newcode870 testing/buildbot/gn_isolate_map.pyl:870: "type": "windowed_test_launcher", What does this change ...
3 years, 7 months ago (2017-05-24 13:03:19 UTC) #45
jbudorick
//testing/buildbot/ lgtm https://codereview.chromium.org/2883903002/diff/60001/testing/buildbot/gn_isolate_map.pyl File testing/buildbot/gn_isolate_map.pyl (right): https://codereview.chromium.org/2883903002/diff/60001/testing/buildbot/gn_isolate_map.pyl#newcode870 testing/buildbot/gn_isolate_map.pyl:870: "type": "windowed_test_launcher", On 2017/05/24 13:03:19, blundell wrote: ...
3 years, 7 months ago (2017-05-24 13:11:09 UTC) #46
blundell
On 2017/05/24 13:11:09, jbudorick wrote: > //testing/buildbot/ lgtm > > https://codereview.chromium.org/2883903002/diff/60001/testing/buildbot/gn_isolate_map.pyl > File testing/buildbot/gn_isolate_map.pyl (right): ...
3 years, 7 months ago (2017-05-24 13:15:29 UTC) #47
ke.he
Hi, Colin, Yeah I totally agree we should go with mock the WakeLockServiceImpl instead of ...
3 years, 7 months ago (2017-05-25 09:20:57 UTC) #50
blundell
Thanks, this is along the lines of what I was thinking :). https://codereview.chromium.org/2883903002/diff/80001/device/wake_lock/fake_wake_lock_service_impl.h File device/wake_lock/fake_wake_lock_service_impl.h ...
3 years, 6 months ago (2017-05-29 13:17:09 UTC) #54
ke.he
https://codereview.chromium.org/2883903002/diff/80001/device/wake_lock/fake_wake_lock_service_impl.h File device/wake_lock/fake_wake_lock_service_impl.h (right): https://codereview.chromium.org/2883903002/diff/80001/device/wake_lock/fake_wake_lock_service_impl.h#newcode21 device/wake_lock/fake_wake_lock_service_impl.h:21: class FakeWakeLockServiceImpl : public WakeLockServiceImpl { On 2017/05/29 13:17:08, ...
3 years, 6 months ago (2017-05-31 11:38:15 UTC) #55
blundell
LGTM. Thanks for the explanation. https://codereview.chromium.org/2883903002/diff/80001/device/wake_lock/fake_wake_lock_service_impl.cc File device/wake_lock/fake_wake_lock_service_impl.cc (right): https://codereview.chromium.org/2883903002/diff/80001/device/wake_lock/fake_wake_lock_service_impl.cc#newcode11 device/wake_lock/fake_wake_lock_service_impl.cc:11: FakeWakeLockServiceImpl::FakeWakeLockServiceImpl( nit: Let's call ...
3 years, 6 months ago (2017-06-01 11:35:58 UTC) #56
ke.he
https://codereview.chromium.org/2883903002/diff/80001/device/wake_lock/wake_lock_provider.cc File device/wake_lock/wake_lock_provider.cc (right): https://codereview.chromium.org/2883903002/diff/80001/device/wake_lock/wake_lock_provider.cc#newcode52 device/wake_lock/wake_lock_provider.cc:52: new FakeWakeLockServiceImpl( If we move the "WakeLockServiceImplForTesting" into services/device/wake_lock/, ...
3 years, 6 months ago (2017-06-04 10:33:45 UTC) #57
blundell
On 2017/06/04 10:33:45, ke.he wrote: > https://codereview.chromium.org/2883903002/diff/80001/device/wake_lock/wake_lock_provider.cc > File device/wake_lock/wake_lock_provider.cc (right): > > https://codereview.chromium.org/2883903002/diff/80001/device/wake_lock/wake_lock_provider.cc#newcode52 > ...
3 years, 6 months ago (2017-06-05 11:42:14 UTC) #58
ke.he
Thanks! https://codereview.chromium.org/2883903002/diff/80001/device/wake_lock/fake_wake_lock_service_impl.cc File device/wake_lock/fake_wake_lock_service_impl.cc (right): https://codereview.chromium.org/2883903002/diff/80001/device/wake_lock/fake_wake_lock_service_impl.cc#newcode11 device/wake_lock/fake_wake_lock_service_impl.cc:11: FakeWakeLockServiceImpl::FakeWakeLockServiceImpl( On 2017/06/01 11:35:58, blundell wrote: > nit: ...
3 years, 6 months ago (2017-06-06 05:25:57 UTC) #63
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/2883903002/100001
3 years, 6 months ago (2017-06-06 05:28:50 UTC) #66
commit-bot: I haz the power
3 years, 6 months ago (2017-06-06 05:33:01 UTC) #69
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as
https://chromium.googlesource.com/chromium/src/+/4d8a87f26e4b1027bd9281e40065...

Powered by Google App Engine
This is Rietveld 408576698