<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[203057] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/203057">203057</a></dd>
<dt>Author</dt> <dd>eric.carlson@apple.com</dd>
<dt>Date</dt> <dd>2016-07-11 07:37:32 -0700 (Mon, 11 Jul 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Add a test for media control dropoff
https://bugs.webkit.org/show_bug.cgi?id=151287
<rdar://problem/23544666>
Reviewed by Antoine Quint.
Source/WebCore:
Test: media/controls/inline-elements-dropoff-order.html
* Modules/mediacontrols/mediaControlsApple.js: Expose more state to testing.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::setAllowsAirPlayForMediaPlayback): Renamed from setWirelessPlaybackDisabled.
(WebCore::InternalSettings::setWirelessPlaybackDisabled): Deleted.
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
LayoutTests:
* media/controls/inline-elements-dropoff-order-expected.txt: Added.
* media/controls/inline-elements-dropoff-order.html: Added.
* platform/mac-yosemite/media/controls: Added.
* platform/mac-yosemite/media/controls/inline-elements-dropoff-order-expected.txt: Added.
* platform/mac-elcapitan/media/controls: Added.
* platform/mac-elcapitan/media/controls/inline-elements-dropoff-order-expected.txt: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesmediacontrolsmediaControlsApplejs">trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js</a></li>
<li><a href="#trunkSourceWebCoretestingInternalSettingscpp">trunk/Source/WebCore/testing/InternalSettings.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalSettingsh">trunk/Source/WebCore/testing/InternalSettings.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalSettingsidl">trunk/Source/WebCore/testing/InternalSettings.idl</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsmediacontrolsinlineelementsdropofforderexpectedtxt">trunk/LayoutTests/media/controls/inline-elements-dropoff-order-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediacontrolsinlineelementsdropofforderhtml">trunk/LayoutTests/media/controls/inline-elements-dropoff-order.html</a></li>
<li>trunk/LayoutTests/platform/mac-yosemite/media/controls/</li>
<li><a href="#trunkLayoutTestsplatformmacyosemitemediacontrolsinlineelementsdropofforderexpectedtxt">trunk/LayoutTests/platform/mac-yosemite/media/controls/inline-elements-dropoff-order-expected.txt</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (203056 => 203057)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-07-11 14:35:54 UTC (rev 203056)
+++ trunk/LayoutTests/ChangeLog        2016-07-11 14:37:32 UTC (rev 203057)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-07-11 Eric Carlson <eric.carlson@apple.com>
+
+ Add a test for media control dropoff
+ https://bugs.webkit.org/show_bug.cgi?id=151287
+ <rdar://problem/23544666>
+
+ Reviewed by Antoine Quint.
+
+ * media/controls/inline-elements-dropoff-order-expected.txt: Added.
+ * media/controls/inline-elements-dropoff-order.html: Added.
+ * platform/mac-yosemite/media/controls: Added.
+ * platform/mac-yosemite/media/controls/inline-elements-dropoff-order-expected.txt: Added.
+ * platform/mac-elcapitan/media/controls: Added.
+ * platform/mac-elcapitan/media/controls/inline-elements-dropoff-order-expected.txt: Added.
+
</ins><span class="cx"> 2016-07-11 Frederic Wang <fwang@igalia.com>
</span><span class="cx">
</span><span class="cx"> Update expectations for some MathML pixel tests on Windows.
</span></span></pre></div>
<a id="trunkLayoutTestsmediacontrolsinlineelementsdropofforderexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/media/controls/inline-elements-dropoff-order-expected.txt (0 => 203057)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/controls/inline-elements-dropoff-order-expected.txt         (rev 0)
+++ trunk/LayoutTests/media/controls/inline-elements-dropoff-order-expected.txt        2016-07-11 14:37:32 UTC (rev 203057)
</span><span class="lines">@@ -0,0 +1,359 @@
</span><ins>+Test control element visibility at different element widths.
+
+This test only runs in DRT!
+
+
+EVENT: error
+PASS: We are using the Apple idiom
+
+*** Test the controls layout without video ***
+
+* Width 60px:
+PASS: Play Button is visible
+PASS: Status Display is visible
+PASS: Rewind Button is not visible
+PASS: Mute Box is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+PASS: Fullscreen Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 90px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Status Display is visible
+PASS: Mute Box is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+PASS: Fullscreen Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 200px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Status Display is visible
+PASS: Mute Box is visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+PASS: Fullscreen Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+
+*** Test the controls layout with video ***
+
+EVENT: canplaythrough
+* Width 60px:
+PASS: Play Button is visible
+PASS: Rewind Button is not visible
+PASS: Status Display is not visible
+PASS: Mute Box is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+PASS: Fullscreen Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 90px:
+PASS: Play Button is visible
+PASS: Fullscreen Button is visible
+PASS: Rewind Button is not visible
+PASS: Status Display is not visible
+PASS: Mute Box is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 120px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Fullscreen Button is visible
+PASS: Status Display is not visible
+PASS: Mute Box is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 150px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Mute Box is visible
+PASS: Fullscreen Button is visible
+PASS: Status Display is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 200px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Mute Box is visible
+PASS: Picture-in-picture Button is visible
+PASS: Fullscreen Button is visible
+PASS: Status Display is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Caption Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 400px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Timeline is visible
+PASS: Current Time is visible
+PASS: Thumbnail Track is visible
+PASS: Time Remaining is visible
+PASS: Mute Box is visible
+PASS: Picture-in-picture Button is visible
+PASS: Fullscreen Button is visible
+PASS: Status Display is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Caption Button is not visible
+
+
+*** Test the controls layout with video and a caption track ***
+
+* Width 60px:
+PASS: Play Button is visible
+PASS: Rewind Button is not visible
+PASS: Status Display is not visible
+PASS: Mute Box is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+PASS: Fullscreen Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 90px:
+PASS: Play Button is visible
+PASS: Fullscreen Button is visible
+PASS: Rewind Button is not visible
+PASS: Status Display is not visible
+PASS: Mute Box is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 120px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Fullscreen Button is visible
+PASS: Status Display is not visible
+PASS: Mute Box is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 150px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Mute Box is visible
+PASS: Fullscreen Button is visible
+PASS: Status Display is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 180px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Mute Box is visible
+PASS: Caption Button is visible
+PASS: Fullscreen Button is visible
+PASS: Status Display is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 200px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Mute Box is visible
+PASS: Caption Button is visible
+PASS: Picture-in-picture Button is visible
+PASS: Fullscreen Button is visible
+PASS: Status Display is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 400px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Current Time is visible
+PASS: Timeline is visible
+PASS: Thumbnail Track is visible
+PASS: Time Remaining is visible
+PASS: Mute Box is visible
+PASS: Caption Button is visible
+PASS: Picture-in-picture Button is visible
+PASS: Fullscreen Button is visible
+PASS: Status Display is not visible
+PASS: AppleTV Device Picker is not visible
+
+
+*** Test the controls layout with video, a caption track, and AppleTV ***
+
+* Width 60px:
+PASS: Play Button is visible
+PASS: Rewind Button is not visible
+PASS: Status Display is not visible
+PASS: Mute Box is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+PASS: Fullscreen Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 90px:
+PASS: Play Button is visible
+PASS: Fullscreen Button is visible
+PASS: Rewind Button is not visible
+PASS: Status Display is not visible
+PASS: Mute Box is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 120px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Fullscreen Button is visible
+PASS: Status Display is not visible
+PASS: Mute Box is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 150px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Mute Box is visible
+PASS: Fullscreen Button is visible
+PASS: Status Display is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 180px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Mute Box is visible
+PASS: Caption Button is visible
+PASS: Fullscreen Button is visible
+PASS: Status Display is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 200px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Mute Box is visible
+PASS: Caption Button is visible
+PASS: Picture-in-picture Button is visible
+PASS: Fullscreen Button is visible
+PASS: Status Display is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 350px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Mute Box is visible
+PASS: AppleTV Device Picker is visible
+PASS: Caption Button is visible
+PASS: Picture-in-picture Button is visible
+PASS: Fullscreen Button is visible
+PASS: Status Display is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 400px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Current Time is visible
+PASS: Timeline is visible
+PASS: Thumbnail Track is visible
+PASS: Time Remaining is visible
+PASS: Mute Box is visible
+PASS: AppleTV Device Picker is visible
+PASS: Caption Button is visible
+PASS: Picture-in-picture Button is visible
+PASS: Fullscreen Button is visible
+PASS: Status Display is not visible
+
+
+Testing finished.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsmediacontrolsinlineelementsdropofforderhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/media/controls/inline-elements-dropoff-order.html (0 => 203057)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/controls/inline-elements-dropoff-order.html         (rev 0)
+++ trunk/LayoutTests/media/controls/inline-elements-dropoff-order.html        2016-07-11 14:37:32 UTC (rev 203057)
</span><span class="lines">@@ -0,0 +1,162 @@
</span><ins>+<!DOCTYPE html>
+<html>
+ <head>
+ <script src="../media-file.js"></script>
+ <script src="controls-test-helpers.js"></script>
+ <script>
+
+ const allButtons = [
+ "Play Button", "Rewind Button", "Status Display", "Mute Box", "AppleTV Device Picker",
+ "Picture-in-picture Button", "Caption Button", "Fullscreen Button", "Timeline",
+ "Current Time", "Thumbnail Track", "Time Remaining"
+ ];
+ const tester = new ControlsTest("non-existent-media-file", "error")
+ .whenReady(setup)
+ .start();
+
+ function setup()
+ {
+ internals.settings.setAllowsPictureInPictureMediaPlayback(true);
+ internals.settings.setAllowsAirPlayForMediaPlayback(false);
+
+ tester.test("We are using the Apple idiom")
+ .value(tester.currentState.idiom)
+ .isEqualTo("apple");
+ tester.startNewSection("*** Test the controls layout without video ***");
+ runTestsWithoutVideo();
+ }
+
+ function testControls(data, nextTest)
+ {
+ if (!data.length) {
+ if (typeof nextTest === "function")
+ nextTest();
+ else
+ tester.end();
+ return;
+ }
+
+ const test = data.shift();
+
+ if (typeof tester.media.webkitSupportsPresentationMode !== "function" || !tester.media.webkitSupportsPresentationMode('picture-in-picture'))
+ test.visible = test.visible.filter(name => name.indexOf("Picture-in-picture Button") === -1);
+ if (!internals.setMockMediaPlaybackTargetPickerState)
+ test.visible = test.visible.filter(name => name.indexOf("AppleTV Device Picker") === -1);
+
+ tester.media.style.width = test.width + "px";
+ window.setTimeout( () => {
+ tester.logMessage(`* Width ${tester.media.style.width}:`);
+
+ const isVisible = (state, name) => {
+ if (state === null || typeof state.className !== "string")
+ return false;
+ return state.className.indexOf("dropped") === -1 && state.className.indexOf("hidden") === -1;
+ }
+
+ test.visible.forEach(name => {
+ const state = tester.stateForControlsElement(name, true);
+ tester.test(`${name} is visible`)
+ .value(isVisible(state))
+ .isTrue();
+ });
+
+ allButtons.filter(name => test.visible.indexOf(name) === -1).forEach(name => {
+ const state = tester.stateForControlsElement(name, true);
+ tester.test(`${name} is not visible`)
+ .value(isVisible(state))
+ .isFalse();
+ });
+
+ tester.logBlankLine();
+ testControls(data, nextTest);
+ }, 100);
+ }
+
+ function runTestsWithoutVideo()
+ {
+ const setupNextTest = () => {
+ tester.resetEventTrigger("canplaythrough")
+ .whenReady(runTestsWithVideo)
+ .media.src = findMediaFile("video", "../content/test");
+ tester.startNewSection("*** Test the controls layout with video ***");
+ };
+
+ const data = [
+ { width: 60, visible : ["Play Button", "Status Display"] },
+ { width: 90, visible : ["Play Button", "Rewind Button", "Status Display"] },
+ { width: 200, visible : ["Play Button", "Rewind Button", "Status Display", "Mute Box"] },
+ ];
+ testControls(data, setupNextTest);
+ }
+
+ function runTestsWithVideo()
+ {
+ const setupNextTest = () => {
+ tester.startNewSection("*** Test the controls layout with video and a caption track ***")
+ const track = document.createElement("track");
+ track.kind = "captions";
+ track.src = `data:text/vtt,${encodeURIComponent("WEBVTT\n\n00:00:00.000 --> 00:00:01.000\nCaption 1\n")}`;
+ tester.media.appendChild(track);
+
+ runTestsWithTextTrack();
+ };
+
+ const data = [
+ { width: 60, visible : ["Play Button"] },
+ { width: 90, visible : ["Play Button", "Fullscreen Button"] },
+ { width: 120, visible : ["Play Button", "Rewind Button", "Fullscreen Button"] },
+ { width: 150, visible : ["Play Button", "Rewind Button", "Mute Box", "Fullscreen Button"] },
+ { width: 200, visible : ["Play Button", "Rewind Button", "Mute Box", "Picture-in-picture Button", "Fullscreen Button"] },
+ { width: 400, visible : ["Play Button", "Rewind Button", "Timeline", "Current Time", "Thumbnail Track", "Time Remaining", "Mute Box", "Picture-in-picture Button", "Fullscreen Button"] },
+ ];
+
+ testControls(data, setupNextTest);
+ }
+
+ function runTestsWithTextTrack()
+ {
+ const setupNextTest = () => {
+ tester.startNewSection("*** Test the controls layout with video, a caption track, and AppleTV ***");
+ internals.settings.setAllowsAirPlayForMediaPlayback(true);
+ internals.setMockMediaPlaybackTargetPickerState("Sleepy TV", "DeviceAvailable");
+ runTestsWithVideoAndAppleTV();
+ };
+
+ const data = [
+ { width: 60, visible : ["Play Button"] },
+ { width: 90, visible : ["Play Button", "Fullscreen Button"] },
+ { width: 120, visible : ["Play Button", "Rewind Button", "Fullscreen Button"] },
+ { width: 150, visible : ["Play Button", "Rewind Button", "Mute Box", "Fullscreen Button"] },
+ { width: 180, visible : ["Play Button", "Rewind Button", "Mute Box", "Caption Button", "Fullscreen Button"] },
+ { width: 200, visible : ["Play Button", "Rewind Button", "Mute Box", "Caption Button", "Picture-in-picture Button", "Fullscreen Button"] },
+ { width: 400, visible : ["Play Button", "Rewind Button", "Current Time", "Timeline", "Thumbnail Track", "Time Remaining", "Mute Box", "Caption Button", "Picture-in-picture Button", "Fullscreen Button"] },
+ ];
+
+ testControls(data, internals.setMockMediaPlaybackTargetPickerState ? setupNextTest : null);
+ }
+
+ function runTestsWithVideoAndAppleTV()
+ {
+ const data = [
+ { width: 60, visible : ["Play Button"] },
+ { width: 90, visible : ["Play Button", "Fullscreen Button"] },
+ { width: 120, visible : ["Play Button", "Rewind Button", "Fullscreen Button"] },
+ { width: 150, visible : ["Play Button", "Rewind Button", "Mute Box", "Fullscreen Button"] },
+ { width: 180, visible : ["Play Button", "Rewind Button", "Mute Box", "Caption Button", "Fullscreen Button"] },
+ { width: 200, visible : ["Play Button", "Rewind Button", "Mute Box", "Caption Button", "Picture-in-picture Button", "Fullscreen Button"] },
+ { width: 350, visible : ["Play Button", "Rewind Button", "Mute Box", "AppleTV Device Picker", "Caption Button", "Picture-in-picture Button", "Fullscreen Button"] },
+ { width: 400, visible : ["Play Button", "Rewind Button", "Current Time", "Timeline", "Thumbnail Track", "Time Remaining", "Mute Box", "AppleTV Device Picker", "Caption Button", "Picture-in-picture Button", "Fullscreen Button"] },
+ ];
+
+ testControls(data);
+ }
+
+
+ </script>
+ </head>
+ <body>
+ <p>Test control element visibility at different element widths.</p>
+ <p>This test only runs in DRT!</p>
+ <video controls></video>
+ </body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacyosemitemediacontrolsinlineelementsdropofforderexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac-yosemite/media/controls/inline-elements-dropoff-order-expected.txt (0 => 203057)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-yosemite/media/controls/inline-elements-dropoff-order-expected.txt         (rev 0)
+++ trunk/LayoutTests/platform/mac-yosemite/media/controls/inline-elements-dropoff-order-expected.txt        2016-07-11 14:37:32 UTC (rev 203057)
</span><span class="lines">@@ -0,0 +1,244 @@
</span><ins>+Test control element visibility at different element widths.
+
+This test only runs in DRT!
+
+
+EVENT: error
+PASS: We are using the Apple idiom
+
+*** Test the controls layout without video ***
+
+* Width 60px:
+PASS: Play Button is visible
+PASS: Status Display is visible
+PASS: Rewind Button is not visible
+PASS: Mute Box is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+PASS: Fullscreen Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 90px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Status Display is visible
+PASS: Mute Box is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+PASS: Fullscreen Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 200px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Status Display is visible
+PASS: Mute Box is visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+PASS: Fullscreen Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+
+*** Test the controls layout with video ***
+
+EVENT: canplaythrough
+* Width 60px:
+PASS: Play Button is visible
+PASS: Rewind Button is not visible
+PASS: Status Display is not visible
+PASS: Mute Box is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+PASS: Fullscreen Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 90px:
+PASS: Play Button is visible
+PASS: Fullscreen Button is visible
+PASS: Rewind Button is not visible
+PASS: Status Display is not visible
+PASS: Mute Box is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 120px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Fullscreen Button is visible
+PASS: Status Display is not visible
+PASS: Mute Box is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 150px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Mute Box is visible
+PASS: Fullscreen Button is visible
+PASS: Status Display is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 200px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Mute Box is visible
+PASS: Fullscreen Button is visible
+PASS: Status Display is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 400px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Timeline is visible
+PASS: Current Time is visible
+PASS: Thumbnail Track is visible
+PASS: Time Remaining is visible
+PASS: Mute Box is visible
+PASS: Fullscreen Button is visible
+PASS: Status Display is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+
+
+*** Test the controls layout with video and a caption track ***
+
+* Width 60px:
+PASS: Play Button is visible
+PASS: Rewind Button is not visible
+PASS: Status Display is not visible
+PASS: Mute Box is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+PASS: Fullscreen Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 90px:
+PASS: Play Button is visible
+PASS: Fullscreen Button is visible
+PASS: Rewind Button is not visible
+PASS: Status Display is not visible
+PASS: Mute Box is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 120px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Fullscreen Button is visible
+PASS: Status Display is not visible
+PASS: Mute Box is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 150px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Mute Box is visible
+PASS: Fullscreen Button is visible
+PASS: Status Display is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Caption Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 180px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Mute Box is visible
+PASS: Caption Button is visible
+PASS: Fullscreen Button is visible
+PASS: Status Display is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 200px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Mute Box is visible
+PASS: Caption Button is visible
+PASS: Fullscreen Button is visible
+PASS: Status Display is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+PASS: Timeline is not visible
+PASS: Current Time is not visible
+PASS: Thumbnail Track is not visible
+PASS: Time Remaining is not visible
+
+* Width 400px:
+PASS: Play Button is visible
+PASS: Rewind Button is visible
+PASS: Current Time is visible
+PASS: Timeline is visible
+PASS: Thumbnail Track is visible
+PASS: Time Remaining is visible
+PASS: Mute Box is visible
+PASS: Caption Button is visible
+PASS: Fullscreen Button is visible
+PASS: Status Display is not visible
+PASS: AppleTV Device Picker is not visible
+PASS: Picture-in-picture Button is not visible
+
+
+Testing finished.
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (203056 => 203057)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-07-11 14:35:54 UTC (rev 203056)
+++ trunk/Source/WebCore/ChangeLog        2016-07-11 14:37:32 UTC (rev 203057)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2016-07-11 Eric Carlson <eric.carlson@apple.com>
+
+ Add a test for media control dropoff
+ https://bugs.webkit.org/show_bug.cgi?id=151287
+ <rdar://problem/23544666>
+
+ Reviewed by Antoine Quint.
+
+ Test: media/controls/inline-elements-dropoff-order.html
+
+ * Modules/mediacontrols/mediaControlsApple.js: Expose more state to testing.
+ * testing/InternalSettings.cpp:
+ (WebCore::InternalSettings::setAllowsAirPlayForMediaPlayback): Renamed from setWirelessPlaybackDisabled.
+ (WebCore::InternalSettings::setWirelessPlaybackDisabled): Deleted.
+ * testing/InternalSettings.h:
+ * testing/InternalSettings.idl:
+
+
</ins><span class="cx"> 2016-07-11 Philippe Normand <pnormand@igalia.com>
</span><span class="cx">
</span><span class="cx"> [GStreamer][GL] crash within triggerRepaint
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediacontrolsmediaControlsApplejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js (203056 => 203057)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js        2016-07-11 14:35:54 UTC (rev 203056)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js        2016-07-11 14:37:32 UTC (rev 203057)
</span><span class="lines">@@ -2288,33 +2288,37 @@
</span><span class="cx"> {
</span><span class="cx"> name: "Show Controls",
</span><span class="cx"> object: this.showControlsButton,
</span><del>- extraProperties: ["hidden"]
</del><ins>+ extraProperties: ["hidden"],
</ins><span class="cx"> },
</span><span class="cx"> {
</span><span class="cx"> name: "Status Display",
</span><span class="cx"> object: this.controls.statusDisplay,
</span><span class="cx"> styleValues: ["display"],
</span><del>- extraProperties: ["textContent"]
</del><ins>+ extraProperties: ["textContent"],
</ins><span class="cx"> },
</span><span class="cx"> {
</span><span class="cx"> name: "Play Button",
</span><del>- object: this.controls.playButton
</del><ins>+ object: this.controls.playButton,
+ extraProperties: ["hidden"],
</ins><span class="cx"> },
</span><span class="cx"> {
</span><span class="cx"> name: "Rewind Button",
</span><del>- object: this.controls.rewindButton
</del><ins>+ object: this.controls.rewindButton,
+ extraProperties: ["hidden"],
</ins><span class="cx"> },
</span><span class="cx"> {
</span><span class="cx"> name: "Timeline Box",
</span><del>- object: this.controls.timelineBox
</del><ins>+ object: this.controls.timelineBox,
</ins><span class="cx"> },
</span><span class="cx"> {
</span><span class="cx"> name: "Mute Box",
</span><del>- object: this.controls.muteBox
</del><ins>+ object: this.controls.muteBox,
+ extraProperties: ["hidden"],
</ins><span class="cx"> },
</span><span class="cx"> {
</span><span class="cx"> name: "Fullscreen Button",
</span><del>- object: this.controls.fullscreenButton
</del><ins>+ object: this.controls.fullscreenButton,
+ extraProperties: ["hidden"],
</ins><span class="cx"> },
</span><span class="cx"> {
</span><span class="cx"> name: "AppleTV Device Picker",
</span><span class="lines">@@ -2325,11 +2329,36 @@
</span><span class="cx"> {
</span><span class="cx"> name: "Picture-in-picture Button",
</span><span class="cx"> object: this.controls.pictureInPictureButton,
</span><del>- extraProperties: ["parentElement"],
</del><ins>+ extraProperties: ["parentElement", "hidden"],
</ins><span class="cx"> },
</span><span class="cx"> {
</span><ins>+ name: "Caption Button",
+ object: this.controls.captionButton,
+ extraProperties: ["hidden"],
+ },
+ {
+ name: "Timeline",
+ object: this.controls.timeline,
+ extraProperties: ["hidden"],
+ },
+ {
+ name: "Current Time",
+ object: this.controls.currentTime,
+ extraProperties: ["hidden"],
+ },
+ {
+ name: "Thumbnail Track",
+ object: this.controls.thumbnailTrack,
+ extraProperties: ["hidden"],
+ },
+ {
+ name: "Time Remaining",
+ object: this.controls.remainingTime,
+ extraProperties: ["hidden"],
+ },
+ {
</ins><span class="cx"> name: "Track Menu",
</span><del>- object: this.captionMenu
</del><ins>+ object: this.captionMenu,
</ins><span class="cx"> },
</span><span class="cx"> {
</span><span class="cx"> name: "Inline playback placeholder",
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalSettingscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/InternalSettings.cpp (203056 => 203057)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/InternalSettings.cpp        2016-07-11 14:35:54 UTC (rev 203056)
+++ trunk/Source/WebCore/testing/InternalSettings.cpp        2016-07-11 14:37:32 UTC (rev 203057)
</span><span class="lines">@@ -227,7 +227,7 @@
</span><span class="cx"> , m_backup(page->settings())
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET)
</span><del>- page->settings().setAllowsAirPlayForMediaPlayback(false);
</del><ins>+ setAllowsAirPlayForMediaPlayback(false);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -238,7 +238,7 @@
</span><span class="cx"> page()->setCanStartMedia(true);
</span><span class="cx"> page()->settings().setForcePendingWebGLPolicy(false);
</span><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET)
</span><del>- page()->settings().setAllowsAirPlayForMediaPlayback(false);
</del><ins>+ setAllowsAirPlayForMediaPlayback(false);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> m_backup.restoreTo(*settings());
</span><span class="lines">@@ -381,12 +381,12 @@
</span><span class="cx"> m_page->setCanStartMedia(enabled);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void InternalSettings::setWirelessPlaybackDisabled(bool available)
</del><ins>+void InternalSettings::setAllowsAirPlayForMediaPlayback(bool allows)
</ins><span class="cx"> {
</span><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET)
</span><del>- m_page->settings().setAllowsAirPlayForMediaPlayback(available);
</del><ins>+ m_page->settings().setAllowsAirPlayForMediaPlayback(allows);
</ins><span class="cx"> #else
</span><del>- UNUSED_PARAM(available);
</del><ins>+ UNUSED_PARAM(allows);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalSettingsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/InternalSettings.h (203056 => 203057)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/InternalSettings.h        2016-07-11 14:35:54 UTC (rev 203056)
+++ trunk/Source/WebCore/testing/InternalSettings.h        2016-07-11 14:37:32 UTC (rev 203057)
</span><span class="lines">@@ -138,7 +138,7 @@
</span><span class="cx"> void setTextAutosizingFontScaleFactor(float fontScaleFactor, ExceptionCode&);
</span><span class="cx"> void setMediaTypeOverride(const String& mediaType, ExceptionCode&);
</span><span class="cx"> void setCanStartMedia(bool, ExceptionCode&);
</span><del>- void setWirelessPlaybackDisabled(bool);
</del><ins>+ void setAllowsAirPlayForMediaPlayback(bool);
</ins><span class="cx"> void setEditingBehavior(const String&, ExceptionCode&);
</span><span class="cx"> void setPreferMIMETypeForImages(bool, ExceptionCode&);
</span><span class="cx"> void setShouldDisplayTrackKind(const String& kind, bool enabled, ExceptionCode&);
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalSettingsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/InternalSettings.idl (203056 => 203057)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/InternalSettings.idl        2016-07-11 14:35:54 UTC (rev 203056)
+++ trunk/Source/WebCore/testing/InternalSettings.idl        2016-07-11 14:37:32 UTC (rev 203057)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx"> [RaisesException] void setDefaultVideoPosterURL(DOMString poster);
</span><span class="cx"> [RaisesException] void setTimeWithoutMouseMovementBeforeHidingControls(unrestricted double time);
</span><span class="cx"> [RaisesException] void setMediaTypeOverride(DOMString mediaTypeOverride);
</span><del>- void setWirelessPlaybackDisabled(boolean available);
</del><ins>+ void setAllowsAirPlayForMediaPlayback(boolean available);
</ins><span class="cx">
</span><span class="cx"> [RaisesException] void setForcePendingWebGLPolicy(boolean forced);
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>