Closed Bug 369319 Opened 17 years ago Closed 17 years ago

reftest should use onload

Categories

(Testing :: Reftest, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: dbaron, Assigned: dbaron)

Details

Attachments

(2 files)

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.
Attached patch patchSplinter 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]
patch

nice patch
Attachment #254598 - Flags: review?(rcampbell) → review+
Checked in to trunk.
Status: NEW → RESOLVED
Closed: 17 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).
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.
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.

Attachment

General

Created:
Updated:
Size: