Bug 25380 - LayoutTests/media/video-played.html has a race condition when starting the test.
Summary: LayoutTests/media/video-played.html has a race condition when starting the test.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-24 15:37 PDT by Pierre d'Herbemont
Modified: 2009-04-24 15:53 PDT (History)
0 users

See Also:


Attachments
patch v1. (2.18 KB, patch)
2009-04-24 15:39 PDT, Pierre d'Herbemont
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre d'Herbemont 2009-04-24 15:37:52 PDT
LayoutTests/media/video-played.html has a race condition when starting the test.

The test may attempt to call video.play() even before the 'canplay' event has been fired.
Comment 1 Pierre d'Herbemont 2009-04-24 15:39:03 PDT
Created attachment 29768 [details]
patch v1.
Comment 2 Simon Fraser (smfr) 2009-04-24 15:41:57 PDT
Comment on attachment 29768 [details]
patch v1.

> Index: LayoutTests/ChangeLog
> ===================================================================
> --- LayoutTests/ChangeLog	(revision 42845)
> +++ LayoutTests/ChangeLog	(working copy)
> @@ -1,3 +1,16 @@
> +2009-04-24  Pierre d'Herbemont  <pdherbemont@apple.com>
> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +        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.

"...before starting the tests."

>                  waitForEvent("loadedmetadata");
> -                waitForEvent("canplay", canplay);
> +                waitForEvent("canplay", canplay); // Will triggers nextTest() which launches the tests.

"Will trigger"

r=me
Comment 3 Simon Fraser (smfr) 2009-04-24 15:53:03 PDT
http://trac.webkit.org/changeset/42848