Chromium Code Reviews
Help | Chromium Project | Gerrit Changes | Sign in
(11)

Issue 2797293002: Use ScopedTaskEnvironment instead of MessageLoop in chrome unit tests. (Closed)

Created:
2 years, 1 month ago by fdoray
Modified:
2 years, 1 month ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, ios-reviews_chromium.org, net-reviews_chromium.org, oshima+watch_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Use ScopedTaskEnvironment instead of MessageLoop in chrome unit tests. ScopedTaskEnvironment allows usage of ThreadTaskRunnerHandle and base/task_scheduler/post_task.h within its scope. It should be instantiated in every unit test 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=sky@chromium.org, vitalybuka@chromium.org Review-Url: https://codereview.chromium.org/2797293002 Cr-Commit-Position: refs/heads/master@{#462492} Committed: https://chromium.googlesource.com/chromium/src/+/0bc320f205ad411a7ab935fa79879ff75e8a7fc9

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -7 lines) Patch
M chrome/browser/chromeos/net/network_state_notifier_unittest.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/local_discovery/local_domain_resolver_unittest.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/printing/cloud_print/privet_notifications_unittest.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/process_singleton_posix_unittest.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/signin/mutable_profile_oauth2_token_service_delegate_unittest.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/ui/desktop_ios_promotion/sms_service_unittest.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/utility/image_writer/image_writer_unittest.cc View 2 chunks +2 lines, -1 line 0 comments Download

Depends on Patchset:

Messages

Total messages: 16 (7 generated)
fdoray
2 years, 1 month ago (2017-04-05 19:40:46 UTC) #1
fdoray
gab@: PTAL The change will then be TBRed to the owner.
2 years, 1 month ago (2017-04-05 19:40:49 UTC) #3
gab
lgtm
2 years, 1 month ago (2017-04-05 20:54:25 UTC) #7
Vitaly Buka (NO REVIEWS)
lgtm
2 years, 1 month ago (2017-04-05 20:56:40 UTC) #8
sky
LGTM - be sure and remove any stale includes.
2 years, 1 month ago (2017-04-05 23:19:35 UTC) #9
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/2797293002/1
2 years, 1 month ago (2017-04-06 15:28:17 UTC) #11
fdoray
On 2017/04/05 23:19:35, sky wrote: > LGTM - be sure and remove any stale includes. ...
2 years, 1 month ago (2017-04-06 15:28:51 UTC) #12
commit-bot: I haz the power
Committed patchset #1 (id:1) as https://chromium.googlesource.com/chromium/src/+/0bc320f205ad411a7ab935fa79879ff75e8a7fc9
2 years, 1 month ago (2017-04-06 15:47:40 UTC) #15
fdoray
2 years, 1 month ago (2017-04-06 17:13:59 UTC) #16
Message was sent while issue was closed.
A revert of this CL (patchset #1 id:1) has been created in
https://codereview.chromium.org/2799743004/ by fdoray@chromium.org.

The reason for reverting is: Test timeout in
MutableProfileOAuth2TokenServiceDelegateTest.ShutdownService.

Powered by Google App Engine
This is Rietveld 408576698