2009-04-24 Pierre d'Herbemont <pdherbemont@apple.com>

        Reviewed by Simon Fraser

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

        Fixed a race condition on the first 'played' attribute test start.

        Previously we were starting nearly right away to play, and probably
        before receiving the 'canplay' event. Now we ensure we'll wait for
        that 'canplay' event before attempting to play.

        * media/video-played-expected.txt: Updated
        * media/video-played.html:

git-svn-id: svn://svn.chromium.org/blink/trunk@42848 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent bbb0a673
2009-04-24 Pierre d'Herbemont <pdherbemont@apple.com>
Reviewed by Simon Fraser
https://bugs.webkit.org/show_bug.cgi?id=25380
Fixed a race condition on the first 'played' attribute test start.
Previously we were starting nearly right away to play, and probably
before receiving the 'canplay' event. Now we ensure we'll wait for
that 'canplay' event before attempting to play.
* media/video-played-expected.txt: Updated
* media/video-played.html:
2009-04-24 Geoffrey Garen <ggaren@apple.com> 2009-04-24 Geoffrey Garen <ggaren@apple.com>
Rubber stamped by Eric Seidel. Rubber stamped by Eric Seidel.
Test of the media element 'played' attribute Test of the media element 'played' attribute
Test playing when there are no ranges
EVENT(loadstart) EVENT(loadstart)
EVENT(loadedmetadata) EVENT(loadedmetadata)
EVENT(canplay) EVENT(canplay)
Test 1 OK Test 1 OK
Test playing when there are no ranges
RUN(video.play()) RUN(video.play())
RUN(video.pause()) RUN(video.pause())
EVENT(pause) EVENT(pause)
......
...@@ -225,8 +225,7 @@ ...@@ -225,8 +225,7 @@
function canplay(event) function canplay(event)
{ {
testRanges(); testRanges();
if (currentTest > 1) nextTest();
nextTest();
} }
function willCreateNewRange() function willCreateNewRange()
...@@ -257,12 +256,10 @@ ...@@ -257,12 +256,10 @@
waitForEvent("loadstart"); waitForEvent("loadstart");
waitForEvent("ratechange"); waitForEvent("ratechange");
waitForEvent("loadedmetadata"); waitForEvent("loadedmetadata");
waitForEvent("canplay", canplay); waitForEvent("canplay", canplay); // Will triggers nextTest() which launches the tests.
waitForEvent("pause", pause); waitForEvent("pause", pause);
video.load(); video.load();
nextTest();
} }
</script> </script>
</head> </head>
......
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