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

Issue 2845973003: Use ScopedTaskEnvironment instead of MessageLoopForUI in chromeos tests. (Closed)

Created:
3 years, 7 months ago by fdoray
Modified:
3 years, 7 months ago
Reviewers:
gab, stevenjb
CC:
chromium-reviews, stevenjb+watch_chromium.org, oshima+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Use ScopedTaskEnvironment instead of MessageLoopForUI in chromeos tests. ScopedTaskEnvironment allows usage of ThreadTaskRunnerHandle and base/task_scheduler/post_task.h within its scope. It should be instantiated in everytest that uses either of these APIs (i.e. no test should instantiate a MessageLoop directly). Motivation for ScopedTaskEnvironment can be found in: https://docs.google.com/document/d/1QabRo8c7D9LsYY3cEcaPQbOCLo8Tu-6VLykYXyl3Pkk/edit BUG=708584 R=gab@chromium.org TBR=stevenjb@chromium.org Review-Url: https://codereview.chromium.org/2845973003 Cr-Commit-Position: refs/heads/master@{#467781} Committed: https://chromium.googlesource.com/chromium/src/+/822e6b2520c585093f6fa163b7475bd4dc77dfac

Patch Set 1 #

Total comments: 6

Patch Set 2 : self-review #

Patch Set 3 : CR #

Unified diffs Side-by-side diffs Delta from patch set Stats (+49 lines, -33 lines) Patch
M chromeos/audio/cras_audio_handler_unittest.cc View 3 chunks +5 lines, -3 lines 0 comments Download
M chromeos/cryptohome/system_salt_getter_unittest.cc View 1 2 3 chunks +6 lines, -4 lines 0 comments Download
M chromeos/network/firewall_hole_unittest.cc View 3 chunks +5 lines, -2 lines 0 comments Download
M chromeos/network/geolocation_handler_unittest.cc View 1 2 3 chunks +6 lines, -5 lines 0 comments Download
M chromeos/network/network_device_handler_unittest.cc View 1 2 3 chunks +6 lines, -5 lines 0 comments Download
M chromeos/network/network_sms_handler_unittest.cc View 3 chunks +5 lines, -3 lines 0 comments Download
M chromeos/network/network_state_handler_unittest.cc View 3 chunks +5 lines, -3 lines 0 comments Download
M chromeos/network/prohibited_technologies_handler_unittest.cc View 3 chunks +5 lines, -3 lines 0 comments Download
M chromeos/network/shill_property_handler_unittest.cc View 3 chunks +6 lines, -5 lines 0 comments Download

Messages

Total messages: 22 (14 generated)
fdoray
3 years, 7 months ago (2017-04-27 18:28:51 UTC) #1
fdoray
gab@: PTAL The change will then be TBRed to the owner.
3 years, 7 months ago (2017-04-27 18:28:54 UTC) #3
stevenjb
lgtm https://codereview.chromium.org/2845973003/diff/1/chromeos/cryptohome/system_salt_getter_unittest.cc File chromeos/cryptohome/system_salt_getter_unittest.cc (right): https://codereview.chromium.org/2845973003/diff/1/chromeos/cryptohome/system_salt_getter_unittest.cc#newcode28 chromeos/cryptohome/system_salt_getter_unittest.cc:28: fake_cryptohome_client_(NULL) {} nit: nullptr while we are here... ...
3 years, 7 months ago (2017-04-27 18:39:10 UTC) #7
fdoray
https://codereview.chromium.org/2845973003/diff/1/chromeos/cryptohome/system_salt_getter_unittest.cc File chromeos/cryptohome/system_salt_getter_unittest.cc (right): https://codereview.chromium.org/2845973003/diff/1/chromeos/cryptohome/system_salt_getter_unittest.cc#newcode28 chromeos/cryptohome/system_salt_getter_unittest.cc:28: fake_cryptohome_client_(NULL) {} On 2017/04/27 18:39:10, stevenjb wrote: > nit: ...
3 years, 7 months ago (2017-04-27 20:35:03 UTC) #14
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/2845973003/40001
3 years, 7 months ago (2017-04-27 20:35:52 UTC) #17
commit-bot: I haz the power
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/822e6b2520c585093f6fa163b7475bd4dc77dfac
3 years, 7 months ago (2017-04-27 20:47:41 UTC) #20
gab
On 2017/04/27 18:39:10, stevenjb wrote: > lgtm > > https://codereview.chromium.org/2845973003/diff/1/chromeos/cryptohome/system_salt_getter_unittest.cc > File chromeos/cryptohome/system_salt_getter_unittest.cc (right): > ...
3 years, 7 months ago (2017-04-27 20:59:48 UTC) #21
stevenjb
3 years, 7 months ago (2017-04-27 21:06:45 UTC) #22
Message was sent while issue was closed.
On 2017/04/27 20:59:48, gab wrote:
> On 2017/04/27 18:39:10, stevenjb wrote:
> > lgtm
> > 
> >
>
https://codereview.chromium.org/2845973003/diff/1/chromeos/cryptohome/system_...
> > File chromeos/cryptohome/system_salt_getter_unittest.cc (right):
> > 
> >
>
https://codereview.chromium.org/2845973003/diff/1/chromeos/cryptohome/system_...
> > chromeos/cryptohome/system_salt_getter_unittest.cc:28:
> > fake_cryptohome_client_(NULL) {}
> > nit: nullptr while we are here... bonus points for inlining.
> > 
> >
>
https://codereview.chromium.org/2845973003/diff/1/chromeos/network/geolocatio...
> > File chromeos/network/geolocation_handler_unittest.cc (right):
> > 
> >
>
https://codereview.chromium.org/2845973003/diff/1/chromeos/network/geolocatio...
> > chromeos/network/geolocation_handler_unittest.cc:27: manager_test_(NULL) {}
> > nit: nullptr
> > 
> >
>
https://codereview.chromium.org/2845973003/diff/1/chromeos/network/network_de...
> > File chromeos/network/network_device_handler_unittest.cc (right):
> > 
> >
>
https://codereview.chromium.org/2845973003/diff/1/chromeos/network/network_de...
> > chromeos/network/network_device_handler_unittest.cc:37:
> > fake_device_client_(NULL) {}
> > nit: nullptr
> 
> FWIW, while I'm ​in favor of doing drive-by fixes on CLs in general, I don't
> think we should ask for them on mass refactors as it turns automated CLs into
> ones requiring a manual step which while "simple" doesn't scale.

thus 'nit' :)  I appreciate the extra cleanup effort though, so thanks!

Powered by Google App Engine
This is Rietveld 408576698