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: svn://svn.chromium.org/blink/trunk@83210 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent d6d93333
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> 2011-04-07 Sergey Glazunov <serg.glazunov@gmail.com>
Reviewed by Dimitri Glazkov. Reviewed by Dimitri Glazkov.
<video></video> <video></video>
<p>Test that removing a media element from the tree while loading does not crash.</p> <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 src=../../media-resources/video-test.js></script>
<script> <script>
waitForEvent('loadedmetadata', function () { waitForEvent('loadedmetadata', function () {
run("document.body.removeChild(video)"); run("document.body.removeChild(video)");
endTestLater(); 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> </script>
...@@ -6,9 +6,10 @@ use File::stat; ...@@ -6,9 +6,10 @@ use File::stat;
$query = new CGI; $query = new CGI;
$name = $query->param('name'); $name = $query->param('name');
$stallAt = $query->param('stallAt'); $stallAt = $query->param('stallAt');
$mimeType = $query->param('mimeType');
my $filesize = stat($name)->size; my $filesize = stat($name)->size;
print "Content-type: video/mp4\n"; print "Content-type: " . $mimeType . "\n";
print "Content-Length: " . $filesize . "\n\n"; print "Content-Length: " . $filesize . "\n\n";
open FILE, $name or die; open FILE, $name or die;
......
<video></video> <video></video>
<p>Test that stalling very early, while loading meta-data, stops delaying the load event.</p> <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 src=../../media-resources/video-test.js></script>
<script> <script>
...@@ -15,7 +16,11 @@ ...@@ -15,7 +16,11 @@
endTest(); 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. // 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> </script>
<video controls></video> <video controls></video>
<p>Test that playback can be resumed by seeking backwards after load stalls.</p> <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 src=../../media-resources/video-test.js></script>
<script> <script>
...@@ -26,6 +27,10 @@ ...@@ -26,6 +27,10 @@
run("video.currentTime = 0.1"); 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()"); run("video.play()");
</script> </script>
<video></video> <video></video>
<p>Test that stalled, timeupdate and waiting events are sent when media load stalls in the middle.</p> <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 src=../../media-resources/video-test.js></script>
<script> <script>
...@@ -30,6 +31,11 @@ ...@@ -30,6 +31,11 @@
waitForEventAndEnd('stalled'); 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()"); run("video.play()");
</script> </script>
<video></video> <video></video>
<p>Test seekable range when video load is incomplete.</p> <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 src=../../media-resources/video-test.js></script>
<script> <script>
waitForEvent('canplay', function () { waitForEvent('canplay', function () {
...@@ -10,6 +11,11 @@ waitForEvent('canplay', function () { ...@@ -10,6 +11,11 @@ waitForEvent('canplay', function () {
test("video.seekable.end(0) < video.duration - 1"); test("video.seekable.end(0) < video.duration - 1");
endTest(); 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(); video.load();
</script> </script>
...@@ -44,6 +44,14 @@ function mimeTypeForExtension(extension) { ...@@ -44,6 +44,14 @@ function mimeTypeForExtension(extension) {
return ""; return "";
} }
function mimeTypeForFile(filename) {
var lastPeriodIndex = filename.lastIndexOf(".");
if (lastPeriodIndex > 0)
return mimeTypeForExtension(filename.substring(lastPeriodIndex + 1));
return "";
}
function setSrcByTagName(tagName, src) { function setSrcByTagName(tagName, src) {
var elements = document.getElementsByTagName(tagName); var elements = document.getElementsByTagName(tagName);
if (elements) { if (elements) {
...@@ -64,6 +72,3 @@ function stripExtension(filename) { ...@@ -64,6 +72,3 @@ function stripExtension(filename) {
return filename.substring(0, lastPeriodIndex); return filename.substring(0, lastPeriodIndex);
return filename; return filename;
} }
...@@ -787,13 +787,15 @@ BUGCR20226 : fast/forms/input-selectedoption.html = FAIL ...@@ -787,13 +787,15 @@ BUGCR20226 : fast/forms/input-selectedoption.html = FAIL
// Needs to call Settings::setValidationMessageTimerMagnification(-1). // Needs to call Settings::setValidationMessageTimerMagnification(-1).
BUGWK57290 : fast/forms/validation-message-appearance.html = PASS FAIL BUGWK57290 : fast/forms/validation-message-appearance.html = PASS FAIL
// These tests need to be changed to be platform independent. // Timing out.
// These tests are skipped since they hang DRT and test_shell. BUGCR78376 SKIP : http/tests/media/video-play-stall-seek.html = TIMEOUT
// BUGCR62964 : we should either enable or delete these testsvi
BUGCR54465 BUGCR62964 SKIP : http/tests/media/remove-while-loading.html = TIMEOUT // video.seekable returning unexpected results.
BUGCR54465 BUGCR62964 SKIP : http/tests/media/video-play-stall-seek.html = TIMEOUT BUGCR78375 SKIP : http/tests/media/video-seekable-stall.html = TIMEOUT
BUGCR54465 BUGCR62964 SKIP : http/tests/media/video-play-stall.html = TIMEOUT
BUGCR54465 BUGCR62964 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. // 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 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