Title: [100296] trunk/LayoutTests
Revision
100296
Author
ann...@chromium.org
Date
2011-11-15 11:14:53 -0800 (Tue, 15 Nov 2011)

Log Message

Change layout tests for cuechange, enter, and exit events to check the order
rather than the timing of the events (since actual timing can not be guaranteed).
https://bugs.webkit.org/show_bug.cgi?id=72269

Reviewed by Tony Gentilcore.

* media/track/track-cues-cuechange-expected.txt:
* media/track/track-cues-cuechange.html:
* media/track/track-cues-enter-exit-expected.txt:
* media/track/track-cues-enter-exit.html:
* platform/chromium/test_expectations.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (100295 => 100296)


--- trunk/LayoutTests/ChangeLog	2011-11-15 18:58:15 UTC (rev 100295)
+++ trunk/LayoutTests/ChangeLog	2011-11-15 19:14:53 UTC (rev 100296)
@@ -1,3 +1,17 @@
+2011-11-15  Anna Cavender  <ann...@chromium.org>
+
+        Change layout tests for cuechange, enter, and exit events to check the order
+        rather than the timing of the events (since actual timing can not be guaranteed).
+        https://bugs.webkit.org/show_bug.cgi?id=72269
+
+        Reviewed by Tony Gentilcore.
+
+        * media/track/track-cues-cuechange-expected.txt:
+        * media/track/track-cues-cuechange.html:
+        * media/track/track-cues-enter-exit-expected.txt:
+        * media/track/track-cues-enter-exit.html:
+        * platform/chromium/test_expectations.txt:
+
 2011-11-15  Tony Chang  <t...@chromium.org>
 
         enable new flexbox tests everywhere

Modified: trunk/LayoutTests/media/track/track-cues-cuechange-expected.txt (100295 => 100296)


--- trunk/LayoutTests/media/track/track-cues-cuechange-expected.txt	2011-11-15 18:58:15 UTC (rev 100295)
+++ trunk/LayoutTests/media/track/track-cues-cuechange-expected.txt	2011-11-15 19:14:53 UTC (rev 100296)
@@ -1,76 +1,56 @@
-Tests that TextTrack's cues are indexed and updated within 500ms during video playback. Test uses the cuechange event.
+Tests that TextTrack's cues are indexed and updated in order during video playback. Test uses the cuechange event.
 
-This test may fail occasionally since we cannot guarantee that cue events will fire within 250ms of their startTime or endTime.
-
 EVENT(canplaythrough)
 EXPECTED (testTrack.track.cues.length == '3') OK
 RUN(video.play())
 
 EVENT(cuechange) from TextTrack
+Cue entered
 EXPECTED ([object TextTrackCue] == '[object TextTrackCue]') OK
-Start time:
-EXPECTED (video.currentTime >= '1') OK
-EXPECTED (video.currentTime < '1.5') OK
+EXPECTED (currentCue.id == '1') OK
 
 EVENT(cuechange) from <track>
+Cue entered
 EXPECTED ([object TextTrackCue] == '[object TextTrackCue]') OK
-Start time:
-EXPECTED (video.currentTime >= '1') OK
-EXPECTED (video.currentTime < '1.5') OK
+EXPECTED (currentCue.id == '1') OK
 
 EVENT(cuechange) from TextTrack
-End time:
-EXPECTED (video.currentTime >= '2') OK
-EXPECTED (video.currentTime < '2.5') OK
+Cue exited
 
 EVENT(cuechange) from <track>
-End time:
-EXPECTED (video.currentTime >= '2') OK
-EXPECTED (video.currentTime < '2.5') OK
+Cue exited
 
 EVENT(cuechange) from TextTrack
+Cue entered
 EXPECTED ([object TextTrackCue] == '[object TextTrackCue]') OK
-Start time:
-EXPECTED (video.currentTime >= '2.5') OK
-EXPECTED (video.currentTime < '3') OK
+EXPECTED (currentCue.id == '2') OK
 
 EVENT(cuechange) from <track>
+Cue entered
 EXPECTED ([object TextTrackCue] == '[object TextTrackCue]') OK
-Start time:
-EXPECTED (video.currentTime >= '2.5') OK
-EXPECTED (video.currentTime < '3') OK
+EXPECTED (currentCue.id == '2') OK
 
 EVENT(cuechange) from TextTrack
-End time:
-EXPECTED (video.currentTime >= '3.5') OK
-EXPECTED (video.currentTime < '4') OK
+Cue exited
 
 EVENT(cuechange) from <track>
