Bug 404077: Do GC in a small number of tests to reduce the spread of GC-related assertions. r=Jesse

This commit is contained in:
L. David Baron 2013-02-26 22:23:08 -08:00
Родитель 3a4659ca6b
Коммит ba9cc96a51
7 изменённых файлов: 46 добавлений и 0 удалений

Просмотреть файл

@ -573,6 +573,13 @@ function testExpandos() {
m2 = null;
if (SpecialPowers) {
// Run GC several times to see if the expando property disappears.
// Also, garbage collecting the windows created in this test can
// cause assertions, so we must GC now to blame those assertions to
// this test.
// ("mArguments wasn't cleaned up properly!" in ~nsGlobalWindow,
// bug 600703)
SpecialPowers.gc();
SpecialPowers.gc();
SpecialPowers.gc();

Просмотреть файл

@ -24,6 +24,12 @@ arg.testVal = "foo";
var result = window.showModalDialog("javascript:window.returnValue = window.dialogArguments.testVal; window.close(); 'This window should close on its own.';", arg);
ok(true, "We should get here without user interaction");
is(result, "foo", "Unexpected result from showModalDialog");
// Garbage collecting the windows created in this test can cause
// assertions, so GC now to blame those assertions to this test.
// ("mArguments wasn't cleaned up properly!" in ~nsGlobalWindow,
// bug 600703)
SpecialPowers.gc();
</script>
</body>
</html>

Просмотреть файл

@ -35,6 +35,13 @@ function closeTest() {
function finish() {
ok(!secondListenerDidRun, "Shouldn't have run second listener!");
// Garbage collecting the windows created in this test can cause
// assertions, so GC now to blame those assertions to this test.
// ("mArguments wasn't cleaned up properly!" in ~nsGlobalWindow,
// bug 600703)
SpecialPowers.gc();
SimpleTest.finish();
}

Просмотреть файл

@ -29,6 +29,13 @@ SimpleTest.waitForExplicitFinish();
function runTest() {
window.showModalDialog("file_bug406375.html");
ok(true, "This test should not hang");
// Garbage collecting the windows created in this test can cause
// assertions, so GC now to blame those assertions to this test.
// ("mArguments wasn't cleaned up properly!" in ~nsGlobalWindow,
// bug 600703)
SpecialPowers.gc();
SimpleTest.finish();
}

Просмотреть файл

@ -31,6 +31,12 @@ is(result2, 0, "window either opened as modal or data loaded synchronously.");
result3 = window.showModalDialog("data:text/html,<html><body onload='close(); returnValue = 3;'>");
is(result3, 3, "window didn't open as modal.");
// Garbage collecting the windows created in this test can cause
// assertions, so GC now to blame those assertions to this test.
// ("mArguments wasn't cleaned up properly!" in ~nsGlobalWindow,
// bug 600703)
SpecialPowers.gc();
</script>
</pre>
</body>

Просмотреть файл

@ -58,6 +58,12 @@ if (navigator.platform.indexOf("Win") != 0) {
test(false, true, testOtherExceptionsNotTrapped,
"Incorrectly suppressed insecure showModalDialog exception.");
// Garbage collecting the windows created in this test can cause
// assertions, so GC now to blame those assertions to this test.
// ("mArguments wasn't cleaned up properly!" in ~nsGlobalWindow,
// bug 600703)
SpecialPowers.gc();
</script>
</head>
<body>

Просмотреть файл

@ -32,6 +32,13 @@ function runTest() {
result = window.showModalDialog("http://test1.example.com/tests/dom/tests/mochitest/bugs/file_bug504862.html", "my args");
is(result, null, "Able to see return value from cross origin dialog.");
// Garbage collecting the windows created in this test can cause
// assertions, so GC now to blame those assertions to this test.
// ("mArguments wasn't cleaned up properly!" in ~nsGlobalWindow,
// bug 600703)
SpecialPowers.gc();
SimpleTest.finish();
}