Bug 1191130 - Start listening for response before sending async message. r=pbz
authorNihanth Subramanya <nhnt11@gmail.com>
Fri, 28 Jun 2019 14:01:25 +0000
changeset 543381 7006b881f891b82230c3f5334ff541aa38c8911d
parent 543380 7966936b3c86c091be856b4eb34a12c244271519
child 543382 36f64a7df80cde6e66e84ac09c66df0c2ea1cf14
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbz
bugs1191130
milestone69.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 1191130 - Start listening for response before sending async message. r=pbz Differential Revision: https://phabricator.services.mozilla.com/D36305
browser/base/content/test/general/browser_contentSearchUI.js
--- a/browser/base/content/test/general/browser_contentSearchUI.js
+++ b/browser/base/content/test/general/browser_contentSearchUI.js
@@ -645,28 +645,28 @@ function setUp(aNoEngine) {
       await promiseTab();
       gDidInitialSetUp = true;
     }
     await msg("focus");
   })();
 }
 
 function msg(type, data = null) {
-  gMsgMan.sendAsyncMessage(TEST_MSG, {
-    type,
-    data,
-  });
   return new Promise(resolve => {
     gMsgMan.addMessageListener(TEST_MSG, function onMsg(msgObj) {
       if (msgObj.data.type != type) {
         return;
       }
       gMsgMan.removeMessageListener(TEST_MSG, onMsg);
       resolve(msgObj.data.data);
     });
+    gMsgMan.sendAsyncMessage(TEST_MSG, {
+      type,
+      data,
+    });
   });
 }
 
 function checkState(actualState, expectedInputVal, expectedSuggestions,
                     expectedSelectedIdx, expectedSelectedButtonIdx) {
   expectedSuggestions = expectedSuggestions.map(sugg => {
     return typeof(sugg) == "object" ? sugg : {
       str: sugg,