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).
This commit is contained in:
Dan Stillman 2015-05-05 02:44:17 -04:00
parent 7975835b5e
commit c18f31aeab

View file

@ -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;
});
}
/**