Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
2009-09-23 Andrew Scherkus <scherkus@chromium.org>
        Reviewed by Eric Carlson.

        Updating 17 media layout tests to provide different media files based on supported codecs.

        https://bugs.webkit.org/show_bug.cgi?id=29625

        * media/audio-constructor-autobuffer.html: Switched to findMediaFile().
        * media/audio-constructor-src.html: Ditto.
        * media/audio-constructor.html: Ditto.
        * media/audio-controls-rendering.html: Ditto.
        * media/audio-delete-while-slider-thumb-clicked.html: Ditto.
        * media/audio-delete-while-step-button-clicked.html: Ditto.
        * media/broken-video.html: Ditto.
        * media/controls-after-reload.html: Ditto, and also changed initial video to counting.mp4 since scaled-matrix.mov is QuickTime specific.
        * media/controls-right-click-on-timebar.html: Ditto.
        * media/event-attributes.html: Ditto.
        * media/media-load-event.html: Ditto.
        * media/media-startTime.html: Ditto.
        * media/progress-event-total-expected.txt: Added new total value.
        * media/progress-event-total.html: Switched to for loop and findMediaFile(), added new total value.
        * media/progress-event.html: Switched to findMediaFile().
        * media/remove-from-document-no-load.html: Ditto.
        * media/remove-from-document.html: Ditto.
        * media/unsupported-tracks.html: Ditto.

Canonical link: https://commits.webkit.org/40257@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@48694 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
eseidel committed Sep 24, 2009
1 parent fcea84d commit 12418ea
Show file tree
Hide file tree
Showing 19 changed files with 97 additions and 29 deletions.
27 changes: 27 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,30 @@
2009-09-23 Andrew Scherkus <scherkus@chromium.org>

Reviewed by Eric Carlson.

Updating 17 media layout tests to provide different media files based on supported codecs.

https://bugs.webkit.org/show_bug.cgi?id=29625

* media/audio-constructor-autobuffer.html: Switched to findMediaFile().
* media/audio-constructor-src.html: Ditto.
* media/audio-constructor.html: Ditto.
* media/audio-controls-rendering.html: Ditto.
* media/audio-delete-while-slider-thumb-clicked.html: Ditto.
* media/audio-delete-while-step-button-clicked.html: Ditto.
* media/broken-video.html: Ditto.
* media/controls-after-reload.html: Ditto, and also changed initial video to counting.mp4 since scaled-matrix.mov is QuickTime specific.
* media/controls-right-click-on-timebar.html: Ditto.
* media/event-attributes.html: Ditto.
* media/media-load-event.html: Ditto.
* media/media-startTime.html: Ditto.
* media/progress-event-total-expected.txt: Added new total value.
* media/progress-event-total.html: Switched to for loop and findMediaFile(), added new total value.
* media/progress-event.html: Switched to findMediaFile().
* media/remove-from-document-no-load.html: Ditto.
* media/remove-from-document.html: Ditto.
* media/unsupported-tracks.html: Ditto.

2009-09-23 Karen Grünberg <karen+webkit@chromium.org>

Reviewed by Dimitri Glazkov.
Expand Down
3 changes: 2 additions & 1 deletion LayoutTests/media/audio-constructor-autobuffer.html
@@ -1,5 +1,6 @@
<html>
<head>
<script src=media-file.js></script>
<script src=video-test.js></script>

<script>
Expand All @@ -23,7 +24,7 @@
consoleWrite("");

mediaElement.onload = loaded;
run("mediaElement.src = 'content/test.wav'");
run("mediaElement.src = '" + findMediaFile("audio", "content/test") + "'");
run("mediaElement.load()");

consoleWrite("");
Expand Down
3 changes: 2 additions & 1 deletion LayoutTests/media/audio-constructor-src.html
@@ -1,8 +1,9 @@
<body>
<p>Test that Audio("url") constructor loads the specified resource.</p>
<script src=media-file.js></script>
<script src=video-test.js></script>
<script>
var audio = new Audio("content/test.wav");
var audio = new Audio(findMediaFile("audio", "content/test"));
mediaElement = audio;

