Closed Bug 630838 Opened 13 years ago Closed 13 years ago

Clear document.popupNode between b-c tests

Categories

(Testing :: Mochitest, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla2.0b12

People

(Reporter: mak, Assigned: mak)

References

Details

Attachments

(1 file, 1 obsolete file)

A browser-chrome test can set document.popupNode to a custom value, to check a context menu functionality, or a command, or whatever.

Unfortunately it's hard to ensure that all tests will then cleanup it correctly on shutdown, indeed I can find at least 6 b-c tests not doing it, plus in case of failure/timeout there is risk the cleanup doesn't run (actually they should instead use registerCleanupFunction...).

Not clearing it is problematic, since some next text could really test a popup opening and expect document.popupNode to be meaningful.

Since it's easy to handle this at the harness level I think we can do it as an additional protection against oranges.
Attached patch patch v1.0 (obsolete) — Splinter Review
Attachment #509078 - Flags: review?(gavin.sharp)
Comment on attachment 509078 [details] [diff] [review]
patch v1.0

r=mano. I'm not sure what's the policy for testing/, so keeping the request for gavin. If you know it's enough though, go ahead and land it.
Attachment #509078 - Flags: review+
Comment on attachment 509078 [details] [diff] [review]
patch v1.0

Can you put it before the setDuration block? Doesn't make much difference but it's easier conceptually to put all the "cleanup" together.
Attachment #509078 - Flags: review?(gavin.sharp) → review+
yes, I will do. I did not put it there because it's not part of the test-defined-code... but as you said won't make much difference.
Attached patch patch v1.1Splinter Review
Addressed Gavin's comment.
Attachment #509078 - Attachment is obsolete: true
http://hg.mozilla.org/mozilla-central/rev/dc93a523cdbd
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b12
Component: BrowserTest → Mochitest
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: