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

Issue 1152623008: scheduler: Always create a real scheduler in unit tests (Closed)

Created:
5 years, 6 months ago by Sami
Modified:
5 years, 6 months ago
CC:
chromium-reviews, jam, scheduler-bugs_chromium.org, darin-cc_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

scheduler: Always create a real scheduler in unit tests Previously we would create a dummy scheduler in any test which uses TestBlinkWebUnitTestSupport without first initializing a message loop. This causes problems because the dummy scheduler ignores all tasks it is given. This patch makes the tests more realistic by always creating a real renderer scheduler regardless of whether we have a message loop or not. This is achieved by lazily binding the scheduler to the message loop the first time it is needed. Longer term we would like to refactor these test suites to ensure Blink always has a valid message loop when it is initialized, but this will involve rewiring several tests. BUG=463143, 495659 Committed: https://crrev.com/087644f1eab41927823a1a2fc2df08bd4e10fe18 Cr-Commit-Position: refs/heads/master@{#332685} Committed: https://crrev.com/ae456cc035b8bb76c11d47f28b2efab3dea0c26d Cr-Commit-Position: refs/heads/master@{#332818}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Open bug about fixing the tests. #

Patch Set 3 : Alex's comments. #

Patch Set 4 : Windows build fix. #

Total comments: 4

Patch Set 5 : Split into test only module. #

Patch Set 6 : Rebased. #

Patch Set 7 : Fix windows build. #

Patch Set 8 : Really fix the windows build. #

Patch Set 9 : DEPS typo. #

Patch Set 10 : Build a static library for GN too. #

Patch Set 11 : Remember the message loop binding. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+182 lines, -37 lines) Patch
M components/scheduler/BUILD.gn View 1 2 3 4 5 6 7 8 9 1 chunk +11 lines, -0 lines 0 comments Download
M components/scheduler/scheduler.gyp View 1 2 3 4 7 1 chunk +11 lines, -0 lines 0 comments Download
M components/scheduler/scheduler.gypi View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
A components/scheduler/test/DEPS View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -0 lines 0 comments Download
A components/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +57 lines, -0 lines 0 comments Download
A components/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +86 lines, -0 lines 0 comments Download
M content/content_tests.gypi View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M content/test/BUILD.gn View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M content/test/DEPS View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M content/test/test_blink_web_unit_test_support.cc View 1 2 3 4 5 chunks +7 lines, -37 lines 0 comments Download

Messages

Total messages: 38 (17 generated)
Sami
5 years, 6 months ago (2015-06-02 15:54:11 UTC) #2
alex clarke (OOO till 29th)
lgtm https://codereview.chromium.org/1152623008/diff/1/components/scheduler/renderer/lazy_scheduler_message_loop_delegate.h File components/scheduler/renderer/lazy_scheduler_message_loop_delegate.h (right): https://codereview.chromium.org/1152623008/diff/1/components/scheduler/renderer/lazy_scheduler_message_loop_delegate.h#newcode38 components/scheduler/renderer/lazy_scheduler_message_loop_delegate.h:38: protected: Is this needed? https://codereview.chromium.org/1152623008/diff/1/components/scheduler/renderer/lazy_scheduler_message_loop_delegate.h#newcode42 components/scheduler/renderer/lazy_scheduler_message_loop_delegate.h:42: LazySchedulerMessageLoopDelegate(); nit: ...
5 years, 6 months ago (2015-06-02 16:01:46 UTC) #4
Sami
Thanks Alex. https://codereview.chromium.org/1152623008/diff/1/components/scheduler/renderer/lazy_scheduler_message_loop_delegate.h File components/scheduler/renderer/lazy_scheduler_message_loop_delegate.h (right): https://codereview.chromium.org/1152623008/diff/1/components/scheduler/renderer/lazy_scheduler_message_loop_delegate.h#newcode38 components/scheduler/renderer/lazy_scheduler_message_loop_delegate.h:38: protected: On 2015/06/02 16:01:45, alexclarke1 wrote: > ...
5 years, 6 months ago (2015-06-02 16:08:39 UTC) #5
rmcilroy
Generally looks good, but I would prefer that this was test-only specific. https://codereview.chromium.org/1152623008/diff/60001/components/scheduler/renderer/lazy_scheduler_message_loop_delegate.h File components/scheduler/renderer/lazy_scheduler_message_loop_delegate.h ...
5 years, 6 months ago (2015-06-02 16:53:07 UTC) #6
Sami
https://codereview.chromium.org/1152623008/diff/60001/components/scheduler/renderer/lazy_scheduler_message_loop_delegate.h File components/scheduler/renderer/lazy_scheduler_message_loop_delegate.h (right): https://codereview.chromium.org/1152623008/diff/60001/components/scheduler/renderer/lazy_scheduler_message_loop_delegate.h#newcode21 components/scheduler/renderer/lazy_scheduler_message_loop_delegate.h:21: class SCHEDULER_EXPORT LazySchedulerMessageLoopDelegate On 2015/06/02 16:53:07, rmcilroy wrote: > ...
5 years, 6 months ago (2015-06-02 17:26:21 UTC) #7
no sievers
content lgtm
5 years, 6 months ago (2015-06-02 20:27:46 UTC) #8
rmcilroy
On 2015/06/02 20:27:46, sievers wrote: > content lgtm lgtm, thanks!
5 years, 6 months ago (2015-06-02 20:47:19 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1152623008/120001
5 years, 6 months ago (2015-06-03 11:42:10 UTC) #12
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_compile_dbg_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_compile_dbg_ng/builds/45053)
5 years, 6 months ago (2015-06-03 12:50:22 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1152623008/160001
5 years, 6 months ago (2015-06-03 17:00:26 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_gn_dbg on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_gn_dbg/builds/78192)
5 years, 6 months ago (2015-06-03 17:38:38 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1152623008/180001
5 years, 6 months ago (2015-06-03 18:16:14 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/13564)
5 years, 6 months ago (2015-06-03 19:33:35 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1152623008/180001
5 years, 6 months ago (2015-06-03 20:04:09 UTC) #29
commit-bot: I haz the power
Committed patchset #10 (id:180001)
5 years, 6 months ago (2015-06-03 21:21:09 UTC) #30
commit-bot: I haz the power
Patchset 10 (id:??) landed as https://crrev.com/087644f1eab41927823a1a2fc2df08bd4e10fe18 Cr-Commit-Position: refs/heads/master@{#332685}
5 years, 6 months ago (2015-06-03 21:22:03 UTC) #31
tkent
A revert of this CL (patchset #10 id:180001) has been created in https://codereview.chromium.org/1156463004/ by tkent@chromium.org. ...
5 years, 6 months ago (2015-06-04 01:27:28 UTC) #32
alex clarke (OOO till 29th)
lgtm Fix looks good.
5 years, 6 months ago (2015-06-04 10:46:08 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1152623008/200001
5 years, 6 months ago (2015-06-04 10:46:46 UTC) #36
commit-bot: I haz the power
Committed patchset #11 (id:200001)
5 years, 6 months ago (2015-06-04 11:42:14 UTC) #37
commit-bot: I haz the power
5 years, 6 months ago (2015-06-04 11:42:57 UTC) #38
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/ae456cc035b8bb76c11d47f28b2efab3dea0c26d
Cr-Commit-Position: refs/heads/master@{#332818}

Powered by Google App Engine
This is Rietveld 408576698