From ba9cc96a51b54f03f7c798969eeafe1f0d4c02e5 Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Tue, 26 Feb 2013 22:23:08 -0800 Subject: [PATCH] Bug 404077: Do GC in a small number of tests to reduce the spread of GC-related assertions. r=Jesse --- content/base/test/test_mutationobservers.html | 7 +++++++ content/html/document/test/test_bug391777.html | 6 ++++++ dom/tests/mochitest/bugs/test_bug291653.html | 7 +++++++ dom/tests/mochitest/bugs/test_bug406375.html | 7 +++++++ dom/tests/mochitest/bugs/test_bug414291.html | 6 ++++++ dom/tests/mochitest/bugs/test_bug437361.html | 6 ++++++ dom/tests/mochitest/bugs/test_bug504862.html | 7 +++++++ 7 files changed, 46 insertions(+) diff --git a/content/base/test/test_mutationobservers.html b/content/base/test/test_mutationobservers.html index d784f19d1cd4..19513a195abc 100644 --- a/content/base/test/test_mutationobservers.html +++ b/content/base/test/test_mutationobservers.html @@ -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(); diff --git a/content/html/document/test/test_bug391777.html b/content/html/document/test/test_bug391777.html index db96d93eac5e..727aebe4315e 100644 --- a/content/html/document/test/test_bug391777.html +++ b/content/html/document/test/test_bug391777.html @@ -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(); diff --git a/dom/tests/mochitest/bugs/test_bug291653.html b/dom/tests/mochitest/bugs/test_bug291653.html index 846d266a6b56..ac3dd246befe 100644 --- a/dom/tests/mochitest/bugs/test_bug291653.html +++ b/dom/tests/mochitest/bugs/test_bug291653.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(); } diff --git a/dom/tests/mochitest/bugs/test_bug406375.html b/dom/tests/mochitest/bugs/test_bug406375.html index 930d80c5c540..5150834926cc 100644 --- a/dom/tests/mochitest/bugs/test_bug406375.html +++ b/dom/tests/mochitest/bugs/test_bug406375.html @@ -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(); } diff --git a/dom/tests/mochitest/bugs/test_bug414291.html b/dom/tests/mochitest/bugs/test_bug414291.html index a2c3cd0fc736..5b4bb4d9e537 100644 --- a/dom/tests/mochitest/bugs/test_bug414291.html +++ b/dom/tests/mochitest/bugs/test_bug414291.html @@ -31,6 +31,12 @@ is(result2, 0, "window either opened as modal or data loaded synchronously."); result3 = window.showModalDialog("data:text/html,"); 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(); + diff --git a/dom/tests/mochitest/bugs/test_bug437361.html b/dom/tests/mochitest/bugs/test_bug437361.html index da3df9ca6ad6..390c03b3aea0 100644 --- a/dom/tests/mochitest/bugs/test_bug437361.html +++ b/dom/tests/mochitest/bugs/test_bug437361.html @@ -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(); + diff --git a/dom/tests/mochitest/bugs/test_bug504862.html b/dom/tests/mochitest/bugs/test_bug504862.html index 9adb3893441b..db2ba21f91d0 100644 --- a/dom/tests/mochitest/bugs/test_bug504862.html +++ b/dom/tests/mochitest/bugs/test_bug504862.html @@ -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(); }