2009-09-18 Alpha Lam <hclam@chromium.org>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Sep 2009 22:20:01 +0000 (22:20 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Sep 2009 22:20:01 +0000 (22:20 +0000)
        Reviewed by Eric Carlson.

        Media layout tests should have a way to provide test files in different formats
        https://bugs.webkit.org/show_bug.cgi?id=28327

        Updating 25 media layout tests to use media files based on supported codecs.

        * media/progress-event-at-least-one.html: Use findMediaFile() to locate a supported media file.
        * media/video-pause-empty-events.html: ditto.
        * media/video-play-empty-events.html: ditto.
        * media/video-play-pause-events.html: ditto.
        * media/video-played-collapse.html: ditto.
        * media/video-played-ranges-1.html: ditto.
        * media/video-played-reset.html: ditto.
        * media/video-played.js: ditto.
        (videoPlayedMain):
        * media/video-seek-past-end-paused.html: ditto.
        * media/video-seek-past-end-playing.html: ditto.
        * media/video-seekable.html: ditto.
        * media/video-seeking.html: ditto.
        * media/video-size.html: ditto.
        * media/video-source-error.html: ditto.
        * media/video-source-type-params.html: ditto.
        * media/video-source-type.html: ditto.
        * media/video-source.html: ditto.
        * media/video-src-change.html: ditto.
        * media/video-src-invalid-remove.html: ditto.
        * media/video-src-remove.html: ditto. Use counting.mp4 instead of silence.mpg.
        * media/video-src-remove-expected.txt: Updated results.
        * media/video-src-set.html: ditto.
        * media/video-src-source.html: ditto.
        * media/video-src.html: ditto.
        * media/video-timeupdate-during-playback.html: ditto.
        * media/video-volume.html: ditto.
        * media/video-zoom.html: ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@48539 268f45cc-cd09-0410-ab3c-d52691b4dbfc

28 files changed:
LayoutTests/ChangeLog
LayoutTests/media/progress-event-at-least-one.html
LayoutTests/media/video-pause-empty-events.html
LayoutTests/media/video-play-empty-events.html
LayoutTests/media/video-play-pause-events.html
LayoutTests/media/video-played-collapse.html
LayoutTests/media/video-played-ranges-1.html
LayoutTests/media/video-played-reset.html
LayoutTests/media/video-played.js
LayoutTests/media/video-seek-past-end-paused.html
LayoutTests/media/video-seek-past-end-playing.html
LayoutTests/media/video-seekable.html
LayoutTests/media/video-seeking.html
LayoutTests/media/video-size.html
LayoutTests/media/video-source-error.html
LayoutTests/media/video-source-type-params.html
LayoutTests/media/video-source-type.html
LayoutTests/media/video-source.html
LayoutTests/media/video-src-change.html
LayoutTests/media/video-src-invalid-remove.html
LayoutTests/media/video-src-remove-expected.txt
LayoutTests/media/video-src-remove.html
LayoutTests/media/video-src-set.html
LayoutTests/media/video-src-source.html
LayoutTests/media/video-src.html
LayoutTests/media/video-timeupdate-during-playback.html
LayoutTests/media/video-volume.html
LayoutTests/media/video-zoom.html

index bb93964..61716ce 100644 (file)
@@ -1,3 +1,41 @@
+2009-09-18  Alpha Lam  <hclam@chromium.org>
+
+        Reviewed by Eric Carlson.
+
+        Media layout tests should have a way to provide test files in different formats
+        https://bugs.webkit.org/show_bug.cgi?id=28327
+
+        Updating 25 media layout tests to use media files based on supported codecs.
+
+        * media/progress-event-at-least-one.html: Use findMediaFile() to locate a supported media file.
+        * media/video-pause-empty-events.html: ditto.
+        * media/video-play-empty-events.html: ditto.
+        * media/video-play-pause-events.html: ditto.
+        * media/video-played-collapse.html: ditto.
+        * media/video-played-ranges-1.html: ditto.
+        * media/video-played-reset.html: ditto.
+        * media/video-played.js: ditto.
+        (videoPlayedMain):
+        * media/video-seek-past-end-paused.html: ditto.
+        * media/video-seek-past-end-playing.html: ditto.
+        * media/video-seekable.html: ditto.
+        * media/video-seeking.html: ditto.
+        * media/video-size.html: ditto.
+        * media/video-source-error.html: ditto.
+        * media/video-source-type-params.html: ditto.
+        * media/video-source-type.html: ditto.
+        * media/video-source.html: ditto.
+        * media/video-src-change.html: ditto.
+        * media/video-src-invalid-remove.html: ditto.
+        * media/video-src-remove.html: ditto. Use counting.mp4 instead of silence.mpg.
+        * media/video-src-remove-expected.txt: Updated results.
+        * media/video-src-set.html: ditto.
+        * media/video-src-source.html: ditto.
+        * media/video-src.html: ditto.
+        * media/video-timeupdate-during-playback.html: ditto.
+        * media/video-volume.html: ditto.
+        * media/video-zoom.html: ditto.
+
 2009-09-18  Anders Carlsson  <andersca@apple.com>
 
         Add failing tests to the skipped list.
index f76cd94..9f86816 100644 (file)
@@ -1,5 +1,6 @@
 <html>
     <head>
+        <script src=media-file.js></script>
         <script src=video-test.js></script>
 
         <script>
@@ -44,7 +45,8 @@
                 waitForEvent('loadedmetadata');
                 waitForEvent('loadeddata');
 
-                run("mediaElement.src = 'content/test.wav'");
+                var mediaFile = findMediaFile("audio", "content/test");
+                run("mediaElement.src = '" + mediaFile + "'");
                 run("mediaElement.load()");
 
                 consoleWrite("");
index 6573304..1513442 100644 (file)
@@ -1,8 +1,9 @@
 <video controls></video>
 <p>Test that pause() from EMPTY network state triggers load()</p>
+<script src=media-file.js></script>
 <script src=video-test.js></script>
 <script>
-    video.src = "content/test.mp4";
+    video.src = findMediaFile("video", "content/test");
     testExpected("video.networkState", HTMLMediaElement.NETWORK_EMPTY);
 
     waitForEvent("loadstart");
index 03b2a6f..dea1480 100644 (file)
@@ -3,6 +3,7 @@
 
     <video controls></video>
     <p>Test that play() from EMPTY network state triggers load() and async play event.</p>
+    <script src=media-file.js></script>
     <script src=video-test.js></script>
     <script>
         testExpected("video.networkState", HTMLMediaElement.NETWORK_EMPTY);
@@ -20,7 +21,7 @@
     
         waitForEvent('playing', function () { testExpected("video.paused", false); endTest(); } );
     
-        video.src = "content/test.mp4";
+        video.src = findMediaFile("video", "content/test");
         run("video.play()");
         consoleWrite("SCRIPT DONE");
     </script>
index cac9048..87ec781 100644 (file)
@@ -1,8 +1,9 @@
 <video controls></video>
 <p>Test that calling play() and pause() triggers async play, timeupdate and pause events.</p>
+<script src=media-file.js></script>
 <script src=video-test.js></script>
 <script>
-    video.src = "content/test.mp4";
+    video.src = findMediaFile("video", "content/test.mp4");
 
     waitForEvent("loadstart");
     waitForEvent("ratechange");
index 0cca40d..5e81fb4 100644 (file)
@@ -1,6 +1,7 @@
 <html>
     <head>
         <title>Test of 'played' attribute</title>
+        <script src=media-file.js></script>
         <script src=video-test.js></script>
         <script src=video-played.js></script>
         <script>
index 955ce6f..8013160 100644 (file)
@@ -1,6 +1,7 @@
 <html>
     <head>
         <title>Test of 'played' attribute</title>
+        <script src=media-file.js></script>
         <script src=video-test.js></script>
         <script src=video-played.js></script>
         <script>
index dcca1d6..3b21c3a 100644 (file)
@@ -1,6 +1,7 @@
 <html>
     <head>
         <title>Test of 'played' attribute</title>
+        <script src=media-file.js></script>
         <script src=video-test.js></script>
         <script src=video-played.js></script>
         <script>
@@ -40,7 +41,8 @@
                 willPauseInExistingRange = false;
                 willExtendAnExistingRange = false;
 
-                run("video.src = \"content/test.mp4\"");
+                var mediaFile = findMediaFile("video", "content/test");
+                run("video.src = \"" + mediaFile + "\"");
                 run("video.load()"); // Triggers canplay()
             }
 
