commit c18f31aeab03146b590fc332a020e80e9b7325ac
parent 7975835b5e9619bf8e54dbe7f011794acb58c8cc
Author: Dan Stillman <dstillman@zotero.org>
Date: Tue, 5 May 2015 02:44:17 -0400
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).
Diffstat:
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git 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<ChromeWindow>}
*/
function loadWindow(winurl, argument) {
var win = window.openDialog(winurl, "_blank", "chrome", argument);
@@ -28,7 +30,10 @@ function loadWindow(winurl, argument) {
* @return {Promise<ChromeWindow>}
*/
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;
+ });
}
/**