Bug 1500475 - Fix browser_jsterm_content_defined_helpers.js intermittent; r=Honza.
authorNicolas Chevobbe <nchevobbe@mozilla.com>
Mon, 22 Oct 2018 14:23:55 +0000
changeset 490690 9a6f5e359f1d3a281253b5cfa18f4f7502dd4d5e
parent 490689 ffbc071b41bd30784c817593b200f9020c51c421
child 490691 e7d0ae555a8d4cf6068f84648253fafffe9bf498
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersHonza
bugs1500475
milestone64.0a1
Bug 1500475 - Fix browser_jsterm_content_defined_helpers.js intermittent; r=Honza. Differential Revision: https://phabricator.services.mozilla.com/D9360
devtools/client/webconsole/test/mochitest/browser_jsterm_content_defined_helpers.js
--- a/devtools/client/webconsole/test/mochitest/browser_jsterm_content_defined_helpers.js
+++ b/devtools/client/webconsole/test/mochitest/browser_jsterm_content_defined_helpers.js
@@ -41,25 +41,27 @@ add_task(async function() {
   await pushPref("devtools.webconsole.jsterm.codeMirror", false);
   await performTests();
   // And then run it with the CodeMirror-powered one.
   await pushPref("devtools.webconsole.jsterm.codeMirror", true);
   await performTests();
 });
 
 async function performTests() {
-  const {jsterm} = await openNewTabAndConsole(TEST_URI);
+  const hud = await openNewTabAndConsole(TEST_URI);
+  const {jsterm} = hud;
   const {autocompletePopup} = jsterm;
 
   for (const helper of HELPERS) {
     await setInputValueForAutocompletion(jsterm, helper);
     const autocompleteItems = getPopupLabels(autocompletePopup).filter(l => l === helper);
     is(autocompleteItems.length, 1,
       `There's no duplicated "${helper}" item in the autocomplete popup`);
-    const msg = await jsterm.execute(`${helper}()`);
-    is(msg.textContent.trim(), `"${PREFIX + helper}"`,
-      `output is correct for ${helper}()`);
+
+    await executeAndWaitForMessage(
+      hud, `${helper}()`, `"${PREFIX + helper}"`, ".result");
+    ok(true, `output is correct for ${helper}()`);
   }
 }
 
 function getPopupLabels(popup) {
   return popup.getItems().map(item => item.label);
 }