index b6d6516..5774968 100644 (file)
@@ -142,7 +142,7 @@ function videoPlayedMain()
 {
     findMediaElement();
     
-    video.src = 'content/test.mp4';
+    video.src = findMediaFile("video", "content/test");
     
     waitForEvent("error");
     waitForEvent("loadstart");
index 5f13769..9855ce5 100644 (file)
@@ -1,6 +1,7 @@
 
 <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=media-file.js></script>
 <script src=video-test.js></script>
 <script>
 
@@ -35,7 +36,8 @@
         endTest();
     }
 
-    run("video.src = 'content/test.mp4'");
+    var mediaFile = findMediaFile("video", "content/test");
+    run("video.src = '" + mediaFile + "'");
     run("video.load()");
     consoleWrite("");
 </script>
index 4a3f9f2..2a8dd26 100644 (file)
@@ -1,5 +1,6 @@
 <video loop controls></video>
 <p>Test that seeking video with 'loop' past it's end rewinds to the beginning and continues playback.</p>
+<script src=media-file.js></script>
 <script src=video-test.js></script>
 <script>
 
@@ -29,6 +30,7 @@
         endTest();
     }
 
-    run("video.src = 'content/test.mp4'");
+    var mediaFile = findMediaFile("video", "content/test");
+    run("video.src = '" + mediaFile + "'");
     consoleWrite("");
 </script>
