Bug 1398739 - Fix Activity Stream related test failure in browser_google_behavior.js. r=Mardak
authorAndrei Oprea <andrei.br92@gmail.com>
Mon, 11 Sep 2017 15:08:24 +0300
changeset 662686 105783286166ddc04ce65c66bcd2f97e2d5b4748
parent 662685 f3342ea446a53bcc0957e4eca50906a4b684d710
child 662687 ab339292ac6b767d2fc7ac4c7de651fb99b0c420
push id79159
push userhikezoe@mozilla.com
push dateMon, 11 Sep 2017 23:25:15 +0000
reviewersMardak
bugs1398739
milestone57.0a1
Bug 1398739 - Fix Activity Stream related test failure in browser_google_behavior.js. r=Mardak MozReview-Commit-ID: FjPE8gWWkqe
browser/components/search/test/browser_google_behavior.js
--- a/browser/components/search/test/browser_google_behavior.js
+++ b/browser/components/search/test/browser_google_behavior.js
@@ -51,16 +51,23 @@ function promiseStateChangeURI() {
 
     gBrowser.addProgressListener(listener);
   });
 }
 
 function promiseContentSearchReady(browser) {
   return ContentTask.spawn(browser, {}, async function(args) {
     return new Promise(resolve => {
+      if (content.wrappedJSObject.gContentSearchController) {
+        let searchController = content.wrappedJSObject.gContentSearchController;
+        if (searchController.defaultEngine) {
+          resolve();
+        }
+      }
+
       content.addEventListener("ContentSearchService", function listener(aEvent) {
         if (aEvent.detail.type == "State") {
           content.removeEventListener("ContentSearchService", listener);
           resolve();
         }
       });
     });
   });