Bug 1500475 - Fix browser_jsterm_content_defined_helpers.js intermittent. r=Honza, a=test-only
authorNicolas Chevobbe <nchevobbe@mozilla.com>
Mon, 22 Oct 2018 14:23:55 +0000
changeset 500809 9185ecc725220ff44c3b20c85c421e44abdf3439
parent 500808 3c3beb416a0e5e6530f6551a0b2ad3c48394c218
child 500810 e8cd0248b93cab0e1377389da0a00e7223542748
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersHonza, test-only
bugs1500475
milestone64.0
Bug 1500475 - Fix browser_jsterm_content_defined_helpers.js intermittent. r=Honza, a=test-only 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);
 }