index c3fc8a0..2f6e339 100644 (file)
@@ -1,4 +1,5 @@
 <video controls></video>
+<script src=media-file.js></script>
 <script src=video-test.js></script>
 <script>
     testExpected("video.seekable.length", 0);
@@ -19,5 +20,5 @@
             endTest();
         }
     );
-    video.src = "content/test.mp4";
+    video.src = findMediaFile("video", "content/test");
 </script>
index 51bb80f..daba6bd 100644 (file)
@@ -3,6 +3,7 @@
  goes back to false when seeking completes, and that a 'seeked' event
  is fired for each seek
  </p>
+<script src=media-file.js></script>
 <script src=video-test.js></script>
 <script>
 
@@ -47,5 +48,5 @@
     waitForEvent('seeked', seeked );
     waitForEvent('load', loaded);
 
-    video.src = "content/test.mp4";
+    video.src = findMediaFile("video", "content/test");
 </script>
index 2f56208..ca219f9 100644 (file)
@@ -1,4 +1,5 @@
 <video controls></video>
+<script src=media-file.js></script>
 <script src=video-test.js></script>
 <script>
     testExpected("video.videoWidth", 0, "==");
@@ -10,5 +11,5 @@
         endTest();
     } );
 
-    video.src = "content/test.mp4";
+    video.src = findMediaFile("video", "content/test");
 </script>
index 2a996f9..47ad6d1 100644 (file)
@@ -2,6 +2,7 @@
     <head>
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
         <title>&lt;video&gt; and &lt;source&gt; error test</title>
+        <script src=media-file.js></script>
         <script src=video-test.js></script>
 
         <script>
