Title: [114005] trunk/LayoutTests
Revision
114005
Author
[email protected]
Date
2012-04-12 11:24:52 -0700 (Thu, 12 Apr 2012)

Log Message

Remove setTimeout from media/video-seek-past-end-paused.html and fix other minor issues
https://bugs.webkit.org/show_bug.cgi?id=83505

The test had an arbitrary performance expectation to start playing in 200 ms,
which caused the layout test to fail for Chromium when the Chromium's
audio buffer size increased.
This CL removes that expectation and fixes some HTML and grammar mistakes.

Reviewed by Eric Carlson.

* media/video-seek-past-end-paused-expected.txt:
* media/video-seek-past-end-paused.html:
* platform/chromium/test_expectations.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (114004 => 114005)


--- trunk/LayoutTests/ChangeLog	2012-04-12 18:11:28 UTC (rev 114004)
+++ trunk/LayoutTests/ChangeLog	2012-04-12 18:24:52 UTC (rev 114005)
@@ -1,3 +1,19 @@
+2012-04-09  Victoria Kirst  <[email protected]>
+
+        Remove setTimeout from media/video-seek-past-end-paused.html and fix other minor issues
+        https://bugs.webkit.org/show_bug.cgi?id=83505
+
+        The test had an arbitrary performance expectation to start playing in 200 ms,
+        which caused the layout test to fail for Chromium when the Chromium's
+        audio buffer size increased.
+        This CL removes that expectation and fixes some HTML and grammar mistakes.
+
+        Reviewed by Eric Carlson.
+
+        * media/video-seek-past-end-paused-expected.txt:
+        * media/video-seek-past-end-paused.html:
+        * platform/chromium/test_expectations.txt:
+
 2012-04-12  Philippe Normand  <[email protected]>
 
         Unreviewed, GTK test_expectations.

Modified: trunk/LayoutTests/media/video-seek-past-end-paused-expected.txt (114004 => 114005)


--- trunk/LayoutTests/media/video-seek-past-end-paused-expected.txt	2012-04-12 18:11:28 UTC (rev 114004)
+++ trunk/LayoutTests/media/video-seek-past-end-paused-expected.txt	2012-04-12 18:24:52 UTC (rev 114005)
@@ -1,7 +1,5 @@
-Test that seeking paused video past it's duration time sets currentTime to duration and leaves video paused.
+Test that seeking paused video past its duration time sets currentTime to duration and leaves video paused.
 
-RUN(video.load())
-
 EVENT(canplaythrough)
 EXPECTED (video.paused == 'true') OK
 EXPECTED (video.ended == 'false') OK

Modified: trunk/LayoutTests/media/video-seek-past-end-paused.html (114004 => 114005)


--- trunk/LayoutTests/media/video-seek-past-end-paused.html	2012-04-12 18:11:28 UTC (rev 114004)
+++ trunk/LayoutTests/media/video-seek-past-end-paused.html	2012-04-12 18:24:52 UTC (rev 114005)
@@ -1,45 +1,61 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <script src=""
+        <script src=""
+        <script>
+            var timeupdateEventCount = 0;
 
-<video controls></video>
-<p>Test that seeking paused video past it's duration time sets currentTime to duration and leaves video paused.</p>
-<script src=""
-<script src=""
-<script>
+            function doSetup()
+            {
+                findMediaElement();
+                waitForEvent('canplaythrough', canPlayThrough);
+                video.src = "" 'content/test');
+            }
+            window.addEventListener('load', doSetup, false);
 
-    waitForEvent('canplaythrough', function () { 
-        testExpected("video.paused", true);
-        testExpected("video.ended", false);
-        run("video.play()");
-        setTimeout(timeCheck1, 200);
-    });
+            function canPlayThrough()
+            {
+                testExpected("video.paused", true);
+                testExpected("video.ended", false);
+                video.addEventListener('timeupdate', timeUpdate);
+                run("video.play()");
+            }
 
-    function timeCheck1() 
-    {
-        consoleWrite("");
+            function timeUpdate()
+            {
+                ++timeupdateEventCount;
 
-        // make sure time is advancing, seek past end
-        testExpected("video.paused", false);
-        testExpected("mediaElement.currentTime", 0, '>');
-        video.currentTime = 500;
-        setTimeout(timeCheck2, 200);
-    }
+                // wait 2 timeupdate events so we are sure the media engine is
+                // playing the media.
+                if (timeupdateEventCount == 2) {
+                    consoleWrite("");
 
-    function timeCheck2() 
-    {
-        consoleWrite("");
+                    // make sure time is advancing, seek past end
+                    testExpected("video.paused", false);
+                    testExpected("mediaElement.currentTime", 0, '>');
+                    video.addEventListener('seeked', seeked);
+                    video.currentTime = 500;
+                }
+            }
 
-        // don't use "testExpected()" so we won't log the actual duration to the
-        //  results file, as the floating point result may differ with different engines
-        reportExpected(mediaElement.currentTime == mediaElement.duration, "mediaElement.currentTime", "==", "mediaElement.duration", mediaElement.currentTime);
+            function seeked()
+            {
+                consoleWrite("");
 
-        testExpected("video.ended", true);
-        consoleWrite("");
-        endTest();
-    }
+                // don't use "testExpected()" so we won't log the actual duration to the
+                // results file, as the floating point result may differ with different engines
+                reportExpected(mediaElement.currentTime == mediaElement.duration, "mediaElement.currentTime", "==", "mediaElement.duration", mediaElement.currentTime);
 
-    var mediaFile = findMediaFile("video", "content/test");
-    disableFullTestDetailsPrinting();
-    runSilently("video.src = ''");
-    enableFullTestDetailsPrinting();
-    run("video.load()");
-    consoleWrite("");
-</script>
+                testExpected("video.ended", true);
+                consoleWrite("");
+                timeupdateEventCount = 0;
+                endTest();
+            }
+        </script>
+    </head>
+    <body>
+        <video controls></video>
+        <p>Test that seeking paused video past its duration time sets currentTime to duration and leaves video paused.</p>
+    </body>
+</html>

Modified: trunk/LayoutTests/platform/chromium/test_expectations.txt (114004 => 114005)


--- trunk/LayoutTests/platform/chromium/test_expectations.txt	2012-04-12 18:11:28 UTC (rev 114004)
+++ trunk/LayoutTests/platform/chromium/test_expectations.txt	2012-04-12 18:24:52 UTC (rev 114005)
@@ -3778,8 +3778,6 @@
 BUGWK19688 SKIP : fast/images/exif-orientation.html = FAIL
 BUGWK19688 SKIP : fast/images/exif-orientation-css.html = FAIL
 
-BUGCR122448 : media/video-seek-past-end-paused.html = PASS TEXT
-
 BUGCR122462 WIN LINUX : http/tests/inspector/inspect-element.html = TEXT
 
 BUGWK83503 LINUX DEBUG : plugins/inner-html-display-none.html = CRASH
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to