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> 2011-03-15 Philippe Normand <pnormand@igalia.com>
Reviewed by Eric Carlson. Reviewed by Eric Carlson.
<body onload="bodyLoaded()"> <body>
<p> <p>
This tests that in a html document with inline audio content, the media element repaints correctly This tests that in a html document with inline audio content, the media element repaints correctly
while playing. while playing.
</p> </p>
<audio controls autoplay src="content/silence.wav"></audio><br/> <audio controls autoplay onplaying="playing(0)" 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 onplaying="playing(1)" 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(2)" src="content/silence.wav" style="margin:27px 0; -webkit-transform: rotate(15deg);"></audio><br>
<script> <script>
if (window.layoutTestController) if (window.layoutTestController)
layoutTestController.waitUntilDone(); layoutTestController.waitUntilDone();
...@@ -13,20 +13,17 @@ ...@@ -13,20 +13,17 @@
if (window.layoutTestController) if (window.layoutTestController)
layoutTestController.display(); layoutTestController.display();
function bodyLoaded() { var count = 3;
setTimeout(function(){ var audioElements = document.getElementsByTagName('audio');
var audioElements = document.getElementsByTagName('audio');
var count = audioElements.length; function playing(i) {
for (i = 0; i < count; ++i) { var audio = audioElements[i];
var audio = audioElements[i]; audio.pause();
audio.pause(); audio.addEventListener("seeked", function() {
audio.addEventListener("seeked", function() { if (!--count && window.layoutTestController)
if (!--count && window.layoutTestController) layoutTestController.notifyDone();
layoutTestController.notifyDone(); }, true);
}, true); audio.currentTime = audio.duration * 0.50;
audio.currentTime = audio.duration * 0.50;
}
}, 100);
} }
</script> </script>
</body> </body>
\ No newline at end of file
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