Bug 1220011 - Yield on 'console close' command in test (fixes permafail with bug 1224294 applied); r=jwalker, a=testonly
authorBrian Grinstead <bgrinstead@mozilla.com>
Thu, 03 Dec 2015 10:02:37 -0500
changeset 305739 7303f043cf7e4ebd20ce072d33ed4a92495f503f
parent 305738 51ee6ccf889dd818b983ea4565a57bbf5e42cfb0
child 305740 e2d7d6033fae23341f077089774d25e56443466e
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalker, testonly
bugs1220011, 1224294
milestone44.0a2
Bug 1220011 - Yield on 'console close' command in test (fixes permafail with bug 1224294 applied); r=jwalker, a=testonly
devtools/client/commandline/test/browser_cmd_commands.js
devtools/client/webconsole/console-commands.js
--- a/devtools/client/commandline/test/browser_cmd_commands.js
+++ b/devtools/client/commandline/test/browser_cmd_commands.js
@@ -27,27 +27,23 @@ function* spawnTest() {
   subject.QueryInterface(Ci.nsISupportsString);
   let hud = HUDService.getHudReferenceById(subject.data);
   ok(hud, "console open");
 
   let msg = yield hud.jsterm.execute("pprint(window)");
 
   ok(msg, "output for pprint(window)");
 
-  let oncePromise = hud.jsterm.once("messages-cleared");
-
-  helpers.audit(options, [
+  yield helpers.audit(options, [
     {
       setup: "console clear",
       exec: { output: "" }
     }
   ]);
 
-  yield oncePromise;
-
   let labels = hud.outputNode.querySelectorAll(".message");
   is(labels.length, 0, "no output in console");
 
   yield helpers.audit(options, [
     {
       setup: "console close",
       exec: { output: "" }
     }
--- a/devtools/client/webconsole/console-commands.js
+++ b/devtools/client/webconsole/console-commands.js
@@ -67,17 +67,19 @@ exports.items = [
         return;
       }
 
       let panel = toolbox.getPanel("webconsole");
       if (panel == null) {
         return;
       }
 
+      let onceMessagesCleared = panel.hud.jsterm.once("messages-cleared");
       panel.hud.jsterm.clearOutput();
+      return onceMessagesCleared;
     }
   },
   {
     item: "command",
     runAt: "client",
     name: "console close",
     description: l10n.lookup("consolecloseDesc"),
     exec: function(args, context) {