-End time:
-EXPECTED (video.currentTime >= '3.5') OK
-EXPECTED (video.currentTime < '4') OK
+Cue exited
 
 EVENT(cuechange) from TextTrack
+Cue entered
 EXPECTED ([object TextTrackCue] == '[object TextTrackCue]') OK
-Start time:
-EXPECTED (video.currentTime >= '4') OK
-EXPECTED (video.currentTime < '4.5') OK
+EXPECTED (currentCue.id == '3') OK
 
 EVENT(cuechange) from <track>
+Cue entered
 EXPECTED ([object TextTrackCue] == '[object TextTrackCue]') OK
-Start time:
-EXPECTED (video.currentTime >= '4') OK
-EXPECTED (video.currentTime < '4.5') OK
+EXPECTED (currentCue.id == '3') OK
 
 EVENT(cuechange) from TextTrack
-End time:
-EXPECTED (video.currentTime >= '5') OK
-EXPECTED (video.currentTime < '5.5') OK
+Cue exited
 
 EVENT(cuechange) from <track>
-End time:
-EXPECTED (video.currentTime >= '5') OK
-EXPECTED (video.currentTime < '5.5') OK
+Cue exited
 
 END OF TEST
 

Modified: trunk/LayoutTests/media/track/track-cues-cuechange.html (100295 => 100296)


--- trunk/LayoutTests/media/track/track-cues-cuechange.html	2011-11-15 18:58:15 UTC (rev 100295)
+++ trunk/LayoutTests/media/track/track-cues-cuechange.html	2011-11-15 19:14:53 UTC (rev 100296)
@@ -7,20 +7,22 @@
         <script src=""
     </head>
     <body>
-        <p>Tests that TextTrack's cues are indexed and updated within 500ms during video playback. Test uses the cuechange event.</p>
-        <p>This test may fail occasionally since we cannot guarantee that cue events will fire within 250ms of their startTime or endTime.</p>
+        <p>Tests that TextTrack's cues are indexed and updated in order during video playback. Test uses the cuechange event.</p>
         <video controls>
             <track id="testTrack" src="" kind="captions">
         </video>
         <script>            
 
-        var timeInterval = 0.5;
         var cueChangeCount = 0;
+        var currentCue;
         var testTrack;
 
         function cueChangedFromTrackElement()
         {
             consoleWrite("EVENT(cuechange) from &lt;track&gt;");
+            
+            currentCueIndex = Math.floor(cueChangeCount/2);
+            currentCue = event.target.track.cues[currentCueIndex];
             checkCue();
 
             ++cueChangeCount;
@@ -31,25 +33,20 @@
         function cueChangedFromTextTrack()
         {
             consoleWrite("EVENT(cuechange) from TextTrack");
+            
+            currentCueIndex = Math.floor(cueChangeCount/2);
+            currentCue = event.target.cues[currentCueIndex];
             checkCue();
         }
         
         function checkCue()
         {
-            var cues = testTrack.track.cues;
-            
-            var currentCue = cues[Math.floor(cueChangeCount/2)];
-
             if (cueChangeCount % 2 == 0) {
+                consoleWrite("Cue entered");
                 testExpected(currentCue, testTrack.track.activeCues[0]);
-                consoleWrite("Start time:");
-                testExpected("video.currentTime", currentCue.startTime, '>=');
-                testExpected("video.currentTime", currentCue.startTime + timeInterval, '<');
-            } else {
-                consoleWrite("End time:");
-                testExpected("video.currentTime", currentCue.endTime, '>=');
-                testExpected("video.currentTime", currentCue.endTime + timeInterval, '<');
-            }
+                testExpected("currentCue.id", currentCueIndex + 1);
+            } else
+                consoleWrite("Cue exited");
             consoleWrite("");
         }
 

Modified: trunk/LayoutTests/media/track/track-cues-enter-exit-expected.txt (100295 => 100296)


--- trunk/LayoutTests/media/track/track-cues-enter-exit-expected.txt	2011-11-15 18:58:15 UTC (rev 100295)
+++ trunk/LayoutTests/media/track/track-cues-enter-exit-expected.txt	2011-11-15 19:14:53 UTC (rev 100296)
@@ -1,7 +1,5 @@
-Tests that TextTrack's cues are indexed and updated within 500ms during video playback. Test uses the enter and exits events on TextTrackCue.
+Tests that TextTrack's cues are indexed and updated in order during video playback. Test uses the enter and exits events on TextTrackCue.
 
