<!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>[213256] trunk/LayoutTests</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/213256">213256</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2017-03-01 18:43:28 -0800 (Wed, 01 Mar 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>LayoutTest media/modern-media-controls/seek-forward-support/seek-forward-support.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=168943
&lt;rdar://problem/30796542&gt;

Patch by Antoine Quint &lt;graouts@apple.com&gt; on 2017-03-01
Reviewed by Jon Lee.

We rewrite the test to use asynchronous assertions and key off the various steps needed to enter fullscreen
and start pressing the skip forward button. We also no longer expect a specific currentTime to be reached but
only check that pressing the skip forward button eventually gets us far enough in the future.

* media/modern-media-controls/seek-forward-support/seek-forward-support-expected.txt:
* media/modern-media-controls/seek-forward-support/seek-forward-support.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsmediamodernmediacontrolsseekforwardsupportseekforwardsupportexpectedtxt">trunk/LayoutTests/media/modern-media-controls/seek-forward-support/seek-forward-support-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediamodernmediacontrolsseekforwardsupportseekforwardsupporthtml">trunk/LayoutTests/media/modern-media-controls/seek-forward-support/seek-forward-support.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (213255 => 213256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-03-02 02:40:59 UTC (rev 213255)
+++ trunk/LayoutTests/ChangeLog        2017-03-02 02:43:28 UTC (rev 213256)
</span><span class="lines">@@ -1,5 +1,20 @@
</span><span class="cx"> 2017-03-01  Antoine Quint  &lt;graouts@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        LayoutTest media/modern-media-controls/seek-forward-support/seek-forward-support.html is a flaky timeout
+        https://bugs.webkit.org/show_bug.cgi?id=168943
+        &lt;rdar://problem/30796542&gt;
+
+        Reviewed by Jon Lee.
+
+        We rewrite the test to use asynchronous assertions and key off the various steps needed to enter fullscreen
+        and start pressing the skip forward button. We also no longer expect a specific currentTime to be reached but
+        only check that pressing the skip forward button eventually gets us far enough in the future.
+
+        * media/modern-media-controls/seek-forward-support/seek-forward-support-expected.txt:
+        * media/modern-media-controls/seek-forward-support/seek-forward-support.html:
+
+2017-03-01  Antoine Quint  &lt;graouts@apple.com&gt;
+
</ins><span class="cx">         Unskip media/modern-media-controls/audio/audio-controls-buttons.html
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=165234
</span><span class="cx">         &lt;rdar://problem/30282714&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsmediamodernmediacontrolsseekforwardsupportseekforwardsupportexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/media/modern-media-controls/seek-forward-support/seek-forward-support-expected.txt (213255 => 213256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/modern-media-controls/seek-forward-support/seek-forward-support-expected.txt        2017-03-02 02:40:59 UTC (rev 213255)
+++ trunk/LayoutTests/media/modern-media-controls/seek-forward-support/seek-forward-support-expected.txt        2017-03-02 02:43:28 UTC (rev 213256)
</span><span class="lines">@@ -1,14 +1,17 @@
</span><del>-Testing the fast forward button in fullscreen.
</del><ins>+Testing the forward button in fullscreen.
</ins><span class="cx"> 
</span><span class="cx"> On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-Media entered fullscreen
-PASS media.currentTime is 0
</del><ins>+PASS !!window.internals.shadowRoot(media).lastChild.querySelector(&quot;button.forward&quot;) became true
+PASS media.webkitDisplayingFullscreen is true
+
+Setting media.currentTime to 2s
+PASS media.currentTime is 2
</ins><span class="cx"> PASS media.paused is true
</span><span class="cx"> 
</span><del>-Media was fast-forwarded for 1 second
-PASS media.currentTime is &gt;= 1
</del><ins>+Starting to press on the skip forward button
+PASS media.currentTime &gt; 2.5 became true
</ins><span class="cx"> PASS media.paused is true
</span><span class="cx"> 
</span><span class="cx"> PASS successfullyParsed is true
</span></span></pre></div>
<a id="trunkLayoutTestsmediamodernmediacontrolsseekforwardsupportseekforwardsupporthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/media/modern-media-controls/seek-forward-support/seek-forward-support.html (213255 => 213256)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/modern-media-controls/seek-forward-support/seek-forward-support.html        2017-03-02 02:40:59 UTC (rev 213255)
+++ trunk/LayoutTests/media/modern-media-controls/seek-forward-support/seek-forward-support.html        2017-03-02 02:43:28 UTC (rev 213256)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> &lt;!DOCTYPE html&gt;
</span><span class="cx"> &lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
</span><ins>+&lt;script src=&quot;../resources/media-controls-utils.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;body&gt;
</span><span class="cx"> &lt;video src=&quot;../../content/test.mp4&quot; style=&quot;width: 320px; height: 240px;&quot; controls&gt;&lt;/video&gt;
</span><span class="cx"> &lt;div id=&quot;shadow&quot;&gt;&lt;/div&gt;
</span><span class="lines">@@ -7,58 +8,37 @@
</span><span class="cx"> 
</span><span class="cx"> window.jsTestIsAsync = true;
</span><span class="cx"> 
</span><del>-description(&quot;Testing the fast forward button in fullscreen.&quot;);
</del><ins>+description(&quot;Testing the forward button in fullscreen.&quot;);
</ins><span class="cx"> 
</span><span class="cx"> const media = document.querySelector(&quot;video&quot;);
</span><span class="cx"> const button = document.body.appendChild(document.createElement(&quot;button&quot;));
</span><del>-let shadowRoot = window.internals.shadowRoot(media);
</del><span class="cx"> 
</span><del>-media.addEventListener(&quot;webkitfullscreenchange&quot;, function() {
-    if (media.webkitDisplayingFullscreen) {
-        window.requestAnimationFrame(() =&gt; {
-            debug(&quot;Media entered fullscreen&quot;);
-            shouldBe(&quot;media.currentTime&quot;, &quot;0&quot;);
-            shouldBeTrue(&quot;media.paused&quot;);
</del><ins>+button.addEventListener(&quot;click&quot;, () =&gt; media.webkitEnterFullscreen());
</ins><span class="cx"> 
</span><del>-            const forwardButtonElement = shadowRoot.lastChild.querySelector(&quot;button.forward&quot;);
-            forwardButtonElement.dispatchEvent(new MouseEvent(&quot;mousedown&quot;));
</del><ins>+media.addEventListener(&quot;loadedmetadata&quot;, () =&gt; {
+    pressOnElement(button);
+    shouldBecomeEqual('!!window.internals.shadowRoot(media).lastChild.querySelector(&quot;button.forward&quot;)', &quot;true&quot;, () =&gt; {
+        shouldBeTrue(&quot;media.webkitDisplayingFullscreen&quot;);
+        debug(&quot;&quot;);
+        debug(&quot;Setting media.currentTime to 2s&quot;);
+        media.currentTime = 2;
+        shouldBe(&quot;media.currentTime&quot;, &quot;2&quot;);
+        shouldBeTrue(&quot;media.paused&quot;);
</ins><span class="cx"> 
</span><del>-            setTimeout(() =&gt; {
-                debug(&quot;&quot;);
-                debug(&quot;Media was fast-forwarded for 1 second&quot;);
-                forwardButtonElement.dispatchEvent(new MouseEvent(&quot;mouseup&quot;));
</del><ins>+        debug(&quot;&quot;);
+        debug(&quot;Starting to press on the skip forward button&quot;);
+        const forwardButtonElement = window.internals.shadowRoot(media).lastChild.querySelector(&quot;button.forward&quot;);
+        forwardButtonElement.dispatchEvent(new MouseEvent(&quot;mousedown&quot;));
</ins><span class="cx"> 
</span><del>-                shouldBeGreaterThanOrEqual(&quot;media.currentTime&quot;, &quot;1&quot;);
-                shouldBeTrue(&quot;media.paused&quot;);
-
-                debug(&quot;&quot;);
-                media.remove();
-                button.remove();
-                finishJSTest();
-            }, 1000);
</del><ins>+        shouldBecomeEqual(&quot;media.currentTime &gt; 2.5&quot;, &quot;true&quot;, () =&gt; {
+            forwardButtonElement.dispatchEvent(new MouseEvent(&quot;mouseup&quot;));
+            shouldBeTrue(&quot;media.paused&quot;);
+            debug(&quot;&quot;);
+            media.remove();
+            button.remove();
+            finishJSTest();
</ins><span class="cx">         });
</span><del>-    }
-});
-
-media.addEventListener(&quot;loadedmetadata&quot;, () =&gt; {
-    if (!(&quot;eventSender&quot; in window)) {
-        debug(&quot;This test is designed to run in DRT&quot;);
-        return;
-    }
-
-    // Click a button so we may enter fullscreen.
-    button.addEventListener(&quot;click&quot;, event =&gt; {
-        try {
-            media.webkitEnterFullscreen();
-        } catch(e) {
-            debug(&quot;Toggling fullscreen failed&quot;);
-            finishJSTest();
-        }
</del><span class="cx">     });
</span><del>-
-    eventSender.mouseMoveTo(button.offsetLeft + 1, button.offsetTop + 1);
-    eventSender.mouseDown();
-    eventSender.mouseUp();
</del><span class="cx"> });
</span><span class="cx"> 
</span><span class="cx"> &lt;/script&gt;
</span></span></pre>
</div>
</div>

</body>
</html>