Bug 869908 - Remote the promise stack hacks from GCLI; r=mratcliffe
authorJoe Walker <jwalker@mozilla.com>
Thu, 09 May 2013 15:15:23 +0100
changeset 142496 b05c947fa8aecca548ed88bdee63b4c8665425e3
parent 142495 d6249744132e202e60b8dd3d756518beef692a9e
child 142497 5f8b38a672e5cd83b4ad8ab9c4866afefa3f7d4d
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmratcliffe
bugs869908
milestone23.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 869908 - Remote the promise stack hacks from GCLI; r=mratcliffe
browser/devtools/commandline/test/browser_cmd_addon.js
browser/devtools/commandline/test/browser_cmd_commands.js
--- a/browser/devtools/commandline/test/browser_cmd_addon.js
+++ b/browser/devtools/commandline/test/browser_cmd_addon.js
@@ -11,23 +11,18 @@ function test() {
   helpers.addTabWithToolbar("about:blank", function(options) {
     return helpers.runTests(options, tests);
   }).then(finish);
 }
 
 tests.gatTest = function(options) {
   let deferred = Promise.defer();
 
-  // hack to reduce stack size as a result of bug 842347
-  let onGatReadyInterjection = function() {
-    executeSoon(onGatReady);
-  };
-
   let onGatReady = function() {
-    Services.obs.removeObserver(onGatReadyInterjection, "gcli_addon_commands_ready");
+    Services.obs.removeObserver(onGatReady, "gcli_addon_commands_ready");
     info("gcli_addon_commands_ready notification received, running tests");
 
     let auditDone = helpers.audit(options, [
       {
         setup: 'addon list dictionary',
         check: {
           input:  'addon list dictionary',
           hints:                       '',
@@ -116,17 +111,17 @@ tests.gatTest = function(options) {
       }
     ]);
 
     auditDone.then(function() {
       deferred.resolve();
     });
   };
 
-  Services.obs.addObserver(onGatReadyInterjection, "gcli_addon_commands_ready", false);
+  Services.obs.addObserver(onGatReady, "gcli_addon_commands_ready", false);
 
   if (CmdAddonFlags.addonsLoaded) {
     info("The call to AddonManager.getAllAddons in BuiltinCommands.jsm is done.");
     info("Send the gcli_addon_commands_ready notification ourselves.");
 
     Services.obs.notifyObservers(null, "gcli_addon_commands_ready", null);
   } else {
     info("Waiting for gcli_addon_commands_ready notification.");
--- a/browser/devtools/commandline/test/browser_cmd_commands.js
+++ b/browser/devtools/commandline/test/browser_cmd_commands.js
@@ -51,22 +51,17 @@ tests.testConsole = function(options) {
         exec: {
           output: ""
         },
         post: function() {
           ok(!(hud.hudId in HUDService.hudReferences), "console closed");
         }
       }
     ]).then(function() {
-      // FIXME: Remove this hack once bug 842347 is fixed
-      // Gak - our promises impl causes so many stack frames that we blow up the
-      // JS engine. Jumping to a new event with a truncated stack solves this.
-      executeSoon(function() {
-        deferred.resolve();
-      });
+      deferred.resolve();
     });
   };
 
   helpers.audit(options, [
     {
       setup: "console open",
       exec: { }
     }