2011-04-07 Steve Lacey <sjl@chromium.org>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Apr 2011 21:19:19 +0000 (21:19 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Apr 2011 21:19:19 +0000 (21:19 +0000)
        Reviewed by Eric Carlson.

        Make various video layout tests platform independent by selecting an appropriate media file.

        Various layout tests depend on mp4 files.
        https://bugs.webkit.org/show_bug.cgi?id=57804

        * http/tests/media/remove-while-loading.html:
        * http/tests/media/video-load-and-stall.cgi:
        * http/tests/media/video-play-stall-before-meta-data.html:
        * http/tests/media/video-play-stall-seek.html:
        * http/tests/media/video-play-stall.html:
        * http/tests/media/video-seekable-stall.html:
        * media/media-file.js:
        (mimeTypeForFile):
        (stripExtension):
        * platform/chromium/test_expectations.txt:

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

LayoutTests/ChangeLog
LayoutTests/http/tests/media/remove-while-loading.html
LayoutTests/http/tests/media/video-load-and-stall.cgi
LayoutTests/http/tests/media/video-play-stall-before-meta-data.html
LayoutTests/http/tests/media/video-play-stall-seek.html
LayoutTests/http/tests/media/video-play-stall.html
LayoutTests/http/tests/media/video-seekable-stall.html
LayoutTests/media/media-file.js
LayoutTests/platform/chromium/test_expectations.txt

index fe792f9..0ff2e47 100644 (file)
@@ -1,3 +1,23 @@
+2011-04-07  Steve Lacey  <sjl@chromium.org>
+
+        Reviewed by Eric Carlson.
+
+        Make various video layout tests platform independent by selecting an appropriate media file.
+
+        Various layout tests depend on mp4 files.
+        https://bugs.webkit.org/show_bug.cgi?id=57804
+
+        * http/tests/media/remove-while-loading.html:
+        * http/tests/media/video-load-and-stall.cgi:
+        * http/tests/media/video-play-stall-before-meta-data.html:
+        * http/tests/media/video-play-stall-seek.html:
+        * http/tests/media/video-play-stall.html:
+        * http/tests/media/video-seekable-stall.html:
+        * media/media-file.js:
+        (mimeTypeForFile):
+        (stripExtension):
+        * platform/chromium/test_expectations.txt:
+
 2011-04-07  Sergey Glazunov  <serg.glazunov@gmail.com>
 
         Reviewed by Dimitri Glazkov.
index 5015b38..9d5887a 100644 (file)
@@ -1,10 +1,16 @@
 <video></video>
 <p>Test that removing a media element from the tree while loading does not crash.</p>
+<script src=../../media-resources/media-file.js></script>
 <script src=../../media-resources/video-test.js></script>
 <script>
 waitForEvent('loadedmetadata', function () {
     run("document.body.removeChild(video)");
     endTestLater();
 } );
-video.src = "http://127.0.0.1:8000/media/video-load-and-stall.cgi?name=../../../media/content/test.mp4&stallAt=100000";
+
+// Find a supported media file.
+var mediaFile = findMediaFile("video", "content/test");
+var mimeType = mimeTypeForFile(mediaFile);
+
+video.src = "http://127.0.0.1:8000/media/video-load-and-stall.cgi?name=../../../media/" + mediaFile + "&mimeType=" + mimeType + "&stallAt=100000";
 </script>
index 5bbc4a8..7fa1b91 100755 (executable)
@@ -6,9 +6,10 @@ use File::stat;
 $query = new CGI;
 $name = $query->param('name');
 $stallAt = $query->param('stallAt');
+$mimeType = $query->param('mimeType');
 
 my $filesize = stat($name)->size;
-print "Content-type: video/mp4\n"; 
+print "Content-type: " . $mimeType . "\n"; 
 print "Content-Length: " . $filesize . "\n\n";
 
 open FILE, $name or die;
index 6d63835..820f529 100644 (file)
@@ -1,5 +1,6 @@
 <video></video>
 <p>Test that stalling very early, while loading meta-data, stops delaying the load event.</p>
+<script src=../../media-resources/media-file.js></script>
 <script src=../../media-resources/video-test.js></script>
 <script>
 
        endTest();
     };
 
+    // Find a supported media file.
+    var mediaFile = findMediaFile("video", "content/test");
+    var mimeType = mimeTypeForFile(mediaFile);
+
     // Load should stall very early in the loading process.
-    video.src = "http://127.0.0.1:8000/media/video-load-and-stall.cgi?name=../../../media/content/test.mp4&stallAt=1";
+    video.src = "http://127.0.0.1:8000/media/video-load-and-stall.cgi?name=../../../media/" + mediaFile + "&mimeType=" + mimeType + "&stallAt=1";
 
 </script>
index 82acd62..77dbd7e 100644 (file)
@@ -1,5 +1,6 @@
 <video controls></video>
 <p>Test that playback can be resumed by seeking backwards after load stalls.</p>