@@ -11,7 +12,7 @@
             function loadeddata()
             {
                 consoleWrite("");
-                testExpected("relativeURL(video.currentSrc)", "content/test.mp4");
+                testExpected("relativeURL(video.currentSrc)", findMediaFile("video", "content/test"));
                 testExpected("video.error", null);
                 consoleWrite("");
                 endTest();
@@ -62,7 +63,8 @@
             <source id=unsupported-media-query src=content/test.mp4 media=print>
             <source id=missing-file src=content/error2.mpeg type=video/mpeg>
             <source id=format-error src="content/unsupported_track.mov">
-            <source id=supported-format src=content/test.mp4 type="video/mpeg; codecs=&quot;avc1.4D400C&quot;">
+            <source id=supported-format-mp4 src=content/test.mp4 type="video/mpeg; codecs=&quot;avc1.4D400C&quot;">
+            <source id=supported-format-ogv src=content/test.ogv type="video/ogg">
         </video>
         
         <p>1. Test that errors fired while evaluating/loading &lt;source&gt; elements are fired at the
index 824a89e..6b9a77a 100644 (file)
@@ -1,14 +1,16 @@
 <body>
+<script src=media-file.js></script>
 <script src=video-test.js></script>
 <video controls>
     <source src=content/bogus.mpeg type="video/blahblah">
     <source src=content/test.mp4 type="video/mpeg; codecs=&quot;avc1.4D400C&quot;">
+    <source src=content/test.ogv type="video/ogg; codecs=&quot;theora,vorbis&quot;">
     <source src=content/error2.mpeg type=video/mpeg>
 </video>
 <script>
     video = mediaElement = document.getElementsByTagName('video')[0];
     waitForEvent('loadstart', function () { 
-        testExpected("relativeURL(video.currentSrc)", "content/test.mp4");
+        testExpected("relativeURL(video.currentSrc)", findMediaFile("video", "content/test"));
         endTest();
     } );
 </script>
index 88b7fa8..2f0e2a5 100644 (file)
@@ -1,15 +1,17 @@
 <body>
+<script src=media-file.js></script>
 <script src=video-test.js></script>
 <video controls>
     <source src=content/error.mpeg type=video/blahblah>
     <source src=content/test.mp4 type=video/mpeg>
+    <source src=content/test.ogv type=video/ogg>
     <source src=content/error2.mpeg type=video/mpeg>
 </video>
 <script>
     video = mediaElement = document.getElementsByTagName('video')[0];
 
     waitForEvent("loadstart", function () {
-        testExpected("relativeURL(video.currentSrc) ", "content/test.mp4");
+        testExpected("relativeURL(video.currentSrc) ", findMediaFile("video", "content/test"));
         endTest();
     });
 </script>
index 96871de..9eae679 100644 (file)
@@ -1,13 +1,16 @@
 <body>
+<script src=media-file.js></script>
 <script src=video-test.js></script>
-<video controls>
-    <source src=content/test.mp4>
-</video>
-
+<div id=panel></div>
+<script>
+    var panel = document.getElementById("panel");
+    var mediaFile = findMediaFile("video", "content/test");
+    panel.innerHTML = "<video controls><source src='" + mediaFile + "'></video>";
+</script>
 <script>
     video = mediaElement = document.getElementsByTagName('video')[0];
     waitForEvent("loadstart", function () {
-        testExpected("relativeURL(video.currentSrc) ", "content/test.mp4");
+        testExpected("relativeURL(video.currentSrc) ", mediaFile);
         endTest();
     });
 </script>
index b0b801b..8a65838 100644 (file)
@@ -8,22 +8,24 @@
     2. Test that changing src attribute triggers load after a load fails.<br>
     3. Test that changing src does not trigger load once a file is loaded.
     </p
+    <script src=media-file.js></script>
     <script src=video-test.js></script>
     <script>
-    
+        var mediaFile = findMediaFile("video", "content/test");
+
         function errorEvent()
         {
             testExpected("relativeURL(video.currentSrc)", "bogus");
             testExpected("video.networkState", HTMLMediaElement.NETWORK_NO_SOURCE);
             testExpected("video.error.code", MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED);
             consoleWrite("");
-            run("video.setAttribute('src', 'content/test.mp4')");
+            run("video.setAttribute('src', '" + mediaFile + "')");
             consoleWrite("");
         }
     
         function loadedmetadata()
         {
-            testExpected("relativeURL(video.currentSrc)", "content/test.mp4");
+            testExpected("relativeURL(video.currentSrc)", mediaFile);
             testExpected("isNaN(video.duration)", false);
             consoleWrite("");
             run("video.setAttribute('src', 'content/silence.mpg')");
index 1d2308a..d03acdd 100644 (file)
@@ -1,10 +1,14 @@
 <html>
 <body>
+    <script src=media-file.js></script>
     <script src=video-test.js></script>
 
-    <video src=bogus.mov controls>
-        <source src=content/test.mp4>
-    </video>
+    <div id=panel></div>
+    <script>
+        var panel = document.getElementById("panel");
+        var mediaFile = findMediaFile("video", "content/test");
+        panel.innerHTML = "<video src=bogus.mov controls><source src=" + mediaFile + "></video>";
+    </script>
 
     <p>Test that removing invalid 'src' attribute triggers load of &lt;source&gt; elements</p>
 
@@ -19,7 +23,7 @@
             if (loadCount == 1)
                 testExpected("relativeURL(video.currentSrc)", "bogus.mov");
             else if (loadCount == 2)
-                testExpected("relativeURL(video.currentSrc)", "content/test.mp4");
+                testExpected("relativeURL(video.currentSrc)", mediaFile);
             else
                 failTest("'loadCount' fired " + loadCount + "times" );
             consoleWrite("");
@@ -27,7 +31,7 @@
 
         function loadedmetadata()
         {
-            testExpected("relativeURL(video.currentSrc)", "content/test.mp4");
+            testExpected("relativeURL(video.currentSrc)", mediaFile);
             testExpected("isNaN(video.duration)", false);
             consoleWrite("");
         }
index 865c5ef..08ed4e1 100644 (file)
@@ -1,11 +1,11 @@
 
 EVENT(loadedmetadata)
-EXPECTED (relativeURL(video.currentSrc) == 'content/silence.mpg') OK
+EXPECTED (relativeURL(video.currentSrc) == 'content/test.mp4') OK
 EXPECTED (isNaN(video.duration) == 'false') OK
 
 RUN(video.removeAttribute('src'))
 
-EXPECTED (relativeURL(video.currentSrc) == 'content/silence.mpg') OK
+EXPECTED (relativeURL(video.currentSrc) == 'content/test.mp4') OK
 EXPECTED (isNaN(video.duration) == 'false') OK
 
 END OF TEST
index 23ff18f..341020d 100644 (file)
@@ -1,10 +1,13 @@
 <html>
 <body>
+    <script src=media-file.js></script>
     <script src=video-test.js></script>
-
-    <video src=content/silence.mpg controls onloadedmetadata="loadedmetadata()" >
-        <source src=content/test.mp4>
-    </video>
+    <div id=panel></div>
+    <script>
+        var panel = document.getElementById("panel");
+        var mediaFile = findMediaFile("video", "content/test");
+        panel.innerHTML = "<video src=" + mediaFile + " controls onloadedmetadata='loadedmetadata()'><source src=content/counting.mp4></video>";
+    </script>
 
     <p>Test that removing valid 'src' attribute DOES NOT trigger load of &lt;source&gt; elements</p>
 
@@ -15,7 +18,7 @@
         
         function testSrc()
         {
-            testExpected("relativeURL(video.currentSrc)", "content/silence.mpg");
+            testExpected("relativeURL(video.currentSrc)", mediaFile);
             testExpected("isNaN(video.duration)", false);
             consoleWrite("");
         }
index 75e7665..8d0ce83 100644 (file)
@@ -1,13 +1,15 @@
 <video controls></video>
 <div>Test that setting src attribute triggers load</div>
+<script src=media-file.js></script>
 <script src=video-test.js></script>
 <script>
-    video.setAttribute('src', 'content/test.mp4')
+    var mediaFile = findMediaFile("video", "content/test");
+    video.setAttribute('src', mediaFile);
 
     waitForEvent('loadstart', function () {
-        testExpected("relativeURL(video.currentSrc)", "content/test.mp4");
+        testExpected("relativeURL(video.currentSrc)", mediaFile);
         endTest();
     } );
 
-    video.setAttribute('src', 'content/test.mp4')
+    video.setAttribute('src', mediaFile);
 </script>
index 7bc20d6..e42adfc 100644 (file)
@@ -1,14 +1,18 @@
 <body>
+<script src=media-file.js></script>
 <script src=video-test.js></script>
-<video src=content/test.mp4 controls>
-    <source src=content/error.mpeg>
-</video>
+<div id=panel></div>
+<script>
+    var panel = document.getElementById("panel");
+    var mediaFile = findMediaFile("video", "content/test");
+    panel.innerHTML = "<video src=" + mediaFile + " controls><source src=content/error.mpeg></video>";
+</script>
 <script>
 
     video = mediaElement = document.getElementsByTagName('video')[0];
 
     waitForEvent('loadstart', function () { 
-        testExpected("relativeURL(video.currentSrc)", "content/test.mp4");
+        testExpected("relativeURL(video.currentSrc)", mediaFile);
         endTest();
     } );
 
index 88faff2..7f95b67 100644 (file)
@@ -1,14 +1,16 @@
 <body>
+<script src=media-file.js></script>
 <script src=video-test.js></script>
 <video controls></video>
 
 <script>
     video = mediaElement = document.getElementsByTagName('video')[0];
+    var mediaFile = findMediaFile("video", "content/test");
 
     waitForEvent("loadstart", function () {
-        testExpected("relativeURL(video.currentSrc) ", "content/test.mp4");
+        testExpected("relativeURL(video.currentSrc) ", mediaFile);
         endTest();
     });
 
-    video.src = "content/test.mp4";
+    video.src = mediaFile;
 </script>
index efd77e7..dd11a5c 100644 (file)
@@ -1,13 +1,15 @@
 <html>
 <body>
     
-    <video src=content/test.mp4 controls></video>
+    <video controls></video>
 
     <p>
     Test 'timeupdate' events are posted while playing but not while paused.
     </p
+    <script src=media-file.js></script>
     <script src=video-test.js></script>
     <script>
+        setSrcByTagName("video", findMediaFile("video", "content/test"));
     
         var timeupdateEventCount = 0;
         var countWhilePlaying = 0;
index 0ee20bd..493540c 100644 (file)
@@ -1,5 +1,6 @@
 <video controls></video>
 <p>Test 'volume' attribute<p>
+<script src=media-file.js></script>
 <script src=video-test.js></script>
 <script>
     testExpected("video.volume", 1.0);
@@ -9,7 +10,7 @@
     testExpected("video.volume", 0);
     testException("video.volume = 1.5", "DOMException.INDEX_SIZE_ERR");
     testException("video.volume = -0.5", "DOMException.INDEX_SIZE_ERR");
-    video.src = "content/test.mp4";
+    video.src = findMediaFile("video", "content/test");
     run("video.load()");
     waitForEvent("load", function () {
         testExpected("video.volume", 0);
index f19347d..8dc86a3 100644 (file)
@@ -1,9 +1,12 @@
 <html>
 <head>
     <style> video { zoom: 150%; border: 3px solid red; } </style>
+    <script src=media-file.js></script>
     <script>
         function init()
         {
+            setSrcByTagName("video", findMediaFile("video", "content/test"));
+
             var totalCount = document.getElementsByTagName('video').length;
             var count = totalCount;
             document.addEventListener("canplaythrough", function () {
     </script>
 
 </head>
-<body onload="init()">
+<body onload="init();">
     <p>150% zoom, with width and height attributes </p>
-    &nbsp;<video src="content/test.mp4" width=320 height=240></video><br>
+    &nbsp;<video width=320 height=240></video><br>
     <p>150% zoom, without width and height attributes </p>
-    &nbsp;<video src="content/test.mp4" ></video><br>
+    &nbsp;<video></video><br>
 </body>
 </html>