Bug 1154505 - Speed up test_bug346659.html by dropping the extra gcs, since the test harness now does a better job of disabling the popup blocker. r=smaug, a=test-only
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 30 Apr 2015 16:17:53 -0400
changeset 260339 31452d32ba4d
parent 260338 a2843f37ba38
child 260340 dda1fe153565
push id757
push userryanvm@gmail.com
push date2015-05-01 19:40 +0000
treeherdermozilla-release@a1efc72ea226 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, test-only
bugs1154505, 346659
milestone38.0
Bug 1154505 - Speed up test_bug346659.html by dropping the extra gcs, since the test harness now does a better job of disabling the popup blocker. r=smaug, a=test-only
dom/tests/mochitest/bugs/mochitest.ini
dom/tests/mochitest/bugs/test_bug346659.html
--- a/dom/tests/mochitest/bugs/mochitest.ini
+++ b/dom/tests/mochitest/bugs/mochitest.ini
@@ -49,17 +49,16 @@ skip-if = buildapp == 'mulet' || buildap
 [test_bug308856.html]
 [test_bug327891.html]
 [test_bug333983.html]
 [test_bug335976.xhtml]
 skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug))
 [test_bug342448.html]
 [test_bug345521.html]
 [test_bug346659.html]
-skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage
 [test_bug351601.html]
 [test_bug369306.html]
 skip-if = buildapp == 'mulet' || (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) || toolkit == 'android' || e10s #TIMED_OUT # b2g-debug(test timed out, can't focus back from popup window to opener?) b2g-desktop(test timed out, can't focus back from popup window to opener?)
 [test_bug370098.html]
 [test_bug377539.html]
 [test_bug384122.html]
 [test_bug389366.html]
 [test_bug38959.html]
--- a/dom/tests/mochitest/bugs/test_bug346659.html
+++ b/dom/tests/mochitest/bugs/test_bug346659.html
@@ -13,22 +13,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 <p id="display"></p>
 <div id="content" style="display: none">
   
 </div>
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 346659 **/
-// do the tests in two batches, because otherwise the popup blocker kills off
-// our test because it opens too many windows.
-var numTestsSet1 = 6;
-var numTestsSet2 = 2;
-var numTestsSet3 = 2;
-var complete = 0;
+var numTests = 10;
 SimpleTest.waitForExplicitFinish();
 
 var wins = [];
 
 function r(base, tail) {
   return base.replace(/\/[^\/]*$/, "/" + tail);
 }
 
@@ -129,32 +124,17 @@ function messageReceiver(evt) {
     default:
       ok(0, "unexpected test number (" + testNumber + ") when data is " + evt.data);
   }
 
   handleTestEnd();
 }
 
 function handleTestEnd() {
-  function gc() {
-    SpecialPowers.DOMWindowUtils.garbageCollect();
-  }
-  if (numTestsSet1) {
-    if (!--numTestsSet1) {
-      // gc to get rid of all the old windows
-      gc(); gc(); gc();
-      setTimeout(startSecondBatch, 0);
-    }
-  } else if (numTestsSet2) {
-    if (!--numTestsSet2) {
-      // gc to get rid of all the old windows
-      gc(); gc(); gc();
-      setTimeout(startThirdBatch, 0);
-    }
-  } else if (!--numTestsSet3) {
+  if (!--numTests) {
     SimpleTest.finish();
   }
 }
 window.addEventListener("message", messageReceiver, false);
 
 var win = window.open("");
 win.x = 1;
 win.location.href = "bug346659-echoer.html";
@@ -165,23 +145,18 @@ win.document.write('<script> window.open
 
 wins[3] = window.open('bug346659-opener.html?{"load":3}');
 wins[4] = window.open('bug346659-opener.html?{"write":4}');
 wins[5] = window.open('bug346659-parent.html?{"load":5}');
 wins[6] = window.open('bug346659-parent.html?{"write":6}');
 
 is(location.host, "mochi.test:8888", "Unexpected host");
 
-function startSecondBatch() {
-  var baseurl = window.location.href.replace(/mochi\.test:8888/, "example.com");
-  wins[7] = window.open(r(baseurl, 'bug346659-opener.html?{"load":7}'));
-  wins[9] = window.open(r(baseurl, 'bug346659-parent.html?{"load":9}'));
-}
+var baseurl = window.location.href.replace(/mochi\.test:8888/, "example.com");
+wins[7] = window.open(r(baseurl, 'bug346659-opener.html?{"load":7}'));
+wins[9] = window.open(r(baseurl, 'bug346659-parent.html?{"load":9}'));
 
-function startThirdBatch() {
-  var baseurl = window.location.href.replace(/mochi\.test:8888/, "example.com");
-  wins[11] = window.open(r(baseurl, 'bug346659-opener.html?{"load":11,"xsite":true}'));
-  wins[12] = window.open(r(baseurl, 'bug346659-parent.html?{"load":12,"xsite":true}'));
-}
+wins[11] = window.open(r(baseurl, 'bug346659-opener.html?{"load":11,"xsite":true}'));
+wins[12] = window.open(r(baseurl, 'bug346659-parent.html?{"load":12,"xsite":true}'));
 </script>
 </pre>
 </body>
 </html>