media/track/track-remove-track.html is flaky, crashing and failing
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Mar 2016 15:40:33 +0000 (15:40 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Mar 2016 15:40:33 +0000 (15:40 +0000)
commitbb894e7b3b48dbb0005a995c14eddeca67aeace1
tree521038aa795d1c3145d8d14ecd2d582f2296011c
parent964d025abd4e00f32f3e7e55b16f660bedb81e8c
media/track/track-remove-track.html is flaky, crashing and failing
https://bugs.webkit.org/show_bug.cgi?id=130971

Reviewed by Alexey Proskuryakov.
Source/WebCore:

Prevent HTMLMediaElement from being collected while it is creating media controls.
These changes prevent the test from crashing but they do not fix the flakiness,
which is caused by another bug. Fixing that is tracked by
https://bugs.webkit.org/show_bug.cgi?id=155956.

* html/HTMLMediaElement.cpp:
(WebCore::actionName): New, debugging-only helper function.
(WebCore::HTMLMediaElement::HTMLMediaElement): Initialize new variables.
(WebCore::HTMLMediaElement::scheduleDelayedAction): Log the flag names to make debugging easier.
(WebCore::HTMLMediaElement::scheduleNextSourceChild): Add logging.
(WebCore::HTMLMediaElement::updateActiveTextTrackCues): Update logging.
(WebCore::HTMLMediaElement::configureTextTrackGroup): Drive-by optimization: don't call
  updateCaptionContainer here, call it before exiting configureTextTracks so we only call
  it once instead of once per track group.
(WebCore::controllerJSValue):
(WebCore::HTMLMediaElement::ensureMediaControlsShadowRoot): New, wrapper around calling
  ensureUserAgentShadowRoot so m_creatingControls can be set and cleared appropriately.
(WebCore::HTMLMediaElement::updateCaptionContainer): ensureUserAgentShadowRoot ->
  ensureMediaControlsShadowRoot. Drive by optimization: set/test m_haveSetupCaptionContainer
  so we only do this setup once.
(WebCore::HTMLMediaElement::configureTextTracks): Call updateCaptionContainer.
(WebCore::HTMLMediaElement::clearMediaPlayer): Log flag names.
(WebCore::HTMLMediaElement::hasPendingActivity): Return true when creating controls so GC
  won't happen during controls setup.
(WebCore::HTMLMediaElement::updateTextTrackDisplay): ensureUserAgentShadowRoot ->
  ensureMediaControlsShadowRoot.
(WebCore::HTMLMediaElement::createMediaControls): Ditto.
(WebCore::HTMLMediaElement::configureMediaControls): Ditto.
(WebCore::HTMLMediaElement::configureTextTrackDisplay): Ditto.
* html/HTMLMediaElement.h:

LayoutTests:

* platform/mac/TestExpectations: Mark crash as flaky only.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198780 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/mac/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h