Bug 1501065 - Replace a hardcoded browser.xul reference in pageloader talos tests;r=mconley

Differential Revision: https://phabricator.services.mozilla.com/D11698

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Brian Grinstead 2018-11-14 20:57:45 +00:00
Родитель dd8df1647e
Коммит a32869aa63
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -37,6 +37,7 @@
*
* ***** END LICENSE BLOCK ***** */
ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.import("resource://gre/modules/Timer.jsm");
@ -56,11 +57,10 @@ async function talosStart() {
// window is opened. Start by finding or waiting for the default window.
let defaultWin = Services.wm.getMostRecentWindow("navigator:browser");
if (!defaultWin) {
const BROWSER_XUL = "chrome://browser/content/browser.xul";
defaultWin = await new Promise(resolve => {
const listener = {
onOpenWindow(win) {
if (win.docShell.domWindow.location.href == BROWSER_XUL) {
if (win.docShell.domWindow.location.href == AppConstants.BROWSER_CHROME_URL) {
Services.wm.removeListener(listener);
resolve(win);
}