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

Issue 2511473004: Create base::test::ScopedTaskScheduler. (Closed)

Created:
4 years, 1 month ago by fdoray
Modified:
4 years, 1 month ago
Reviewers:
robliao, danakj, gab
CC:
chromium-reviews, gab+watch_chromium.org, robliao+watch_chromium.org, fdoray+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Create base::test::ScopedTaskScheduler. ScopedTaskScheduler initializes a TaskScheduler and allows usage of the base/task_scheduler/post_task.h API within a scope. To make tests deterministic, the TaskScheduler initialized by ScopedTaskScheduler has a single thread. BUG=553459 Committed: https://crrev.com/8602d8a7269695a80f9d796ba7b2d69209f8cbdd Cr-Commit-Position: refs/heads/master@{#433702}

Patch Set 1 #

Patch Set 2 : self-review #

Total comments: 11

Patch Set 3 : CR robliao/gab #4-6 #

Total comments: 2

Patch Set 4 : Use CreateAndSetSimpleTaskScheduler add const #

Total comments: 2

Patch Set 5 : CR danakj #12 (remove unused function) #

Patch Set 6 : self-review #

Total comments: 1

Patch Set 7 : Use CreateAndSetDefaultTaskScheduler #

Patch Set 8 : rebase #

Patch Set 9 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+78 lines, -6 lines) Patch
M base/task_scheduler/task_scheduler.h View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M base/task_scheduler/task_scheduler_impl.h View 1 chunk +1 line, -4 lines 0 comments Download
M base/test/BUILD.gn View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
A base/test/scoped_task_scheduler.h View 1 2 3 1 chunk +41 lines, -0 lines 0 comments Download
A base/test/scoped_task_scheduler.cc View 1 2 3 4 5 6 7 8 1 chunk +29 lines, -0 lines 0 comments Download
M base/threading/sequenced_worker_pool_unittest.cc View 1 2 3 4 5 6 8 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 33 (12 generated)
fdoray
PTAL
4 years, 1 month ago (2016-11-16 20:17:33 UTC) #2
robliao
https://codereview.chromium.org/2511473004/diff/20001/base/test/scoped_task_scheduler.cc File base/test/scoped_task_scheduler.cc (right): https://codereview.chromium.org/2511473004/diff/20001/base/test/scoped_task_scheduler.cc#newcode40 base/test/scoped_task_scheduler.cc:40: DCHECK(TaskScheduler::GetInstance()); Maybe we can keep a pointer and check ...
4 years, 1 month ago (2016-11-16 21:23:05 UTC) #3
gab
lgtm % name https://codereview.chromium.org/2511473004/diff/20001/base/test/BUILD.gn File base/test/BUILD.gn (right): https://codereview.chromium.org/2511473004/diff/20001/base/test/BUILD.gn#newcode81 base/test/BUILD.gn:81: "scoped_task_scheduler.h", I'd call it TestTaskScheduler to ...
4 years, 1 month ago (2016-11-16 21:29:19 UTC) #4
robliao
https://codereview.chromium.org/2511473004/diff/20001/base/threading/sequenced_worker_pool_unittest.cc File base/threading/sequenced_worker_pool_unittest.cc (right): https://codereview.chromium.org/2511473004/diff/20001/base/threading/sequenced_worker_pool_unittest.cc#newcode290 base/threading/sequenced_worker_pool_unittest.cc:290: TaskScheduler::GetInstance()->JoinForTesting(); On 2016/11/16 21:29:19, gab wrote: > On 2016/11/16 ...
4 years, 1 month ago (2016-11-16 21:31:32 UTC) #5
gab
https://codereview.chromium.org/2511473004/diff/20001/base/threading/sequenced_worker_pool_unittest.cc File base/threading/sequenced_worker_pool_unittest.cc (right): https://codereview.chromium.org/2511473004/diff/20001/base/threading/sequenced_worker_pool_unittest.cc#newcode290 base/threading/sequenced_worker_pool_unittest.cc:290: TaskScheduler::GetInstance()->JoinForTesting(); On 2016/11/16 21:31:31, robliao wrote: > On 2016/11/16 ...
4 years, 1 month ago (2016-11-16 21:38:15 UTC) #6
fdoray
robliao@: PTAnL https://codereview.chromium.org/2511473004/diff/20001/base/test/BUILD.gn File base/test/BUILD.gn (right): https://codereview.chromium.org/2511473004/diff/20001/base/test/BUILD.gn#newcode81 base/test/BUILD.gn:81: "scoped_task_scheduler.h", On 2016/11/16 21:29:19, gab wrote: > ...
4 years, 1 month ago (2016-11-16 22:04:45 UTC) #7
robliao
lgtm
4 years, 1 month ago (2016-11-16 22:09:56 UTC) #8
gab
lgtm % nit https://codereview.chromium.org/2511473004/diff/40001/base/test/scoped_task_scheduler.h File base/test/scoped_task_scheduler.h (right): https://codereview.chromium.org/2511473004/diff/40001/base/test/scoped_task_scheduler.h#newcode33 base/test/scoped_task_scheduler.h:33: TaskScheduler* task_scheduler_ = nullptr; const TaskScheduler*
4 years, 1 month ago (2016-11-16 22:17:43 UTC) #9
fdoray
danakj@: PTAL https://codereview.chromium.org/2511473004/diff/40001/base/test/scoped_task_scheduler.h File base/test/scoped_task_scheduler.h (right): https://codereview.chromium.org/2511473004/diff/40001/base/test/scoped_task_scheduler.h#newcode33 base/test/scoped_task_scheduler.h:33: TaskScheduler* task_scheduler_ = nullptr; On 2016/11/16 22:17:43, ...
4 years, 1 month ago (2016-11-16 22:45:46 UTC) #11
danakj
LGTM https://codereview.chromium.org/2511473004/diff/60001/base/test/scoped_task_scheduler.cc File base/test/scoped_task_scheduler.cc (right): https://codereview.chromium.org/2511473004/diff/60001/base/test/scoped_task_scheduler.cc#newcode20 base/test/scoped_task_scheduler.cc:20: size_t GetWorkerPoolIndexForTraits(const TaskTraits&) { Not used?
4 years, 1 month ago (2016-11-17 00:48:01 UTC) #12
fdoray
https://codereview.chromium.org/2511473004/diff/60001/base/test/scoped_task_scheduler.cc File base/test/scoped_task_scheduler.cc (right): https://codereview.chromium.org/2511473004/diff/60001/base/test/scoped_task_scheduler.cc#newcode20 base/test/scoped_task_scheduler.cc:20: size_t GetWorkerPoolIndexForTraits(const TaskTraits&) { On 2016/11/17 00:48:01, danakj wrote: ...
4 years, 1 month ago (2016-11-17 13:25:25 UTC) #13
gab
https://codereview.chromium.org/2511473004/diff/100001/base/test/scoped_task_scheduler.cc File base/test/scoped_task_scheduler.cc (right): https://codereview.chromium.org/2511473004/diff/100001/base/test/scoped_task_scheduler.cc#newcode18 base/test/scoped_task_scheduler.cc:18: const TimeDelta kDetachDuration = base::TimeDelta::Max(); FYI, TimeDelta can be ...
4 years, 1 month ago (2016-11-17 14:39:35 UTC) #14
fdoray
gab@: PTAnL. The CL now uses CreateAndSet*Default*TaskScheduler() instead of CreateAndSet*Simple*TaskScheduler() - because threads that can ...
4 years, 1 month ago (2016-11-17 19:58:31 UTC) #15
gab
lgtm
4 years, 1 month ago (2016-11-17 20:52:23 UTC) #16
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/2511473004/120001
4 years, 1 month ago (2016-11-21 16:35:38 UTC) #19
commit-bot: I haz the power
Failed to apply patch for base/test/BUILD.gn: While running git apply --index -p1; error: patch failed: ...
4 years, 1 month ago (2016-11-21 17:47:14 UTC) #21
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/2511473004/140001
4 years, 1 month ago (2016-11-21 20:52:45 UTC) #24
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/109902) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, ...
4 years, 1 month ago (2016-11-21 21:13:38 UTC) #26
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/2511473004/160001
4 years, 1 month ago (2016-11-21 21:50:08 UTC) #29
commit-bot: I haz the power
Committed patchset #9 (id:160001)
4 years, 1 month ago (2016-11-21 23:54:00 UTC) #31
commit-bot: I haz the power
4 years, 1 month ago (2016-11-21 23:56:46 UTC) #33
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/8602d8a7269695a80f9d796ba7b2d69209f8cbdd
Cr-Commit-Position: refs/heads/master@{#433702}

Powered by Google App Engine
This is Rietveld 408576698