Commit bff0b2dd authored by eric@webkit.org's avatar eric@webkit.org

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.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48539 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent e055ab35
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.
......
<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("");
......
<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");
......
......@@ -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>
......
<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");
......
<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>
......
<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>
......
<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()
}
......
......@@ -142,7 +142,7 @@ function videoPlayedMain()
{
findMediaElement();
video.src = 'content/test.mp4';
video.src = findMediaFile("video", "content/test");
waitForEvent("error");
waitForEvent("loadstart");
......
<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>
<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>
<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>
......@@ -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>
<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>
......@@ -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
......
<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>
<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>
<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>
......@@ -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')");
......
<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("");
}
......
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
......
<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("");
}
......
<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>
<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();
} );
......
<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>
<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;
......
<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);
......
<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 () {
......@@ -25,10 +28,10 @@
</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>
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