scheduler: Always create a real scheduler in unit tests
commitae456cc035b8bb76c11d47f28b2efab3dea0c26d
authorskyostil <skyostil@chromium.org>
Thu, 4 Jun 2015 11:42:05 +0000 (4 04:42 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 4 Jun 2015 11:42:28 +0000 (4 11:42 +0000)
treeef7ce71f226cde948885c2a6a2a432821e66df18
parent78edcd5e7f6eace6313e22625163b61c96371495
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}

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

Cr-Commit-Position: refs/heads/master@{#332818}
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