scheduler: Always create a real scheduler in unit tests
commit087644f1eab41927823a1a2fc2df08bd4e10fe18
authorskyostil <skyostil@chromium.org>
Wed, 3 Jun 2015 21:20:58 +0000 (3 14:20 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 3 Jun 2015 21:21:32 +0000 (3 21:21 +0000)
tree2936a1aa9a0ff8828edac3f21cdd9991017656e9
parent02f50fbe4fa6d6f705fc4ed8185da60d2982111c
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

Review URL: https://codereview.chromium.org/1152623008

Cr-Commit-Position: refs/heads/master@{#332685}
components/scheduler/BUILD.gn
components/scheduler/scheduler.gyp
components/scheduler/scheduler.gypi
components/scheduler/test/DEPS [new file with mode: 0644]
components/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.cc [new file with mode: 0644]
components/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.h [new file with mode: 0644]
content/content_tests.gypi
content/test/BUILD.gn
content/test/DEPS
content/test/test_blink_web_unit_test_support.cc