testExpected("audio instanceof HTMLAudioElement", true);
Expand Down
6 changes: 4 additions & 2 deletions LayoutTests/media/audio-constructor.html
@@ -1,6 +1,7 @@
<body>
<p>Test that Audio() object loads the resource after src attribute is set and load() is called.</p>

<script src=media-file.js></script>
<script src=video-test.js></script>

<script>
Expand All @@ -9,10 +10,11 @@

testExpected("audio instanceof HTMLAudioElement", true);

waitForEvent("loadstart", function () { testExpected("relativeURL(audio.currentSrc)", "content/test.wav"); });
var mediaFile = findMediaFile("audio", "content/test");
waitForEvent("loadstart", function () { testExpected("relativeURL(audio.currentSrc)", mediaFile); });

waitForEventAndEnd("load");

audio.src = "content/test.wav";
audio.src = mediaFile;
run("audio.load()");
</script>
9 changes: 6 additions & 3 deletions LayoutTests/media/audio-controls-rendering.html
Expand Up @@ -3,9 +3,12 @@
<style>
audio { background-color: blue; }
</style>
<script src=media-file.js></script>
<script>
function test()
{
setSrcByTagName("audio", findMediaFile("audio", "content/test"));

if (window.layoutTestController) {
layoutTestController.waitUntilDone();
setTimeout(function() {
Expand All @@ -27,8 +30,8 @@
</head>
<body onload="test()">
<p>Test controls placement. </p>
<audio controls src="content/test.wav"></audio><br><br>
<audio controls src="content/test.wav" style="width: 320px;"></audio><br><br>
<audio controls src="content/test.wav" style="position: absolute; width: 320px; height: 100px;"></audio><br>
<audio controls></audio><br><br>
<audio controls style="width: 320px;"></audio><br><br>
<audio controls style="position: absolute; width: 320px; height: 100px;"></audio><br>
</body>
</html>
10 changes: 8 additions & 2 deletions LayoutTests/media/audio-delete-while-slider-thumb-clicked.html
@@ -1,5 +1,6 @@
<html>
<head>
<script src=media-file.js></script>
<script>
if (window.layoutTestController) {
layoutTestController.dumpAsText();
Expand Down Expand Up @@ -67,14 +68,19 @@
setTimeout(deleteAudio, 10);
}

function start()
{
setSrcByTagName("audio", findMediaFile("audio", "content/test"));
}

</script>
</head>
<body >
<body onload="start()">
This tests that events don't continue to target a slider thumb if the media element is deleted while scrubbing.
<br>
<input type="button" id="button" value="Click Me!" onmouseup="log('button click!')">
<br>
<audio id="audio" ontimeupdate="log('timeupdate')" onload="drag()" controls src="content/test.wav"></audio><br><br>
<audio id="audio" ontimeupdate="log('timeupdate')" onload="drag()" controls></audio><br><br>
<div id="console"></div>
</body>
</html>
10 changes: 8 additions & 2 deletions LayoutTests/media/audio-delete-while-step-button-clicked.html
@@ -1,5 +1,6 @@
<html>
<head>
<script src=media-file.js></script>
<script>
if (window.layoutTestController) {
layoutTestController.dumpAsText();
Expand Down Expand Up @@ -67,14 +68,19 @@
setTimeout(deleteAudio, 10);
}

function start()
{
setSrcByTagName("audio", findMediaFile("audio", "content/test"));
}

</script>
</head>
<body >
<body onload="start()">
This tests that events don't continue to target a step button if the media element is deleted while mouse down on button.
<br>
<input type="button" id="button" value="Click Me!" onmouseup="log('button click!')">
<br>
<audio id="audio" ontimeupdate="log('timeupdate')" onload="step()" controls src="content/test.wav"></audio><br><br>
<audio id="audio" ontimeupdate="log('timeupdate')" onload="step()" controls></audio><br><br>
<div id="console"></div>
</body>
</html>
3 changes: 2 additions & 1 deletion LayoutTests/media/broken-video.html
@@ -1,9 +1,10 @@
<video controls></video>
<p>Test that QuickTime file with broken content generates an error.<p>
<script src=media-file.js></script>
<script src=video-test.js></script>

<script>
video.src = "content/garbage.mp4";
video.src = findMediaFile("video", "content/garbage");
waitForEvent("error", function () {
testExpected("video.error", "[object MediaError]");
endTest();
Expand Down
5 changes: 3 additions & 2 deletions LayoutTests/media/controls-after-reload.html
@@ -1,5 +1,6 @@
<html>
<head>
<script src=media-file.js></script>
<script>
var video;
var loadedCount = 0;
Expand All @@ -16,7 +17,7 @@
return;
}

video.src = "content/test.mp4";
video.src = findMediaFile("video", "content/test");
video.load();
}

Expand All @@ -25,7 +26,7 @@
video = document.getElementsByTagName('video')[0];
video.addEventListener("canplaythrough", canplaythrough);

video.src = "content/scaled-matrix.mov";
video.src = findMediaFile("video", "content/counting");
video.load();
}
</script>
Expand Down
3 changes: 2 additions & 1 deletion LayoutTests/media/controls-right-click-on-timebar.html
@@ -1,6 +1,7 @@
<html>
<head>
<title>right click on timebar test</title>
<script src=media-file.js></script>
<script src=video-test.js></script>
<script>
if (window.layoutTestController)
Expand Down Expand Up @@ -33,7 +34,7 @@
waitForEvent('playing', playing);
waitForEvent('seeked', seeked);
run("video.autoplay = true");
run("video.src = 'content/test.mp4'");
run("video.src = '" + findMediaFile("video", "content/test") + "'");
}
</script>
</head>
Expand Down
7 changes: 5 additions & 2 deletions LayoutTests/media/event-attributes.html
@@ -1,6 +1,7 @@
<html>
<head>

<script src=media-file.js></script>
<script src=video-test.js></script>
<script>
var ratechangeCount = 0;
Expand Down Expand Up @@ -44,8 +45,9 @@
run("video.play()");
break;
case "ended":
var mediaFile = findMediaFile("video", "content/garbage");
consoleWrite("<br>*** played to end, setting 'src' to an invalid movie");
run("video.src = 'content/garbage.mp4'");
run("video.src = '" + mediaFile + "'");
run("video.load()");
break;
case "progress":
Expand All @@ -62,6 +64,7 @@

function start()
{
setSrcByTagName("video", findMediaFile("video", "content/test"));
findMediaElement();
}

Expand All @@ -70,7 +73,7 @@

<body onload="start()">

<video controls src="content/test.mp4"
<video controls
onabort="eventHandler()"
oncanplay="eventHandler()"
oncanplaythrough="eventHandler()"
Expand Down
4 changes: 3 additions & 1 deletion LayoutTests/media/media-load-event.html
@@ -1,5 +1,6 @@
<html>
<head>
<script src=media-file.js></script>
<script src=video-test.js></script>

<script>
Expand Down Expand Up @@ -35,7 +36,8 @@
waitForEvent("play");
waitForEvent('loadeddata');

run("mediaElement.src = 'content/test.wav'");
var mediaFile = findMediaFile("audio", "content/test");
run("mediaElement.src = '" + mediaFile + "'");
run("mediaElement.load()");

consoleWrite("");
Expand Down
5 changes: 4 additions & 1 deletion LayoutTests/media/media-startTime.html
@@ -1,6 +1,7 @@
<html>
<head>
<title>startTime attribute test</title>
<script src=media-file.js></script>
<script src=video-test.js></script>

<script>
Expand All @@ -16,7 +17,9 @@
{
findMediaElement();
waitForEvent('loadeddata', loadeddata);
run("video.src = 'content/test.mp4'");

var mediaFile = findMediaFile("video", "content/test");
run("video.src = '" + mediaFile + "'");
}

</script>
Expand Down
2 changes: 1 addition & 1 deletion LayoutTests/media/progress-event-total-expected.txt
Expand Up @@ -5,6 +5,6 @@ EXPECTED (event.loaded == '0') OK
EVENT(load)
EXPECTED (event.lengthComputable == 'true') OK
EXPECTED (event.loaded > '0') OK
SUCCESS: event.total is 188483 or 192844 (Playback engine specific)
SUCCESS: event.total is 103746 or 188483 or 192844 (Playback engine specific)
END OF TEST

16 changes: 11 additions & 5 deletions LayoutTests/media/progress-event-total.html
@@ -1,6 +1,7 @@
<html>
<head>

<script src=media-file.js></script>
<script src=video-test.js></script>
<script>
function testOnLoadStart()
Expand All @@ -16,16 +17,21 @@
consoleWrite("EVENT(" + event.type + ")");
testExpected("event.lengthComputable", true);
testExpected("event.loaded", 0, '>');
var allowedTotalBytes = [188483, 192844];
if (event.total == allowedTotalBytes[0] || event.total == allowedTotalBytes[1])
consoleWrite("SUCCESS: event.total is " + allowedTotalBytes[0] + " or " + allowedTotalBytes[1] + " (Playback engine specific)");
var allowedTotalBytes = [103746, 188483, 192844];
for (var i = 0; i < allowedTotalBytes.length; ++i) {
if (event.total == allowedTotalBytes[i])
break;
}
if (i < allowedTotalBytes.length)
consoleWrite("SUCCESS: event.total is " + allowedTotalBytes.join(" or ") + " (Playback engine specific)");
else
consoleWrite("FAIL: event.total should not be " + event.total + " (should be " + allowedTotalBytes[0] + " or " + allowedTotalBytes[1] + ")");
consoleWrite("FAIL: event.total should not be " + event.total + " (should be " + allowedTotalBytes.join(" or ") + ")");
endTest();
}

function start()
{
setSrcByTagName("video", findMediaFile("video", "content/test"));
findMediaElement();
}

Expand All @@ -34,7 +40,7 @@

<body onload="start()">

<video controls src="content/test.mp4" onloadstart="testOnLoadStart()" onload="testOnLoad()">
<video controls onloadstart="testOnLoadStart()" onload="testOnLoad()">
</video>

</body>
Expand Down
4 changes: 3 additions & 1 deletion LayoutTests/media/progress-event.html
@@ -1,6 +1,7 @@
<html>
<head>

<script src=media-file.js></script>
<script src=video-test.js></script>
<script>
function testOnLoadStart()
Expand All @@ -22,14 +23,15 @@

function start()
{
setSrcByTagName("video", findMediaFile("video", "content/test"));
findMediaElement();
}
</script>
</head>

<body onload="start()">

<video src="content/test.mp4" controls onloadstart="testOnLoadStart()" onload="testOnLoad()">
<video controls onloadstart="testOnLoadStart()" onload="testOnLoad()">
</video>

</body>
Expand Down
3 changes: 2 additions & 1 deletion LayoutTests/media/remove-from-document-no-load.html
@@ -1,10 +1,11 @@
<video controls></video>
<p>Test that removing a media element from the tree when no media has been loaded does not generate a load event.</p>
<script src=media-file.js></script>
<script src=video-test.js></script>
<script>
didReceiveLoadStartEvent = false;
video.addEventListener('loadstart', function() { didReceiveLoadStartEvent = true; });
video.src = "content/test.mp4";
video.src = findMediaFile("video", "content/test");
testExpected("video.networkState", HTMLMediaElement.NETWORK_EMPTY);
run("document.body.removeChild(video)");
testExpected("didReceiveLoadStartEvent", false);
Expand Down
3 changes: 2 additions & 1 deletion LayoutTests/media/remove-from-document.html
@@ -1,5 +1,6 @@
<video controls autoplay></video>
<p>Test that removing a media element from the tree pauses playback but does not unload the media.</p>
<script src=media-file.js></script>
<script src=video-test.js></script>
<script>
waitForEvent('load', function () {
Expand All @@ -16,5 +17,5 @@
endTest();
} );

video.src = "content/test.mp4";
video.src = findMediaFile("video", "content/test");
</script>

0 comments on commit 12418ea

Please sign in to comment.