Bug 1211092 - Wait for the editItemOverlay to be initialised before continuing with browser_bookmarksProperties.js to avoid intermittents. r?mak
MozReview-Commit-ID: AvTCWGFGuqf
--- a/browser/components/places/tests/browser/browser_bookmarksProperties.js
+++ b/browser/components/places/tests/browser/browser_bookmarksProperties.js
@@ -393,28 +393,26 @@ function open_properties_dialog() {
"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);
let observerWindow = aSubject.QueryInterface(Ci.nsIDOMWindow);
- waitForFocus(() => {
- // Windows has been loaded, execute our test now.
- executeSoon(function() {
- // Ensure overlay is loaded
- ok(observerWindow.gEditItemOverlay.initialized, "EditItemOverlay is initialized");
- gCurrentTest.window = observerWindow;
- try {
- gCurrentTest.run();
- } catch (ex) {
- ok(false, "An error occured during test run: " + ex.message);
- }
- });
+ waitForFocus(async () => {
+ // Ensure overlay is loaded
+ await BrowserTestUtils.waitForCondition(
+ () => observerWindow.gEditItemOverlay.initialized, "EditItemOverlay is initialized");
+ gCurrentTest.window = observerWindow;
+ try {
+ gCurrentTest.run();
+ } catch (ex) {
+ ok(false, "An error occured during test run: " + ex.message);
+ }
}, observerWindow);
}
ww.registerNotification(windowObserver);
var command = null;
switch (gCurrentTest.action) {
case ACTION_EDIT:
command = "placesCmd_show:info";