Add a test for media control dropoff
authorjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Nov 2015 10:06:21 +0000 (10:06 +0000)
committerjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Nov 2015 10:06:21 +0000 (10:06 +0000)
commita254c487d98e73c928c2ddc2fadf4e90fc57c6ec
treece5f51ea74be03c341f25a1f7321cd1fab613612
parent57124ae0bf4851cd8e0fe35778e876cb151edc77
Add a test for media control dropoff
https://bugs.webkit.org/show_bug.cgi?id=151287
rdar://problem/23544666

Reviewed by Dean Jackson.

Source/WebCore:

Test: media/controls/inline-elements-dropoff-order.html

* Modules/mediacontrols/mediaControlsApple.css:
(audio::-webkit-media-controls-timeline-container.dropped): Override the
display:none since we want the container to remain visible but acting
as a flexible width space to push the other elements to the ends of the
inline flexbox. We will want to refactor the CSS rules so that all of the
components in the timeline are keyed off of the container's dropped class
rather than having each individual component have that class attached.
(audio::-webkit-media-controls-panel.hidden): Deleted. Consolidate a
couple rules.
* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.updateLayoutForDisplayedWidth): Also attach the
"dropped" class on the timeline box. Add the captions button for reporting
media control state.
* testing/Internals.cpp:
(WebCore::Internals::setMockMediaPlaybackTargetPickerState): Extend this to
also take "DeviceNotAvailable" to update the mock device's availability.

* testing/Internals.cpp: Update to use a reference to Page.
(WebCore::Internals::resetToConsistentState): Reset mock enabled setting for
each test.
* testing/Internals.h:
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::resetInternalsObject): Update to use a reference to Page.

LayoutTests:

The test takes a video element and resizes it to multiple widths. It
checks for the existence of the dropped or hidden class on each of the
media controls. The tests are run twice; once with wireless target
availability, and once without. If the platform does not support wireless
playback, it only goes through the tests once.

Test assumes that setMockMediaPlaybackTargetPickerEnabled is set to true at the beginning
of the test.

* media/controls/controls-test-helpers.js:
(ControlsTest.prototype.setup): Create the console box first before
checking to see the testRunner is available so that the failure
message appears when trying to run the test manually.
* media/controls/inline-elements-dropoff-order-expected.txt: Added.
* media/controls/inline-elements-dropoff-order.html: Added.
* platform/mac-mavericks/media/controls/inline-elements-dropoff-order-expected.txt: Added.
* platform/mac-yosemite/media/controls/inline-elements-dropoff-order-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192622 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/media/controls/controls-test-helpers.js
LayoutTests/media/controls/inline-elements-dropoff-order-expected.txt [new file with mode: 0644]
LayoutTests/media/controls/inline-elements-dropoff-order.html [new file with mode: 0644]
LayoutTests/platform/mac-mavericks/media/controls/inline-elements-dropoff-order-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-yosemite/media/controls/inline-elements-dropoff-order-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediacontrols/mediaControlsApple.css
Source/WebCore/Modules/mediacontrols/mediaControlsApple.js
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/js/WebCoreTestSupport.cpp