Attempted fix for bug 542928, timeouts after test_bug511456.js
authorDave Townsend <dtownsend@oxymoronical.com>
Fri, 05 Feb 2010 13:59:06 -0800
changeset 37930 a4b5e469cf2ca56cf8cd3dee3fc6fdffa4f83cf3
parent 37929 20041732bece21e72224f6c833ab1afbafe1ed7e
child 37931 d2687c5046e224145ea90de304622d861bf4b741
push id11505
push userdtownsend@mozilla.com
push dateFri, 05 Feb 2010 21:59:14 +0000
treeherdermozilla-central@a4b5e469cf2c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs542928, 511456
milestone1.9.3a2pre
Attempted fix for bug 542928, timeouts after test_bug511456.js
toolkit/components/startup/tests/browser/browser_bug511456.js
toolkit/components/startup/tests/browser/browser_bug537449.js
--- a/toolkit/components/startup/tests/browser/browser_bug511456.js
+++ b/toolkit/components/startup/tests/browser/browser_bug511456.js
@@ -99,23 +99,25 @@ function test() {
   win2.addEventListener("load", function() {
     win2.removeEventListener("load", arguments.callee, false);
     gBrowser.selectedTab = gBrowser.addTab(TEST_URL);
     gBrowser.addEventListener("load", function() {
       if (window.content.location.href != TEST_URL)
         return;
       gBrowser.removeEventListener("load", arguments.callee, false);
       Watcher.seen = false;
-      goQuitApplication();
+      var appStartup = Cc['@mozilla.org/toolkit/app-startup;1'].
+                       getService(Ci.nsIAppStartup);
+      appStartup.quit(Ci.nsIAppStartup.eAttemptQuit);
       Watcher.allowClose = true;
       ok(Watcher.seen, "Should have seen a prompt dialog");
       ok(!win2.closed, "Shouldn't have closed the additional window");
       win2.close();
       gBrowser.removeTab(gBrowser.selectedTab);
-      finish_test();
+      executeSoon(finish_test);
     }, false);
   }, false);
 }
 
 function finish_test() {
   var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
                      .getService(Components.interfaces.nsIWindowMediator);
   wm.removeListener(Watcher);
--- a/toolkit/components/startup/tests/browser/browser_bug537449.js
+++ b/toolkit/components/startup/tests/browser/browser_bug537449.js
@@ -96,27 +96,29 @@ function test() {
   wm.addListener(Watcher);
 
   gBrowser.selectedTab = gBrowser.addTab(TEST_URL);
   gBrowser.addEventListener("load", function() {
     if (window.content.location.href != TEST_URL)
       return;
     gBrowser.removeEventListener("load", arguments.callee, false);
     Watcher.seen = false;
-    goQuitApplication();
+    var appStartup = Cc['@mozilla.org/toolkit/app-startup;1'].
+                     getService(Ci.nsIAppStartup);
+    appStartup.quit(Ci.nsIAppStartup.eAttemptQuit);
     Watcher.allowClose = true;
     ok(Watcher.seen, "Should have seen a prompt dialog");
     ok(!window.closed, "Shouldn't have closed the window");
     var win2 = OpenBrowserWindow();
     ok(win2 != null, "Should have been able to open a new window");
     win2.addEventListener("load", function() {
       win2.removeEventListener("load", arguments.callee, false);
       win2.close();
       gBrowser.removeTab(gBrowser.selectedTab);
-      finish_test();
+      executeSoon(finish_test);
     }, false);
   }, false);
 }
 
 function finish_test() {
   var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
                      .getService(Components.interfaces.nsIWindowMediator);
   wm.removeListener(Watcher);