From c18f31aeab03146b590fc332a020e80e9b7325ac Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 5 May 2015 02:44:17 -0400 Subject: [PATCH] Show Firefox UI when using loadBrowserWindow() in tests The window created by loadWindow() is still empty, but this removes the 'chrome' flag for loadBrowserWindow(), which causes the Firefox UI to be shown. I think openDialog calls are always chrome, but providing just the chrome flag disables all other options (e.g., navbar). --- test/content/support.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/content/support.js b/test/content/support.js index 797a0e0def..08f84c5fab 100644 --- a/test/content/support.js +++ b/test/content/support.js @@ -13,7 +13,9 @@ function waitForDOMEvent(target, event, capture) { } /** - * Open a window. Returns a promise for the window. + * Open a chrome window and return a promise for the window + * + * @return {Promise} */ function loadWindow(winurl, argument) { var win = window.openDialog(winurl, "_blank", "chrome", argument); @@ -28,7 +30,10 @@ function loadWindow(winurl, argument) { * @return {Promise} */ function loadBrowserWindow() { - return loadWindow("chrome://browser/content/browser.xul"); + var win = window.openDialog("chrome://browser/content/browser.xul"); + return waitForDOMEvent(win, "load").then(function() { + return win; + }); } /**