Bug 1167915 - followup: avoid modal dialog potentially blocking the test. r=ttaubert
authorMarco Bonardo <mbonardo@mozilla.com>
Mon, 08 Jun 2015 17:06:00 +0200
changeset 247678 eb586f84c8a306510213d57863fbfe978bc5170c
parent 247677 1497b026f64bbfbe4a3850a6357e2ecc2424531c
child 247679 85e876f34bcc00459f9ba47d5a3296de00aefd85
push id28876
push userryanvm@gmail.com
push dateTue, 09 Jun 2015 17:10:02 +0000
treeherdermozilla-central@29d982aac2a2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersttaubert
bugs1167915
milestone41.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 1167915 - followup: avoid modal dialog potentially blocking the test. r=ttaubert
browser/components/places/tests/browser/browser_bookmarkProperties_addKeywordForThisSearch.js
browser/components/places/tests/browser/head.js
--- a/browser/components/places/tests/browser/browser_bookmarkProperties_addKeywordForThisSearch.js
+++ b/browser/components/places/tests/browser/browser_bookmarkProperties_addKeywordForThisSearch.js
@@ -5,19 +5,17 @@ const TEST_URL = "http://mochi.test:8888
 add_task(function* () {
   yield BrowserTestUtils.withNewTab({
     gBrowser,
     url: TEST_URL,
   }, function* (browser) {
     // We must wait for the context menu code to build metadata.
     yield openContextMenuForContentSelector(browser, 'form > input[name="search"]');
 
-    yield withBookmarksDialog(function*() {
-      AddKeywordForSearchField();
-    }, function* (dialogWin) {
+    yield withBookmarksDialog(AddKeywordForSearchField, function* (dialogWin) {
       let acceptBtn = dialogWin.document.documentElement.getButton("accept");
       ok(acceptBtn.disabled, "Accept button is disabled");
 
       let promiseKeywordNotification = promiseBookmarksNotification(
         "onItemChanged", (itemId, prop, isAnno, val) => prop == "keyword" && val =="kw");
 
       fillBookmarkTextField("editBMPanel_keywordField", "kw", dialogWin);
 
--- a/browser/components/places/tests/browser/head.js
+++ b/browser/components/places/tests/browser/head.js
@@ -305,17 +305,19 @@ let withBookmarksDialog = Task.async(fun
         waitForFocus(() => {
           resolve(win);
         }, win);
       });
     });
   });
 
   info("withBookmarksDialog: opening the dialog");
-  yield openFn();
+  // The dialog might be modal and could block our events loop, so executeSoon.
+  executeSoon(openFn);
+
   info("withBookmarksDialog: waiting for the dialog");
   let dialogWin = yield dialogPromise;
 
   // Ensure overlay is loaded
   ok(dialogWin.gEditItemOverlay.initialized, "EditItemOverlay is initialized");
 
   info("withBookmarksDialog: executing the task");
   try {