[Modern Media Controls] Turn media/modern-media-controls/start-support tests back on
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Jan 2018 17:35:15 +0000 (17:35 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Jan 2018 17:35:15 +0000 (17:35 +0000)
commit52c40c0299142487f994e630033047cdf646fd18
treee4b4b653d23bbe4a9e9ef8ce133a8aac9abd0ac3
parentc791f931ae9909f847464cbdfaab7e21374e75c7
[Modern Media Controls] Turn media/modern-media-controls/start-support tests back on
https://bugs.webkit.org/show_bug.cgi?id=182297

Reviewed by Jon Lee and Eric Carlson.

Source/WebCore:

We identified one cause of flakiness when turning those tests back on and fix it in this patch. There would be
cases where the play/pause button would never actually become visible because we would first set it as one of
the buttons in the left container in the bottom controls bar before we would identify that we should show the
prominent play/pause button, and then once we did, we would add it as a child to the InlineMediaControls. But,
because the actual layout of the ButtonsContainer would happen in a rAF due to being a layout() method, we would
remove the play/pause button from the InlineMediaControls and set it as a child of the left container even
though it wasn't visible.

Performing the layout of a ButtonsContainer should really happen immediately when we set the buttons, so in this
patch we remove the "buttons" property and clients of ButtonsContainer can simply add or remove children which
will be laid out in a row. To support this, we've added two notification methods to LayoutNode, one that indicates
when children have changed, didChangeChildren(), which we override in ButtonsContainer to perform a synchronous
layout. The other method is willRemoveChild() which we also override in ButtonsContainer, this time to reset
the "x" and "visible" properties which we set while performing layout.

This fixes flakiness for media/modern-media-controls/start-support/start-support-click-to-start.html, and maybe
other modern-media-controls tests that could have been affected by this unexpected behavior.

* Modules/modern-media-controls/controls/buttons-container.js:
(ButtonsContainer.prototype.willRemoveChild):
(ButtonsContainer.prototype.didChangeChildren):
(ButtonsContainer.prototype.layout):
(ButtonsContainer.prototype.get buttons): Deleted.
(ButtonsContainer.prototype.set buttons): Deleted.
* Modules/modern-media-controls/controls/inline-media-controls.js:
(InlineMediaControls.prototype.layout):
(InlineMediaControls.prototype._updateBottomControlsBarLabel):
(InlineMediaControls.prototype._addTopRightBarWithMuteButtonToChildren):
(InlineMediaControls):
* Modules/modern-media-controls/controls/layout-node.js:
(LayoutNode.prototype.set children):
(LayoutNode.prototype.addChild):
(LayoutNode.prototype.removeChild):
(LayoutNode.prototype.willRemoveChild):
(LayoutNode.prototype.didChangeChildren):
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
(MacOSFullscreenMediaControls.prototype.layout):
* Modules/modern-media-controls/media/media-controller.js: Drive-by fix to correctly set the value passed as
data-auto-hide-delay on a <video> element.

LayoutTests:

Update tests to account for the new variable name for the playPauseButton and ensure we only listen to the
fullscreen event once to avoid flakiness in cases where we might exit fullscreen before the test completes.

We also update other tests that tested the behavior of ButtonsContainer.

* media/modern-media-controls/buttons-container/buttons-container-buttons-property-expected.txt:
* media/modern-media-controls/buttons-container/buttons-container-buttons-property.html:
* media/modern-media-controls/buttons-container/buttons-container-constructor-expected.txt:
* media/modern-media-controls/buttons-container/buttons-container-constructor.html:
* media/modern-media-controls/buttons-container/buttons-container-layout-expected.txt:
* media/modern-media-controls/buttons-container/buttons-container-layout.html:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-rtl-expected.txt:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-rtl.html:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-top-right-controls-bar-hidden-when-mute-button-disabled-expected.txt:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-top-right-controls-bar-hidden-when-mute-button-disabled.html:
* media/modern-media-controls/pip-support/pip-support-click.html:
* media/modern-media-controls/start-support/start-support-click-to-start.html:
* media/modern-media-controls/start-support/start-support-fullscreen.html:
* media/modern-media-controls/start-support/start-support-lowPowerMode-expected.txt:
* media/modern-media-controls/start-support/start-support-lowPowerMode.html:
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227904 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
LayoutTests/ChangeLog
LayoutTests/media/modern-media-controls/buttons-container/buttons-container-buttons-property-expected.txt
LayoutTests/media/modern-media-controls/buttons-container/buttons-container-buttons-property.html
LayoutTests/media/modern-media-controls/buttons-container/buttons-container-constructor-expected.txt
LayoutTests/media/modern-media-controls/buttons-container/buttons-container-constructor.html
LayoutTests/media/modern-media-controls/buttons-container/buttons-container-layout-expected.txt
LayoutTests/media/modern-media-controls/buttons-container/buttons-container-layout.html
LayoutTests/media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-rtl-expected.txt
LayoutTests/media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-rtl.html
LayoutTests/media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-top-right-controls-bar-hidden-when-mute-button-disabled-expected.txt
LayoutTests/media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-top-right-controls-bar-hidden-when-mute-button-disabled.html
LayoutTests/media/modern-media-controls/start-support/start-support-click-to-start.html
LayoutTests/media/modern-media-controls/start-support/start-support-fullscreen.html
LayoutTests/media/modern-media-controls/start-support/start-support-lowPowerMode-expected.txt
LayoutTests/media/modern-media-controls/start-support/start-support-lowPowerMode.html
LayoutTests/platform/ios/TestExpectations
LayoutTests/platform/mac/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/Modules/modern-media-controls/controls/buttons-container.js
Source/WebCore/Modules/modern-media-controls/controls/inline-media-controls.js
Source/WebCore/Modules/modern-media-controls/controls/layout-node.js
Source/WebCore/Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js
Source/WebCore/Modules/modern-media-controls/media/media-controller.js