Chromium Code Reviews
DescriptionAdd MediaControlsImplTestWithMockScheduler.
Currently, MediaControlsImplTest.ControlsRemainVisibleDuringKeyboardInteraction
does the following:
SetUp()
InitializePage()
Creates a DummyPageHolder, which indirectly creates a
blink::PerformanceMonitor. blink::PerformanceMonitor registers
ifself as a task time observer with the current
TaskQueueManager.
Body
Instantiate
ScopedTestingPlatformSupport<TestingPlatformSupportWithMockScheduler>.
This overrides the current TaskQueueManager with a mock.
InitializePage()
This deletes the existing DummyPageHolder, which indirectly
deletes the blink::PerformanceMonitor. Before it is deleted,
blink::PerformanceMonitor unregisters from the current
TaskQueueManager, which is unfortunately *not the same* as the one
to which it was registered. That means that the initial
TaskQueueManager is left with a pointer to a deleted
blink::PerformanceMonitor.
TearDownBlinkTestEnvironment()
We would like to flush the ScopedTaskEnvironment from here but
we can't because that causes the initial TaskQueueManager to
access its invalid blink::PerformanceMonitor pointer.
This CL fixes this issue by creating a
MediaControlsImplTestWithMockScheduler which instantiates a
ScopedTestingPlatformSupport<TestingPlatformSupportWithMockScheduler>
before SetUp() to make sure that blink::PerformanceMonitor
registers itself with the mock TaskQueueManager rather than
with the real one.
BUG=724077
Review-Url: https://codereview.chromium.org/2909093002
Cr-Commit-Position: refs/heads/master@{#475382}
Committed: https://chromium.googlesource.com/chromium/src/+/1f3a7e66d633e18507101436900fa98625d8e987
Patch Set 1 #
Total comments: 1
Patch Set 2 : CR #Messages
Total messages: 19 (9 generated)
|