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:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83210 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 147aa3d8
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.
<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>
......@@ -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;
......
<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>
......@@ -15,7 +16,11 @@
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>
<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>
......@@ -26,6 +27,10 @@
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>
<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>
......@@ -30,6 +31,11 @@
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>
<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>
......@@ -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;
}
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment