If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

reftest should use onload



11 years ago
9 years ago


(Reporter: dbaron, Assigned: dbaron)


Firefox Tracking Flags

(Not tracked)



(2 attachments)

Reftest should use onload on the browser element rather than the nsIWebProgressListener stuff it currently uses.  This might fix the intermittent test failures I'm seeing with some of the tests from bug 1156.  It should also be known to fire after onload in the content.
Created attachment 254598 [details] [diff] [review]

I'm hoping this might fix the random failures on two of the object tests.
Attachment #254598 - Flags: review?(rcampbell)
And this also adds a timeout so that we give up if a page doesn't load after 10 seconds.  (It doesn't look like we fire onerror for frames, although I suppose I could actually test...)
No, we don't seem to fire error events.
Comment on attachment 254598 [details] [diff] [review]

nice patch
Attachment #254598 - Flags: review?(rcampbell) → review+
Checked in to trunk.
Last Resolved: 11 years ago
Resolution: --- → FIXED
I backed out the timeout part of the page, and there are also a few test regressions from the other part (and they aren't fixed by putting the 20ms delay back).
Created attachment 254884 [details] [diff] [review]
combined regression fixes

I've fixed the sources of the regressions.  There were two problems:

 * some tests used setTimeout(foo, 0) from onload.  My capturing load event came before onload, so I needed a double setTimeout to end up after the setTimeout in the test.

 * I was handling load events from subframes

The latter was the cause of the fake load timeouts, so I've also restored the part of the patch that I backed out yesterday (comment 6).

This patch represents the combination of all the changes I've made since I checked in the above patch.  Since I reverted the backout, the net change is pretty small.

Comment 8

11 years ago
See bug 371026 for an idea about adding mochitest-like
SimpleTest.waitForExplicitFinish() / SimpleTest.finish() functions instead.
Component: Layout: Misc Code → Reftest
Product: Core → Testing
Version: Trunk → unspecified
You need to log in before you can comment on or make changes to this bug.