Bug 1178709 - use waitForFocus in browser_bookmarksProperties.js. r=gijs a=test-only
authorMarco Bonardo <mbonardo@mozilla.com>
Thu, 27 Aug 2015 09:35:53 +0200
changeset 289150 9e63a5691e747a891eff14a70134a79f68183455
parent 289149 4778ce088e458d6a64f0d2a3e8eca7ebb01d6432
child 289151 452f6270615dd054a237f2ab40164b6d682fb5b3
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgijs, test-only
bugs1178709
milestone42.0a2
Bug 1178709 - use waitForFocus in browser_bookmarksProperties.js. r=gijs a=test-only
browser/components/places/tests/browser/browser.ini
browser/components/places/tests/browser/browser_bookmarksProperties.js
--- a/browser/components/places/tests/browser/browser.ini
+++ b/browser/components/places/tests/browser/browser.ini
@@ -23,17 +23,16 @@ support-files =
 [browser_bookmarklet_windowOpen.js]
 support-files =
   pageopeningwindow.html
 [browser_bookmarkProperties_addFolderDefaultButton.js]
 [browser_bookmarkProperties_addKeywordForThisSearch.js]
 [browser_bookmarkProperties_addLivemark.js]
 [browser_bookmarkProperties_readOnlyRoot.js]
 [browser_bookmarksProperties.js]
-skip-if = (os == 'win' && os_version == "6.2") # Bug 1178709
 [browser_drag_bookmarks_on_toolbar.js]
 skip-if = e10s # Bug ?????? - test fails - "Number of dragged items should be the same. - Got 0, expected 1"
 [browser_forgetthissite_single.js]
 [browser_history_sidebar_search.js]
 skip-if = e10s && (os == 'linux' || os == 'mac') # Bug 1116457
 [browser_library_batch_delete.js]
 [browser_library_commands.js]
 [browser_library_downloads.js]
--- a/browser/components/places/tests/browser/browser_bookmarksProperties.js
+++ b/browser/components/places/tests/browser/browser_bookmarksProperties.js
@@ -399,31 +399,30 @@ function open_properties_dialog() {
     ok(tree.selectedNode,
        "We have a places node selected: " + tree.selectedNode.title);
 
     // Wait for the Properties dialog.
     function windowObserver(aSubject, aTopic, aData) {
       if (aTopic != "domwindowopened")
         return;
       ww.unregisterNotification(windowObserver);
-      var win = aSubject.QueryInterface(Ci.nsIDOMWindow);
-      win.addEventListener("focus", function (event) {
-        win.removeEventListener("focus", arguments.callee, false);
+      let win = aSubject.QueryInterface(Ci.nsIDOMWindow);
+      waitForFocus(() => {
         // Windows has been loaded, execute our test now.
         executeSoon(function () {
           // Ensure overlay is loaded
           ok(win.gEditItemOverlay.initialized, "EditItemOverlay is initialized");
           gCurrentTest.window = win;
           try {
             gCurrentTest.run();
           } catch (ex) {
             ok(false, "An error occured during test run: " + ex.message);
           }
         });
-      }, false);
+      }, win);
     }
     ww.registerNotification(windowObserver);
 
     var command = null;
     switch (gCurrentTest.action) {
       case ACTION_EDIT:
         command = "placesCmd_show:info";
         break;