Bug 87448

Summary: Presence of video tag causes DumpRenderTree to exit before calling onload handler
Product: WebKit Reporter: Kenneth Russell <kbr>
Component: MediaAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: ap, eric.carlson, jer.noble
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Test case; unzip in LayoutTests/fast/canvas/webgl
none
Revised test case showing onload handler is not called none

Kenneth Russell
Reported 2012-05-24 18:41:15 PDT
Created attachment 143946 [details] Test case; unzip in LayoutTests/fast/canvas/webgl It appears that if a <video> tag is present, DumpRenderTree will exit before calling the body's onload handler, unless layoutTestController.waitUntilDone() has been called. If waitUntilDone() is called within the body's onload handler, the test will exit early. Reproduced with Chromium port's DumpRenderTree implementation. Not sure whether it happens with other ports. Commenting out the video tag causes the onload handler to run 100% reliably. Calling waitUntilDone() in script executed during page load causes the test to run 100% reliably. See the attached test case; unzip in LayoutTests/fast/canvas/webgl.
Attachments
Test case; unzip in LayoutTests/fast/canvas/webgl (1.46 KB, application/octet-stream)
2012-05-24 18:41 PDT, Kenneth Russell
no flags
Revised test case showing onload handler is not called (1.48 KB, application/octet-stream)
2012-05-25 10:24 PDT, Kenneth Russell
no flags
Kenneth Russell
Comment 1 2012-05-24 18:43:50 PDT
Discovered while working on Bug 87042 and Bug 86877.
Ami Fischman
Comment 2 2012-05-24 23:29:09 PDT
kbr: do you know if DRT's behavior is document somewhere vis-a-vis what it guarantees to execute before exiting when waitUntilDone() hasn't been called?
Eric Carlson
Comment 3 2012-05-25 08:49:36 PDT
The media element will block the document's 'load' event during setup and initial buffering, are you sure your onload handler is being called at all?
Kenneth Russell
Comment 4 2012-05-25 10:18:26 PDT
(In reply to comment #2) > kbr: do you know if DRT's behavior is document somewhere vis-a-vis what it guarantees to execute before exiting when waitUntilDone() hasn't been called? I don't know whether it's written down but it seems to be common knowledge among WebKit developers; jamesr told me that that is definitely the rule.
Ami Fischman
Comment 5 2012-05-25 10:20:15 PDT
(In reply to comment #4) > (In reply to comment #2) > > kbr: do you know if DRT's behavior is document somewhere vis-a-vis what it guarantees to execute before exiting when waitUntilDone() hasn't been called? > > I don't know whether it's written down but it seems to be common knowledge among WebKit developers; jamesr told me that that is definitely the rule. Sorry, what is the common knowledge? (I really don't know what the contract is)
Kenneth Russell
Comment 6 2012-05-25 10:22:40 PDT
(In reply to comment #5) > (In reply to comment #4) > > (In reply to comment #2) > > > kbr: do you know if DRT's behavior is document somewhere vis-a-vis what it guarantees to execute before exiting when waitUntilDone() hasn't been called? > > > > I don't know whether it's written down but it seems to be common knowledge among WebKit developers; jamesr told me that that is definitely the rule. > > Sorry, what is the common knowledge? > (I really don't know what the contract is) Sorry; I meant that the onload handler is called before DRT exits.
Kenneth Russell
Comment 7 2012-05-25 10:23:26 PDT
(In reply to comment #3) > The media element will block the document's 'load' event during setup and initial buffering, are you sure your onload handler is being called at all? When the problem occurs, the onload handler is definitely not getting called. I'll upload a revised test case showing this.
Kenneth Russell
Comment 8 2012-05-25 10:24:02 PDT
Created attachment 144096 [details] Revised test case showing onload handler is not called
Eric Carlson
Comment 9 2012-05-25 10:41:40 PDT
(In reply to comment #7) > > When the problem occurs, the onload handler is definitely not getting called. I'll upload a revised test case showing this. So I'll bet that this is caused by the <video> element delaying the 'load' event while loading and parsing the initial portion of the file. As far as I know DRT does not wait for the 'load' event to be fired, that is what waitUntilDone() is for.
Ami Fischman
Comment 10 2012-05-25 10:45:55 PDT
(In reply to comment #9) > As far as I know DRT does not wait for the 'load' event to be fired, that is what waitUntilDone() is for. Eric: what would you say DRTs contract is/should be? FWIW, http://trac.webkit.org/wiki/Writing%20Layout%20Tests%20for%20DumpRenderTree says: By default, DumpRenderTree dumps each test file immediately after the document has loaded and the load event handlers have executed.
Eric Carlson
Comment 11 2012-05-25 11:02:41 PDT
(In reply to comment #10) > (In reply to comment #9) > > As far as I know DRT does not wait for the 'load' event to be fired, that is what waitUntilDone() is for. > > Eric: what would you say DRTs contract is/should be? > FWIW, http://trac.webkit.org/wiki/Writing%20Layout%20Tests%20for%20DumpRenderTree says: > By default, DumpRenderTree dumps each test file immediately after the document has loaded and the load event handlers have executed. Silly me!
Note You need to log in before you can comment on or make changes to this bug.