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

Issue 768113006: Resurrect battery_status_dispatcher_unittest. (Closed)

Created:
6 years ago by timvolodine
Modified:
5 years, 11 months ago
CC:
chromium-reviews, mkwst+moarreviews-renderer_chromium.org, darin-cc_chromium.org, jam, mlamouri+watch-content_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Resurrect battery_status_dispatcher_unittest. While still in the code base the battery_status_dispatcher_unittest.cc is not included in content_unittests. This patch rewrites this test to match the new mojo-implementation of the battery_status_dispatcher and includes it in content_unittests. BUG= Committed: https://crrev.com/88d1c9a4473a40c07751a839ff22425eaa97a999 Cr-Commit-Position: refs/heads/master@{#310103}

Patch Set 1 #

Patch Set 2 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -41 lines) Patch
M content/content_tests.gypi View 1 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/battery_status/battery_status_dispatcher.h View 1 chunk +2 lines, -3 lines 0 comments Download
M content/renderer/battery_status/battery_status_dispatcher.cc View 1 chunk +5 lines, -2 lines 0 comments Download
M content/renderer/battery_status/battery_status_dispatcher_unittest.cc View 3 chunks +29 lines, -36 lines 0 comments Download

Messages

Total messages: 11 (3 generated)
timvolodine
6 years ago (2014-12-08 19:30:06 UTC) #2
Michael van Ouwerkerk
lgtm but some bots are failing to build
6 years ago (2014-12-08 20:26:17 UTC) #3
timvolodine
On 2014/12/08 20:26:17, Michael van Ouwerkerk wrote: > lgtm but some bots are failing to ...
5 years, 11 months ago (2015-01-06 16:42:46 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/768113006/20001
5 years, 11 months ago (2015-01-06 16:43:16 UTC) #6
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 11 months ago (2015-01-06 17:31:54 UTC) #7
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/88d1c9a4473a40c07751a839ff22425eaa97a999 Cr-Commit-Position: refs/heads/master@{#310103}
5 years, 11 months ago (2015-01-06 17:32:38 UTC) #8
darin (slow to review)
It occurs to me that this test is not really all that interesting. It seems ...
5 years, 11 months ago (2015-01-07 06:39:29 UTC) #10
timvolodine
5 years, 11 months ago (2015-01-07 14:53:50 UTC) #11
Message was sent while issue was closed.
On 2015/01/07 06:39:29, darin wrote:
> It occurs to me that this test is not really all that interesting. It seems to
> just test conversion between device::BatteryStatus and
blink::WebBatteryStatus.
> 
> The test has the side-effect of forcing BatteryStatusDispatcher to have to
deal
> with the ServiceRegistry not being present, which is not something that ever
> happens when running inside Chrome.
> 
> Another approach might be to dependency inject the ServiceRegistry and then
> provide one in the unit test along with a fake BatteryMonitor implementation.

Yes on second thought this is even somewhat covered by the browser-test we have
for battery, so technically we could probably remove this unittest altogether.

However it may still be interesting to have the unittest by means of an example.
I'll try to investigate the dependency injection suggestion as it would simplify
the BatteryStatusDispatcher code (especially wrt your new patch). I am assuming
by dependency injection you meant passing the ServiceRegistry in the constructor
of BatteryStatusDispatcher?

Powered by Google App Engine
This is Rietveld 408576698