mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 05:10:49 +00:00
Bug 683159: Explicitly gc in test_bug451286 so that intermittent assertions aren't spread across all the following tests.
This commit is contained in:
parent
b013e1e07b
commit
2693b89783
@ -23,14 +23,15 @@
|
||||
var gFindBar = null;
|
||||
var gBrowser;
|
||||
|
||||
var imports = ["SimpleTest", "ok", "snapshotWindow", "compareSnapshots"];
|
||||
var imports = ["SimpleTest", "ok", "snapshotWindow", "compareSnapshots",
|
||||
"parentFinish"];
|
||||
for each (var name in imports) {
|
||||
window[name] = window.opener.wrappedJSObject[name];
|
||||
}
|
||||
|
||||
function finish() {
|
||||
window.close();
|
||||
SimpleTest.finish();
|
||||
parentFinish();
|
||||
}
|
||||
|
||||
function startTest() {
|
||||
|
@ -32,6 +32,25 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=451286
|
||||
<script class="testbody" type="application/javascript">
|
||||
<![CDATA[
|
||||
|
||||
// We trigger assertions that happen during the GC of our parent
|
||||
// window.
|
||||
SimpleTest.expectAssertions(5); // bug 683159
|
||||
|
||||
// To be called by the window we open.
|
||||
function parentFinish() {
|
||||
// This is called with JS code from the window we open on the
|
||||
// stack. We need to GC everything in that window, so do that
|
||||
// from a timeout and then call SimpleTest.finish().
|
||||
setTimeout(doFinish, 0);
|
||||
}
|
||||
|
||||
function doFinish() {
|
||||
// Garbage collect objects created in this test can cause
|
||||
// assertions, so GC now to blame those assertions to this test.
|
||||
SpecialPowers.gc();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
/** Test for Bug 451286 **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug451286_window.xul", "451286test",
|
||||
|
Loading…
x
Reference in New Issue
Block a user