-This test may fail occasionally since we cannot guarantee that cue events will fire within 250ms of their startTime or endTime.
-
 EVENT(canplaythrough)
 EXPECTED (testTrack.track.cues.length == '3') OK
 RUN(video.play())
@@ -9,38 +7,23 @@
 EVENT(enter)
 This cue is the currently active cue:
 EXPECTED ([object TextTrackCue] == '[object TextTrackCue]') OK
-Start time:
-EXPECTED (video.currentTime >= '1') OK
-EXPECTED (video.currentTime < '1.5') OK
+EXPECTED (currentCue.id == '1') OK
 
 EVENT(exit)
-End time:
-EXPECTED (video.currentTime >= '2') OK
-EXPECTED (video.currentTime < '2.5') OK
 
 EVENT(enter)
 This cue is the currently active cue:
 EXPECTED ([object TextTrackCue] == '[object TextTrackCue]') OK
-Start time:
-EXPECTED (video.currentTime >= '2.5') OK
-EXPECTED (video.currentTime < '3') OK
+EXPECTED (currentCue.id == '2') OK
 
 EVENT(exit)
-End time:
-EXPECTED (video.currentTime >= '3.5') OK
-EXPECTED (video.currentTime < '4') OK
 
 EVENT(enter)
 This cue is the currently active cue:
 EXPECTED ([object TextTrackCue] == '[object TextTrackCue]') OK
-Start time:
-EXPECTED (video.currentTime >= '4') OK
-EXPECTED (video.currentTime < '4.5') OK
+EXPECTED (currentCue.id == '3') OK
 
 EVENT(exit)
-End time:
-EXPECTED (video.currentTime >= '5') OK
-EXPECTED (video.currentTime < '5.5') OK
 
 END OF TEST
 

Modified: trunk/LayoutTests/media/track/track-cues-enter-exit.html (100295 => 100296)


--- trunk/LayoutTests/media/track/track-cues-enter-exit.html	2011-11-15 18:58:15 UTC (rev 100295)
+++ trunk/LayoutTests/media/track/track-cues-enter-exit.html	2011-11-15 19:14:53 UTC (rev 100296)
@@ -7,40 +7,31 @@
         <script src=""
     </head>
     <body>
-        <p>Tests that TextTrack's cues are indexed and updated within 500ms during video playback. Test uses the enter and exits events on TextTrackCue.</p>
-        <p>This test may fail occasionally since we cannot guarantee that cue events will fire within 250ms of their startTime or endTime.</p>
+        <p>Tests that TextTrack's cues are indexed and updated in order during video playback. Test uses the enter and exits events on TextTrackCue.</p>
         <video controls>
             <track id="testTrack" src="" kind="captions">
         </video>
         <script>            
-            
-        var timeInterval = 0.5
+
         var cueCount = 0;
+        var currentCue;
         var testTrack;
 
         function cueEntered()
         {
             consoleWrite("EVENT(enter)");
 
-            var currentCue = testTrack.track.cues[cueCount];
+            currentCue = event.target;
 
             consoleWrite("This cue is the currently active cue:");
             testExpected(currentCue, testTrack.track.activeCues[0]);
-            consoleWrite("Start time:");
-            testExpected("video.currentTime", currentCue.startTime, '>=');
-            testExpected("video.currentTime", currentCue.startTime + timeInterval, '<');
+            testExpected("currentCue.id", cueCount + 1);
             consoleWrite("");
         }
 
         function cueExited()
         {
             consoleWrite("EVENT(exit)");
-
-            var currentCue = testTrack.track.cues[cueCount];
-
-            consoleWrite("End time:");
-            testExpected("video.currentTime", currentCue.endTime, '>=');
-            testExpected("video.currentTime", currentCue.endTime + timeInterval, '<');
             consoleWrite("");
 
             ++cueCount;

Modified: trunk/LayoutTests/platform/chromium/test_expectations.txt (100295 => 100296)


--- trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-11-15 18:58:15 UTC (rev 100295)
+++ trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-11-15 19:14:53 UTC (rev 100296)
@@ -3879,7 +3879,6 @@
 BUG_TONY WIN MAC : css3/flexbox/repaint-rtl-column.html = PASS FAIL
 
 BUGWK72149 : media/track/tracklist-is-reachable.html = TEXT
-BUGWK72269 : media/track/track-cues-cuechange.html = PASS TEXT
 
 BUGV8_1821 WIN LINUX : http/tests/inspector-enabled/dedicated-workers-list.html = PASS CRASH
 BUGWK72133 SKIP MAC : http/tests/inspector-enabled/dedicated-workers-list.html = PASS CRASH TIMEOUT
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to