Bug 404077: Do GC in a small number of tests to reduce the spread of GC-related assertions. r=Jesse
authorL. David Baron <dbaron@dbaron.org>
Tue, 26 Feb 2013 22:23:08 -0800
changeset 123123 d08c129669087922112f800ff9ccb7461d7be630
parent 123122 931ad73babc644324d41d3d9d23a54af702dc4a2
child 123124 77ca1d9b59676734ce303ecd03f45b94c9654c40
push id24372
push useremorley@mozilla.com
push dateWed, 27 Feb 2013 13:22:59 +0000
treeherdermozilla-central@0a91da5f5eab [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersJesse
bugs404077
milestone22.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
content/html/document/test/test_bug391777.html
dom/tests/mochitest/bugs/test_bug291653.html
dom/tests/mochitest/bugs/test_bug406375.html
dom/tests/mochitest/bugs/test_bug414291.html
dom/tests/mochitest/bugs/test_bug437361.html
dom/tests/mochitest/bugs/test_bug504862.html
--- a/content/base/test/test_mutationobservers.html
+++ b/content/base/test/test_mutationobservers.html
@@ -568,16 +568,23 @@ function testExpandos() {
     observer.disconnect();
     then();
   });
   m2.expandoProperty = true;
   m2.observe(div, { attributes: true });
   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();
     SpecialPowers.gc();
   }
   div.setAttribute("foo", "bar2");
 }
 
--- a/content/html/document/test/test_bug391777.html
+++ b/content/html/document/test/test_bug391777.html
@@ -19,11 +19,17 @@ if (navigator.platform.indexOf("Win") !=
 }
 
 /** Test for Bug 391777 **/
 var arg = {};
 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>
--- a/dom/tests/mochitest/bugs/test_bug291653.html
+++ b/dom/tests/mochitest/bugs/test_bug291653.html
@@ -30,16 +30,23 @@ var w = window.open("file_bug291653.html
 
 function closeTest() {
   w.setTimeout("close()", 0);
   setTimeout("finish()", 500);
 }
 
 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();
 }
 
 function end() {
   setTimeout("closeTest()", 500);
 }
 
 
--- a/dom/tests/mochitest/bugs/test_bug406375.html
+++ b/dom/tests/mochitest/bugs/test_bug406375.html
@@ -24,15 +24,22 @@ if (navigator.platform.indexOf("Mac") ==
 /** Test for Bug 406375 **/
 
 
 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();
 }
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/tests/mochitest/bugs/test_bug414291.html
+++ b/dom/tests/mochitest/bugs/test_bug414291.html
@@ -26,12 +26,18 @@ window.open("data:text/html,<html><body 
 is(result1, 0, "window either opened as modal or loaded synchronously.");
 
 window.open("data:text/html,<html><body onload='close(); opener.result2 = 2;'>", "w2", "modal=yes");
 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>
 </html>
--- a/dom/tests/mochitest/bugs/test_bug437361.html
+++ b/dom/tests/mochitest/bugs/test_bug437361.html
@@ -53,16 +53,22 @@ if (navigator.platform.indexOf("Win") !=
        "Blocked showModalDialog caused an exception.");
        
   test(false, false, testModalDialogAllowed,
        "showModalDialog was blocked even though dom.disable_open_during_load was false.");
 
   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>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=437361">Mozilla Bug 437361</a>
 <p id="display"></p>
 <div id="content" style="display: none"> 
 </div>
 <pre id="test">
--- a/dom/tests/mochitest/bugs/test_bug504862.html
+++ b/dom/tests/mochitest/bugs/test_bug504862.html
@@ -27,15 +27,22 @@ function runTest() {
   window.addEventListener("message", onMsgRcv, false);
 
   var result = window.showModalDialog("file_bug504862.html", "my args");
   is(result, null, "window sees previous dialog documents return value.");
 
   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();
 }
 
 </script>
 </pre>
 </body>
 </html>