[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

eric.carlson at apple.com eric.carlson at apple.com
Wed Dec 22 12:20:34 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 9886627dd29b619880cb77a048fee96921d93ce0
Author: eric.carlson at apple.com <eric.carlson at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Aug 19 18:13:53 2010 +0000

    2010-08-19  Eric Carlson  <eric.carlson at apple.com>
    
            Reviewed by Simon Fraser.
    
            https://bugs.webkit.org/show_bug.cgi?id=33671
            media/video-loop.html fails intermittently on GTK and Chromium bots
    
            Rewrite test to make it less timing dependent.
    
            * media/video-loop-expected.txt:
            * media/video-loop.html:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65684 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 6cca050..9ed69e7 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-08-19  Eric Carlson  <eric.carlson at apple.com>
+
+        Reviewed by Simon Fraser.
+
+        https://bugs.webkit.org/show_bug.cgi?id=33671
+        media/video-loop.html fails intermittently on GTK and Chromium bots
+
+        Rewrite test to make it less timing dependent.
+
+        * media/video-loop-expected.txt:
+        * media/video-loop.html:
+
 2010-08-19  John Gregg  <johnnyg at google.com>
 
         Unreviewed; test expectations.
diff --git a/LayoutTests/media/video-loop-expected.txt b/LayoutTests/media/video-loop-expected.txt
index 3f496b9..e091d0a 100644
--- a/LayoutTests/media/video-loop-expected.txt
+++ b/LayoutTests/media/video-loop-expected.txt
@@ -1,3 +1,10 @@
+Test looping by:
+
+Play to end with 'loop' set to true.
+When 'seeked' event fires, verify that time has jumped back and movie is playing.
+Set 'loop' to false and play again.
+Verify that 'ended' event fires.
+++ Test setting/removing the attribute.
 EXPECTED (video.getAttribute('loop') == 'null') OK
 EXPECTED (video.loop == 'false') OK
 RUN(video.loop = true)
@@ -6,21 +13,50 @@ EXPECTED (video.getAttribute('loop') != 'null') OK
 RUN(video.removeAttribute('loop'))
 EXPECTED (video.loop == 'false') OK
 
+++ Set 'loop' to true and begin playing.
 RUN(video.loop = true)
-RUN(video.src = 'content/test.mp4')
 
 EVENT(play)
+
+++ seek to near the end, wait for 'seeked' event to announce loop.
 EXPECTED (video.paused == 'false') OK
+RUN(video.pause())
 RUN(video.currentTime = video.duration - 0.4)
 
-EVENT(playing)
+EVENT(pause)
+EVENT(seeked)
+
+++ first seek completed, beginning playback.
+EXPECTED (video.paused == 'true') OK
+EXPECTED (video.ended == 'false') OK
+RUN(video.play())
+
+EVENT(play)
+EVENT(seeked)
+
+++ second seek completed because video looped, toggle 'loop' and seek to near end again.
+EXPECTED (video.paused == 'false') OK
 EXPECTED (video.ended == 'false') OK
-EXPECTED (mediaElement.currentTime > '0') OK
-EXPECTED (mediaElement.currentTime < '5.63') OK
+RUN(video.pause())
+EXPECTED (mediaElement.currentTime >= '0') OK
+EXPECTED (mediaElement.currentTime < 'mediaElement.duration') OK
 RUN(video.loop = false)
-RUN(video.currentTime = video.duration - 0.3)
+RUN(video.currentTime = video.duration - 0.4)
+
+EVENT(pause)
+EVENT(seeked)
+
+++ third seek completed, beginning playback for the last time.
+EXPECTED (video.paused == 'true') OK
+EXPECTED (video.ended == 'false') OK
+RUN(video.play())
 
+EVENT(play)
+EVENT(ended)
+
+++ played to end and stopped.
 EXPECTED (video.ended == 'true') OK
 EXPECTED (mediaElement.currentTime == 'mediaElement.duration') OK
+
 END OF TEST
 
diff --git a/LayoutTests/media/video-loop.html b/LayoutTests/media/video-loop.html
index c728aa1..f37cd68 100644
--- a/LayoutTests/media/video-loop.html
+++ b/LayoutTests/media/video-loop.html
@@ -1,66 +1,117 @@
+<!DOCTYPE html>
 <html>
-
-    <video controls autoplay ></video>
-
-    <script src=media-file.js></script>
-    <script src=video-test.js></script>
-
-    <script>
+    <head>
+        <script src=media-file.js></script>
+        <script src=video-test.js></script>
     
-        testExpected("video.getAttribute('loop')", null);
-        testExpected("video.loop", false);
+        <script>
+            var seekCount = 0;
+            var playCount = 0;
     
-        run("video.loop = true");
-        testExpected("video.loop", true);
-        testExpected("video.getAttribute('loop')", null, "!=");
-    
-        run("video.removeAttribute('loop')");
-        testExpected("video.loop", false);
-    
-        var respondToTimeUpdate = false;
-        var firstTimeCheck = true;
+            function play()
+            {
+                if (++playCount > 1)
+                    return;
 
-        waitForEvent('pause');
-        waitForEvent('playing');
+                consoleWrite("<br><em>++ seek to near the end, wait for 'seeked' event to announce loop.</em>");
+                testExpected("video.paused", false);
+                
+                // Pause playback so the movie can't possibly loop before the seeked event fires
+                run("video.pause()");
+                waitForEvent("seeked", seeked);
+                run("video.currentTime = video.duration - 0.4");
+                consoleWrite("");
+            }
+    
+            function seeked()
+            {
+                switch (++seekCount)
+                {
+                    case 1:
+                        consoleWrite("<br><em>++ first seek completed, beginning playback.</em>");
+                        testExpected("video.paused", true);
+                        testExpected("video.ended", false);
+                        run("video.play()");
+                        consoleWrite("");
+                        break;
+                    case 2:
+                        consoleWrite("<br><em>++ second seek completed because video looped, toggle 'loop' and seek to near end again.</em>");
+                        testExpected("video.paused", false);
+                        testExpected("video.ended", false);
+                        run("video.pause()");
 
-        // make sure we are playing, seek to near the end so the test doesn't take too long
-        waitForEvent('play', function () { 
-            testExpected("video.paused", false);
-            run("video.currentTime = video.duration - 0.4");
-            
-            consoleWrite("");
-            setTimeout(timeCheck, 800);
-        } );
+                        testExpected("mediaElement.currentTime", 0, '>=');
+    
+                        // don't use "testExpected()" so we won't log the actual duration as the floating point result may differ with different engines
+                        reportExpected(mediaElement.currentTime < mediaElement.duration, "mediaElement.currentTime", "<", "mediaElement.duration", mediaElement.currentTime);
+                        run("video.loop = false");
+                        run("video.currentTime = video.duration - 0.4");
+                        consoleWrite("");
+                        break;
+                    case 3:
+                        consoleWrite("<br><em>++ third seek completed, beginning playback for the last time.</em>");
+                        testExpected("video.paused", true);
+                        testExpected("video.ended", false);
+                        run("video.play()");
+                        consoleWrite("");
+                        break;
+                    default:
+                        failTest("Video should have only seeked three times.");
+                        break;
+                        
+                }
+            }
     
-        function timeCheck() { 
-            testExpected("video.ended", !firstTimeCheck);
-            if (!firstTimeCheck)
+            function ended() 
             {
-                // 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
+                consoleWrite("<br><em>++ played to end and stopped.</em>");
+                testExpected("video.ended", true);
+
+                // don't use "testExpected()" so we won't log the actual duration as the floating point result may differ with different engines
                 reportExpected(mediaElement.currentTime == mediaElement.duration, "mediaElement.currentTime", "==", "mediaElement.duration", mediaElement.currentTime);
+
+                consoleWrite("");
                 endTest();
-                return;
             }
     
-            testExpected("mediaElement.currentTime", 0, '>');
-            testExpected("mediaElement.currentTime", (video.duration - 0.4).toFixed(2), '<');
-            run("video.loop = false");
-            run("video.currentTime = video.duration - 0.3");
-            respondToTimeUpdate = true;
-            firstTimeCheck = false;
-    
-            consoleWrite("");
-            setTimeout(timeCheck, 800);
-        }
-    
-        consoleWrite("");
-        run("video.loop = true");
-        var mediaFile = findMediaFile("video", "content/test");
-        run("video.src = '" + mediaFile + "'");
-        consoleWrite("");
-    </script>
+            function start()
+            {
+                findMediaElement();
 
-    </head>
+                consoleWrite("<em>++ Test setting/removing the attribute.</em>");
+                testExpected("video.getAttribute('loop')", null);
+                testExpected("video.loop", false);
+            
+                run("video.loop = true");
+                testExpected("video.loop", true);
+                testExpected("video.getAttribute('loop')", null, "!=");
+            
+                run("video.removeAttribute('loop')");
+                testExpected("video.loop", false);
+            
+                waitForEvent('pause');
+                waitForEvent('play', play);
+                waitForEvent("ended", ended);
 
+                consoleWrite("<br><em>++ Set 'loop' to true and begin playing.</em>");
+                var mediaFile = findMediaFile("video", "content/test");
+                run("video.loop = true");
+                video.src = mediaFile;
+                consoleWrite("");
+            }
+        </script>
+
+    </head>
+    <body>
+        <video controls autoplay ></video>
+        <p><b>Test looping by:</b>
+        <ol>
+            <li>Play to end with 'loop' set to true.</li>
+            <li>When 'seeked' event fires, verify that time has jumped back and movie is playing.</li>
+            <li>Set 'loop' to false and play again.</li>
+            <li>Verify that 'ended' event fires.</li>
+        </ol>
+        </p>
+        <script>start()</script>
+    </body>
 </html>

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list