<!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>[213340] 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/213340">213340</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2017-03-02 18:45:28 -0800 (Thu, 02 Mar 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>LayoutTest media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=167348
&lt;rdar://problem/30822186&gt;

Patch by Antoine Quint &lt;graouts@apple.com&gt; on 2017-03-02
Reviewed by Tim Horton.

Since timing is hard to test accurately, simplify the test to only check that we're transitioning
from one state to another and use the asynchronous, polling-based assertions to check that we will
be transitioning between those two states (visible and faded).

* media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave-expected.txt:
* media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave.html:
* platform/mac/TestExpectations:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsmediamodernmediacontrolsmediacontrollermediacontrollerautohidemouseenterandmouseleaveexpectedtxt">trunk/LayoutTests/media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediamodernmediacontrolsmediacontrollermediacontrollerautohidemouseenterandmouseleavehtml">trunk/LayoutTests/media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave.html</a></li>
<li><a href="#trunkLayoutTestsplatformmacTestExpectations">trunk/LayoutTests/platform/mac/TestExpectations</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (213339 => 213340)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-03-03 02:45:25 UTC (rev 213339)
+++ trunk/LayoutTests/ChangeLog        2017-03-03 02:45:28 UTC (rev 213340)
</span><span class="lines">@@ -1,5 +1,21 @@
</span><span class="cx"> 2017-03-02  Antoine Quint  &lt;graouts@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        LayoutTest media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave.html is a flaky failure
+        https://bugs.webkit.org/show_bug.cgi?id=167348
+        &lt;rdar://problem/30822186&gt;
+
+        Reviewed by Tim Horton.
+
+        Since timing is hard to test accurately, simplify the test to only check that we're transitioning
+        from one state to another and use the asynchronous, polling-based assertions to check that we will
+        be transitioning between those two states (visible and faded).
+
+        * media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave-expected.txt:
+        * media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave.html:
+        * platform/mac/TestExpectations:
+
+2017-03-02  Antoine Quint  &lt;graouts@apple.com&gt;
+
</ins><span class="cx">         LayoutTest media/modern-media-controls/media-controller/media-controller-auto-hide.html is flaky
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=167263
</span><span class="cx">         &lt;rdar://problem/30821398&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsmediamodernmediacontrolsmediacontrollermediacontrollerautohidemouseenterandmouseleaveexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave-expected.txt (213339 => 213340)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave-expected.txt        2017-03-03 02:45:25 UTC (rev 213339)
+++ trunk/LayoutTests/media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave-expected.txt        2017-03-03 02:45:28 UTC (rev 213340)
</span><span class="lines">@@ -3,18 +3,20 @@
</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>-Video started playing, controls bar is visible by default.
-PASS controlsBar.classList.contains('faded') is false
</del><ins>+PASS !!shadowRoot.querySelector('.controls-bar') became true
</ins><span class="cx"> 
</span><del>-Auto-hide timer has elapsed, controls bar should be faded.
-PASS controlsBar.classList.contains('faded') is true
</del><ins>+Video started playing, controls bar should become visible by default.
+PASS shadowRoot.querySelector('.controls-bar').classList.contains('faded') became false
</ins><span class="cx"> 
</span><del>-Mouse moved over the media, controls bar should be visible.
-PASS controlsBar.classList.contains('faded') is false
</del><ins>+Controls bar should become faded when the auto-hide timer elapses.
+PASS shadowRoot.querySelector('.controls-bar').classList.contains('faded') became true
</ins><span class="cx"> 
</span><del>-Mouse moved out of the media, controls bar should be faded.
-PASS controlsBar.classList.contains('faded') is true
</del><ins>+Mouse moved over the media, controls bar should become visible again.
+PASS shadowRoot.querySelector('.controls-bar').classList.contains('faded') became false
</ins><span class="cx"> 
</span><ins>+Mouse moved out of the media, controls bar should become faded.
+PASS shadowRoot.querySelector('.controls-bar').classList.contains('faded') became true
+
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsmediamodernmediacontrolsmediacontrollermediacontrollerautohidemouseenterandmouseleavehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave.html (213339 => 213340)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave.html        2017-03-03 02:45:25 UTC (rev 213339)
+++ trunk/LayoutTests/media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave.html        2017-03-03 02:45:28 UTC (rev 213340)
</span><span class="lines">@@ -1,7 +1,7 @@
</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><span class="cx"> &lt;body&gt;
</span><del>-&lt;video src=&quot;../../content/test.mp4&quot; style=&quot;position: absolute; left: 0; top: 0; width: 320px; height: 240px;&quot; controls autoplay data-auto-hide-delay=&quot;250&quot;&gt;&lt;/video&gt;
</del><ins>+&lt;video src=&quot;../../content/test.mp4&quot; style=&quot;position: absolute; left: 0; top: 0; width: 320px; height: 240px;&quot; controls autoplay&gt;&lt;/video&gt;
</ins><span class="cx"> &lt;script type=&quot;text/javascript&quot;&gt;
</span><span class="cx"> 
</span><span class="cx"> window.jsTestIsAsync = true;
</span><span class="lines">@@ -8,39 +8,32 @@
</span><span class="cx"> 
</span><span class="cx"> description(&quot;Testing the controls bar appears when the mouse enters and disappears when the mouse leaves the media.&quot;);
</span><span class="cx"> 
</span><del>-let controlsBar;
</del><ins>+const media = document.querySelector(&quot;video&quot;);
+const shadowRoot = window.internals.shadowRoot(media);
</ins><span class="cx"> 
</span><del>-document.querySelector(&quot;video&quot;).addEventListener(&quot;play&quot;, (event) =&gt; {
-    window.requestAnimationFrame(() =&gt; {
-        const media = event.target;
-        controlsBar = window.internals.shadowRoot(media).querySelector(&quot;.controls-bar&quot;);
-
-        debug(&quot;Video started playing, controls bar is visible by default.&quot;);
-        shouldBeFalse(&quot;controlsBar.classList.contains('faded')&quot;);
-
-        setTimeout(() =&gt; {
</del><ins>+media.addEventListener(&quot;play&quot;, (event) =&gt; {
+    shouldBecomeEqual(&quot;!!shadowRoot.querySelector('.controls-bar')&quot;, &quot;true&quot;, () =&gt; {
+        debug(&quot;&quot;);
+        debug(&quot;Video started playing, controls bar should become visible by default.&quot;);
+        shouldBecomeEqual(&quot;shadowRoot.querySelector('.controls-bar').classList.contains('faded')&quot;, &quot;false&quot;, () =&gt; {
</ins><span class="cx">             debug(&quot;&quot;);
</span><del>-            debug(&quot;Auto-hide timer has elapsed, controls bar should be faded.&quot;);
-            shouldBeTrue(&quot;controlsBar.classList.contains('faded')&quot;);
-
-            eventSender.mouseMoveTo(100, 100);
-            window.requestAnimationFrame(() =&gt; {
</del><ins>+            debug(&quot;Controls bar should become faded when the auto-hide timer elapses.&quot;);
+            shouldBecomeEqual(&quot;shadowRoot.querySelector('.controls-bar').classList.contains('faded')&quot;, &quot;true&quot;, () =&gt; {
+                eventSender.mouseMoveTo(100, 100);
</ins><span class="cx">                 debug(&quot;&quot;);
</span><del>-                debug(&quot;Mouse moved over the media, controls bar should be visible.&quot;);
-                shouldBeFalse(&quot;controlsBar.classList.contains('faded')&quot;);
-
-                eventSender.mouseMoveTo(400, 400);
-                window.requestAnimationFrame(() =&gt; {
</del><ins>+                debug(&quot;Mouse moved over the media, controls bar should become visible again.&quot;);
+                shouldBecomeEqual(&quot;shadowRoot.querySelector('.controls-bar').classList.contains('faded')&quot;, &quot;false&quot;, () =&gt; {
+                    eventSender.mouseMoveTo(400, 400);
</ins><span class="cx">                     debug(&quot;&quot;);
</span><del>-                    debug(&quot;Mouse moved out of the media, controls bar should be faded.&quot;);
-                    shouldBeTrue(&quot;controlsBar.classList.contains('faded')&quot;);
-
-                    debug(&quot;&quot;);
-                    media.remove();
-                    finishJSTest();
</del><ins>+                    debug(&quot;Mouse moved out of the media, controls bar should become faded.&quot;);
+                    shouldBecomeEqual(&quot;shadowRoot.querySelector('.controls-bar').classList.contains('faded')&quot;, &quot;true&quot;, () =&gt; {
+                        debug(&quot;&quot;);
+                        media.remove();
+                        finishJSTest();
+                    });
</ins><span class="cx">                 });
</span><span class="cx">             });
</span><del>-        }, 300);
</del><ins>+        });
</ins><span class="cx">     });
</span><span class="cx"> });
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/TestExpectations (213339 => 213340)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/TestExpectations        2017-03-03 02:45:25 UTC (rev 213339)
+++ trunk/LayoutTests/platform/mac/TestExpectations        2017-03-03 02:45:28 UTC (rev 213340)
</span><span class="lines">@@ -1483,8 +1483,6 @@
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/167275 media/modern-media-controls/tracks-support/tracks-support-show-panel-after-dragging-controls.html [ Pass Failure ]
</span><span class="cx"> 
</span><del>-webkit.org/b/167347 media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave.html [ Pass Failure ]
-
</del><span class="cx"> webkit.org/b/167266 media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-over-controls-bar.html [ Pass Failure ]
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/167373 media/modern-media-controls/tracks-support/tracks-support-show-panel-fullscreen.html [ Pass Failure ]
</span></span></pre>
</div>
</div>

</body>
</html>