Commit c8bfe38b authored by philn@webkit.org's avatar philn@webkit.org

2011-03-15 Philippe Normand <pnormand@igalia.com>

        Reviewed by Eric Carlson.

        [GTK] media/audio-repaint.html times out again
        https://bugs.webkit.org/show_bug.cgi?id=56366

        Rewrote the test to avoid a timer and attempt the seek on media
        elements only after we are sure playback started to avoid an
        INVALID_STATE_ERR exception.

        * media/audio-repaint.html:

git-svn-id: svn://svn.chromium.org/blink/trunk@81231 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 9e5ab7cf
2011-03-15 Philippe Normand <pnormand@igalia.com>
Reviewed by Eric Carlson.
[GTK] media/audio-repaint.html times out again
https://bugs.webkit.org/show_bug.cgi?id=56366
Rewrote the test to avoid a timer and attempt the seek on media
elements only after we are sure playback started to avoid an
INVALID_STATE_ERR exception.
* media/audio-repaint.html:
2011-03-15 Philippe Normand <pnormand@igalia.com>
Reviewed by Eric Carlson.
<body onload="bodyLoaded()">
<body>
<p>
This tests that in a html document with inline audio content, the media element repaints correctly
while playing.
</p>
<audio controls autoplay src="content/silence.wav"></audio><br/>
<audio controls autoplay src="content/silence.wav" style="margin-bottom:25px; -webkit-box-reflect:below;"></audio><br/>
<audio controls autoplay src="content/silence.wav" style="margin:27px 0; -webkit-transform: rotate(15deg);"></audio><br>
<audio controls autoplay onplaying="playing(0)" src="content/silence.wav"></audio><br/>
<audio controls autoplay onplaying="playing(1)" src="content/silence.wav" style="margin-bottom:25px; -webkit-box-reflect:below;"></audio><br/>
<audio controls autoplay onplaying="playing(2)" src="content/silence.wav" style="margin:27px 0; -webkit-transform: rotate(15deg);"></audio><br>
<script>
if (window.layoutTestController)
layoutTestController.waitUntilDone();
......@@ -13,20 +13,17 @@
if (window.layoutTestController)
layoutTestController.display();
function bodyLoaded() {
setTimeout(function(){
var audioElements = document.getElementsByTagName('audio');
var count = audioElements.length;
for (i = 0; i < count; ++i) {
var audio = audioElements[i];
audio.pause();
audio.addEventListener("seeked", function() {
if (!--count && window.layoutTestController)
layoutTestController.notifyDone();
}, true);
audio.currentTime = audio.duration * 0.50;
}
}, 100);
var count = 3;
var audioElements = document.getElementsByTagName('audio');
function playing(i) {
var audio = audioElements[i];
audio.pause();
audio.addEventListener("seeked", function() {
if (!--count && window.layoutTestController)
layoutTestController.notifyDone();
}, true);
audio.currentTime = audio.duration * 0.50;
}
</script>
</body>
\ No newline at end of file
</body>
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