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.
Discovered while working on Bug 87042 and Bug 86877.
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?
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?
(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.
(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)
(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.
(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.
Created attachment 144096 [details] Revised test case showing onload handler is not called
(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.
(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.
(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!