[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric.carlson at apple.com eric.carlson at apple.com
Thu Apr 8 01:40:53 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit b0f70db3daeb145c1aafac0f6566947a4486dcc4
Author: eric.carlson at apple.com <eric.carlson at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Feb 6 00:49:11 2010 +0000

    2010-02-05  Eric Carlson  <eric.carlson at apple.com>
    
            Reviewed by Oliver Hunt.
    
            https://bugs.webkit.org/show_bug.cgi?id=33671
            [GTK] media/video-loop.html fails intermittently on Gtk 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@54454 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 8eaf7d2..c986566 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-02-05  Eric Carlson  <eric.carlson at apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=33671
+        [GTK] media/video-loop.html fails intermittently on Gtk Bots
+
+        Rewrite test to make it less timing dependent.
+
+        * media/video-loop-expected.txt:
+        * media/video-loop.html:
+
 2010-02-05  Csaba Osztrogonác  <ossy at webkit.org>
 
         Rubber-stamped by Kenneth Rohde Christiansen.
diff --git a/LayoutTests/media/video-loop-expected.txt b/LayoutTests/media/video-loop-expected.txt
index 3f496b9..acad99d 100644
--- a/LayoutTests/media/video-loop-expected.txt
+++ b/LayoutTests/media/video-loop-expected.txt
@@ -1,3 +1,6 @@
+Test looping.
+
+++ Test setting/removing the attribute
 EXPECTED (video.getAttribute('loop') == 'null') OK
 EXPECTED (video.loop == 'false') OK
 RUN(video.loop = true)
@@ -6,21 +9,31 @@ EXPECTED (video.getAttribute('loop') != 'null') OK
 RUN(video.removeAttribute('loop'))
 EXPECTED (video.loop == 'false') OK
 
+++ Set 'loop' to true and start 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.currentTime = video.duration - 0.4)
 
-EVENT(playing)
+EVENT(seeked)
+EVENT(seeked)
+
+++ video just looped, toggle 'loop' and seek to near end
+EXPECTED (video.paused == 'false') OK
 EXPECTED (video.ended == 'false') OK
-EXPECTED (mediaElement.currentTime > '0') OK
-EXPECTED (mediaElement.currentTime < '5.63') OK
+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(seeked)
+EVENT(ended)
 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..af1bc18 100644
--- a/LayoutTests/media/video-loop.html
+++ b/LayoutTests/media/video-loop.html
@@ -1,66 +1,80 @@
+<!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;
     
-        run("video.loop = true");
-        testExpected("video.loop", true);
-        testExpected("video.getAttribute('loop')", null, "!=");
-    
-        run("video.removeAttribute('loop')");
-        testExpected("video.loop", false);
+            function play()
+            {
+                consoleWrite("<br>++ seek to near the end, wait for 'seeked' event to announce loop");
+                testExpected("video.paused", false);
+                waitForEvent("seeked", seeked);
+                run("video.currentTime = video.duration - 0.4");
+                consoleWrite("");
+            }
     
-        var respondToTimeUpdate = false;
-        var firstTimeCheck = true;
-
-        waitForEvent('pause');
-        waitForEvent('playing');
+            function seeked()
+            {
+                ++seekCount;
+                if (seekCount == 2) {
+                    consoleWrite("<br>++ video just looped, toggle 'loop' and seek to near end");
+                    testExpected("video.paused", false);
+                    testExpected("video.ended", false);
+                    testExpected("mediaElement.currentTime", 0, '>=');
 
-        // 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);
-        } );
+                    // 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("");
+                }
+            }
     
-        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
+                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("++ Test setting/removing the attribute");
+                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>++ Set 'loop' to true and start playing");
+                var mediaFile = findMediaFile("video", "content/test");
+                run("video.loop = true");
+                video.src = mediaFile;
+                consoleWrite("");
+            }
+        </script>
+
+    </head>
+    <body>
+        <video controls autoplay ></video>
+        <p>Test looping.</p>
+        <script>start()</script>
+    </body>
 </html>

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list