+<script src=../../media-resources/media-file.js></script>
 <script src=../../media-resources/video-test.js></script>
 <script>
 
         run("video.currentTime = 0.1");
     } );
 
-    video.src = "http://127.0.0.1:8000/media/video-load-and-stall.cgi?name=../../../media/content/test.mp4&stallAt=100000";
+    // Find a supported media file.
+    var mediaFile = findMediaFile("video", "content/test");
+    var mimeType = mimeTypeForFile(mediaFile);
+
+    video.src = "http://127.0.0.1:8000/media/video-load-and-stall.cgi?name=../../../media/" + mediaFile + "&mimeType=" + mimeType + "&stallAt=100000";
     run("video.play()");
 </script>
index af54811..fb1edf9 100644 (file)
@@ -1,5 +1,6 @@
 <video></video>
 <p>Test that stalled, timeupdate and waiting events are sent when media load stalls in the middle.</p>
+<script src=../../media-resources/media-file.js></script>
 <script src=../../media-resources/video-test.js></script>
 <script>
 
 
         waitForEventAndEnd('stalled');
     } );
-    video.src = "http://127.0.0.1:8000/media/video-load-and-stall.cgi?name=../../../media/content/test.mp4&stallAt=100000";
+
+    // Find a supported media file.
+    var mediaFile = findMediaFile("video", "content/test");
+    var mimeType = mimeTypeForFile(mediaFile);
+
+    video.src = "http://127.0.0.1:8000/media/video-load-and-stall.cgi?name=../../../media/" + mediaFile + "&mimeType=" + mimeType + "&stallAt=100000";
     run("video.play()");
 </script>
index ad47d05..f6795a0 100644 (file)
@@ -1,5 +1,6 @@
 <video></video>
 <p>Test seekable range when video load is incomplete.</p>
+<script src=../../media-resources/media-file.js></script>
 <script src=../../media-resources/video-test.js></script>
 <script>
 waitForEvent('canplay', function () {
@@ -10,6 +11,11 @@ waitForEvent('canplay', function () {
     test("video.seekable.end(0) < video.duration - 1");
     endTest();
 } );
-video.src = "http://127.0.0.1:8000/media/video-load-and-stall.cgi?name=../../../media/content/test.mp4&stallAt=100000";
+
+// Find a supported media file.
+var mediaFile = findMediaFile("video", "content/test");
+var mimeType = mimeTypeForFile(mediaFile);
+
+video.src = "http://127.0.0.1:8000/media/video-load-and-stall.cgi?name=../../../media/" + mediaFile + "&mimeType=" + mimeType + "&stallAt=100000";
 video.load();
 </script>
index 7d1d246..5928cdf 100644 (file)
@@ -44,6 +44,14 @@ function mimeTypeForExtension(extension) {
     return "";
 }
 
+function mimeTypeForFile(filename) {
+ var lastPeriodIndex = filename.lastIndexOf(".");
+  if (lastPeriodIndex > 0)
+    return mimeTypeForExtension(filename.substring(lastPeriodIndex + 1));
+
+  return "";
+}
+
 function setSrcByTagName(tagName, src) {
     var elements = document.getElementsByTagName(tagName);
     if (elements) {
@@ -64,6 +72,3 @@ function stripExtension(filename) {
     return filename.substring(0, lastPeriodIndex);
   return filename;
 }
-
-
-
index 6615db6..426f203 100644 (file)
@@ -787,13 +787,15 @@ BUGCR20226 : fast/forms/input-selectedoption.html = FAIL
 // Needs to call Settings::setValidationMessageTimerMagnification(-1).
 BUGWK57290 : fast/forms/validation-message-appearance.html = PASS FAIL
 
-// These tests need to be changed to be platform independent.
-// These tests are skipped since they hang DRT and test_shell.
-// BUGCR62964 : we should either enable or delete these testsvi
-BUGCR54465 BUGCR62964 SKIP : http/tests/media/remove-while-loading.html = TIMEOUT
-BUGCR54465 BUGCR62964 SKIP : http/tests/media/video-play-stall-seek.html = TIMEOUT
-BUGCR54465 BUGCR62964 SKIP : http/tests/media/video-play-stall.html = TIMEOUT
-BUGCR54465 BUGCR62964 SKIP : http/tests/media/video-seekable-stall.html = TIMEOUT
+// Timing out.
+BUGCR78376 SKIP : http/tests/media/video-play-stall-seek.html = TIMEOUT
+
+// video.seekable returning unexpected results.
+BUGCR78375 SKIP : http/tests/media/video-seekable-stall.html = TIMEOUT
+
+// canplaythrough event is sent too early.
+BUGCR73609 SKIP : http/tests/media/video-play-stall.html = TEXT
+
 // UNIMPLEMENTED : * we don't have test-par-16-9.ogv generated in WebKit * we don't handle aspect ratio correctly.
 BUGCR59635 SKIP : media/video-display-aspect-ratio.html = PASS FAIL TIMEOUT