<!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>[179378] 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/179378">179378</a></dd>
<dt>Author</dt> <dd>eric.carlson@apple.com</dd>
<dt>Date</dt> <dd>2015-01-29 16:04:37 -0800 (Thu, 29 Jan 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>media/track/track-in-band-cues-added-once.html fails sometimes
https://bugs.webkit.org/show_bug.cgi?id=138806

Reviewed by Brent Fulgham.

* media/track/track-in-band-cues-added-once-expected.txt: Update results.
* media/track/track-in-band-cues-added-once.html: Seek before beginning playback so
    the media engine is more likely to buffer and process the initial cue.
* platform/mac/TestExpectations: Unskip track-in-band-cues-added-once.html.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsmediatracktrackinbandcuesaddedonceexpectedtxt">trunk/LayoutTests/media/track/track-in-band-cues-added-once-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediatracktrackinbandcuesaddedoncehtml">trunk/LayoutTests/media/track/track-in-band-cues-added-once.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 (179377 => 179378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-01-30 00:02:41 UTC (rev 179377)
+++ trunk/LayoutTests/ChangeLog        2015-01-30 00:04:37 UTC (rev 179378)
</span><span class="lines">@@ -1,5 +1,17 @@
</span><span class="cx"> 2015-01-29  Eric Carlson  &lt;eric.carlson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        media/track/track-in-band-cues-added-once.html fails sometimes
+        https://bugs.webkit.org/show_bug.cgi?id=138806
+
+        Reviewed by Brent Fulgham.
+
+        * media/track/track-in-band-cues-added-once-expected.txt: Update results.
+        * media/track/track-in-band-cues-added-once.html: Seek before beginning playback so
+            the media engine is more likely to buffer and process the initial cue.
+        * platform/mac/TestExpectations: Unskip track-in-band-cues-added-once.html.
+
+2015-01-29  Eric Carlson  &lt;eric.carlson@apple.com&gt;
+
</ins><span class="cx">         REGRESSION (OS X 10.10.2): media/track/track-in-band-style.html frequently times out
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=140974
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsmediatracktrackinbandcuesaddedonceexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/media/track/track-in-band-cues-added-once-expected.txt (179377 => 179378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/track-in-band-cues-added-once-expected.txt        2015-01-30 00:02:41 UTC (rev 179377)
+++ trunk/LayoutTests/media/track/track-in-band-cues-added-once-expected.txt        2015-01-30 00:04:37 UTC (rev 179378)
</span><span class="lines">@@ -15,12 +15,12 @@
</span><span class="cx"> EXPECTED (inbandTrack1.kind == 'captions') OK
</span><span class="cx"> 
</span><span class="cx"> RUN(inbandTrack1.mode = 'showing')
</span><ins>+EVENT(change)
</ins><span class="cx"> RUN(video.play())
</span><ins>+
</ins><span class="cx"> RUN(video.pause())
</span><del>-RUN(video.currentTime = 0)
</del><span class="cx"> RUN(video.play())
</span><span class="cx"> 
</span><del>-EVENT(seeked)
</del><span class="cx"> RUN(video.pause())
</span><span class="cx"> END OF TEST
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsmediatracktrackinbandcuesaddedoncehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/media/track/track-in-band-cues-added-once.html (179377 => 179378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/track-in-band-cues-added-once.html        2015-01-30 00:02:41 UTC (rev 179377)
+++ trunk/LayoutTests/media/track/track-in-band-cues-added-once.html        2015-01-30 00:04:37 UTC (rev 179378)
</span><span class="lines">@@ -27,44 +27,63 @@
</span><span class="cx"> 
</span><span class="cx">             function pollProgress()
</span><span class="cx">             {
</span><del>-                if (video.currentTime &lt; 2)
-                    return;
</del><ins>+                switch (seekedCount) {
+                case 1:
+                    video.currentTime = 0;
+                    run(&quot;video.play()&quot;);
+                    consoleWrite(&quot;&quot;);
+                    break;
</ins><span class="cx"> 
</span><del>-                if (!seekedCount &amp;&amp; inbandTrack1.cues.length &gt;= 5) {
</del><ins>+                case 2:
+                    if (video.currentTime &lt; 2 || inbandTrack1.cues.length &lt;= 5)
+                        return;
+
</ins><span class="cx">                     // Collect the start times of all cues, seek back to the beginning and play
</span><span class="cx">                     // the same segment of the video file.
</span><span class="cx">                     run(&quot;video.pause()&quot;);
</span><span class="cx">                     for (var i = 0; i &lt; inbandTrack1.cues.length; ++i)
</span><span class="cx">                         cuesStarts.push(inbandTrack1.cues[i].startTime);
</span><del>-                    run(&quot;video.currentTime = 0&quot;);
</del><ins>+                    video.currentTime = 0;
</ins><span class="cx">                     run(&quot;video.play()&quot;);
</span><span class="cx">                     consoleWrite(&quot;&quot;);
</span><del>-                    return;
-                }
</del><ins>+                    break;
</ins><span class="cx"> 
</span><del>-                if (inbandTrack1.cues.length &lt; cuesStarts.length)
-                    return;
-
-                run(&quot;video.pause()&quot;);
-                var failure = false;
-                for (var i = 0; i &lt; cuesStarts.length; ++i) {
-                    if (cuesStarts[i] != inbandTrack1.cues[i].startTime) {
-                        failure = true;
</del><ins>+                case 3:
+                    if (inbandTrack1.cues.length &lt; cuesStarts.length)
</ins><span class="cx">                         break;
</span><del>-                    }
-                }
-
-                if (failure) {
-                    consoleWrite(&quot;&lt;br&gt;&lt;i&gt;** FAIL&lt;&quot; + &quot;/i&gt;&quot;);
</del><ins>+    
+                    run(&quot;video.pause()&quot;);
+                    var failure = false;
</ins><span class="cx">                     for (var i = 0; i &lt; cuesStarts.length; ++i) {
</span><del>-                        var oldStart = cuesStarts[i];
-                        var newStart = inbandTrack1.cues[i].startTime;
-                        consoleWrite(&quot;Cue &quot; + i + &quot; start time was: &quot; + oldStart + &quot;, is now: &quot; + newStart);
</del><ins>+                        if (cuesStarts[i] != inbandTrack1.cues[i].startTime) {
+                            failure = true;
+                            break;
+                        }
</ins><span class="cx">                     }
</span><del>-                    consoleWrite(&quot;&quot;);
</del><ins>+    
+                    if (failure) {
+                        consoleWrite(&quot;&lt;br&gt;&lt;i&gt;** FAIL&lt;&quot; + &quot;/i&gt;&quot;);
+                        for (var i = 0; i &lt; cuesStarts.length; ++i) {
+                            var oldStart = cuesStarts[i];
+                            var newStart = inbandTrack1.cues[i].startTime;
+                            consoleWrite(&quot;Cue &quot; + i + &quot; start time was: &quot; + oldStart + &quot;, is now: &quot; + newStart);
+                        }
+                        consoleWrite(&quot;&quot;);
+                    }
+    
+                    endTest();
+                    break;
</ins><span class="cx">                 }
</span><ins>+            }
</ins><span class="cx"> 
</span><del>-                endTest();
</del><ins>+            function tracksChanged()
+            {
+                setInterval(pollProgress, 100);
+                
+                // We seek to time 0.1 and then back to 0 before starting playback to make it more likely
+                // that the media engine will process the initial media samples and deliver the first
+                // inband cues to WebKit.
+                video.currentTime = 0.1;
</ins><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             function canplaythrough()
</span><span class="lines">@@ -78,14 +97,12 @@
</span><span class="cx">                 testExpected(&quot;inbandTrack1.cues&quot;, null);
</span><span class="cx">                 testExpected(&quot;inbandTrack1.language&quot;, &quot;en&quot;);
</span><span class="cx">                 testExpected(&quot;inbandTrack1.kind&quot;, &quot;captions&quot;);
</span><ins>+                waitForEventOn(video.textTracks, 'change', tracksChanged);
</ins><span class="cx"> 
</span><del>-
</del><span class="cx">                 consoleWrite(&quot;&quot;);
</span><span class="cx"> 
</span><del>-                waitForEvent('seeked', function() { ++seekedCount; });
-                setInterval(pollProgress, 100);
</del><ins>+                video.addEventListener(&quot;seeked&quot;, function() { ++seekedCount; });
</ins><span class="cx">                 run(&quot;inbandTrack1.mode = 'showing'&quot;);
</span><del>-                run(&quot;video.play()&quot;);
</del><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             function setup()
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/TestExpectations (179377 => 179378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/TestExpectations        2015-01-30 00:02:41 UTC (rev 179377)
+++ trunk/LayoutTests/platform/mac/TestExpectations        2015-01-30 00:04:37 UTC (rev 179378)
</span><span class="lines">@@ -1189,8 +1189,6 @@
</span><span class="cx"> # We should land updated results if we can't get this bug fixed in time.
</span><span class="cx"> [ Yosemite+ ] http/tests/xmlhttprequest/cache-override.html [ Failure ]
</span><span class="cx"> 
</span><del>-webkit.org/b/138806 [ Yosemite+ ] media/track/track-in-band-cues-added-once.html [ Pass Failure ]
-
</del><span class="cx"> # FIXME: Needs bugzilla (&lt;rdar://problem/16802900&gt;)
</span><span class="cx"> [ Yosemite+ ] fast/forms/select-initial-position.html [ Failure ]
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>