diff --git a/devtools/client/webide/test/head.js b/devtools/client/webide/test/head.js index b4497d42c0b5..b8b1793486d7 100644 --- a/devtools/client/webide/test/head.js +++ b/devtools/client/webide/test/head.js @@ -4,6 +4,7 @@ "use strict"; const { require } = ChromeUtils.import("resource://devtools/shared/Loader.jsm", {}); +ChromeUtils.import("resource://gre/modules/AppConstants.jsm"); const { FileUtils } = require("resource://gre/modules/FileUtils.jsm"); const { gDevTools } = require("devtools/client/framework/devtools"); const Services = require("Services"); @@ -12,7 +13,7 @@ const DevToolsUtils = require("devtools/shared/DevToolsUtils"); const { DebuggerServer } = require("devtools/server/main"); var TEST_BASE; -if (window.location === "chrome://browser/content/browser.xul") { +if (window.location === AppConstants.BROWSER_CHROME_URL) { TEST_BASE = "chrome://mochitests/content/browser/devtools/client/webide/test/"; } else { TEST_BASE = "chrome://mochitests/content/chrome/devtools/client/webide/test/"; diff --git a/dom/base/test/test_openDialogChromeOnly.html b/dom/base/test/test_openDialogChromeOnly.html index 6548668c0c60..810e21295e19 100644 --- a/dom/base/test/test_openDialogChromeOnly.html +++ b/dom/base/test/test_openDialogChromeOnly.html @@ -13,7 +13,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=931768 /** Test for Bug 931768 **/ try { - openDialog("chrome://browser/content/browser.xul"); + openDialog(AppConstants.BROWSER_CHROME_URL); ok(false, "Calling openDialog from unprivileged script should throw."); } catch (e) { ok(e instanceof ReferenceError, diff --git a/testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm b/testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm index 67171e25d226..ab21bdfb6fbe 100644 --- a/testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm +++ b/testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm @@ -577,7 +577,7 @@ var BrowserTestUtils = { if (url) { await this.waitForEvent(win, "DOMContentLoaded"); - if (win.document.documentURI != "chrome://browser/content/browser.xul") { + if (win.document.documentURI != AppConstants.BROWSER_CHROME_URL) { return; } } diff --git a/testing/mochitest/api.js b/testing/mochitest/api.js index c80e9b31d166..2cdcb42a22d4 100644 --- a/testing/mochitest/api.js +++ b/testing/mochitest/api.js @@ -32,7 +32,7 @@ const windowTracker = { let {document} = window; let {documentURI} = document; - if (documentURI !== "chrome://browser/content/browser.xul") { + if (documentURI !== AppConstants.BROWSER_CHROME_URL) { return; } loadChromeScripts(window); diff --git a/testing/mochitest/browser-test.js b/testing/mochitest/browser-test.js index 5cac16180d7b..1b296fd6e14d 100644 --- a/testing/mochitest/browser-test.js +++ b/testing/mochitest/browser-test.js @@ -365,7 +365,7 @@ function takeInstrumentation() { } win.addEventListener("load", () => { - if (win.location.href != "chrome://browser/content/browser.xul") { + if (win.location.href != AppConstants.BROWSER_CHROME_URL) { return; } diff --git a/testing/talos/talos/bootstrap.js b/testing/talos/talos/bootstrap.js index 7a6fa61c561f..491c8c5a016e 100644 --- a/testing/talos/talos/bootstrap.js +++ b/testing/talos/talos/bootstrap.js @@ -11,6 +11,7 @@ // Reads the chrome.manifest from a legacy non-restartless extension and loads // its overlays into the appropriate top-level windows. +ChromeUtils.import("resource://gre/modules/AppConstants.jsm"); ChromeUtils.import("resource://gre/modules/NetUtil.jsm"); ChromeUtils.import("resource://gre/modules/Services.jsm"); @@ -27,7 +28,7 @@ const windowTracker = { let {document} = window; let {documentURI} = document; - if (documentURI !== "chrome://browser/content/browser.xul") { + if (documentURI !== AppConstants.BROWSER_CHROME_URL) { return; } initializeBrowser(window); diff --git a/testing/talos/talos/pageloader/chrome/pageloader.js b/testing/talos/talos/pageloader/chrome/pageloader.js index 657ebdb7017a..8e0f80ece56f 100644 --- a/testing/talos/talos/pageloader/chrome/pageloader.js +++ b/testing/talos/talos/pageloader/chrome/pageloader.js @@ -6,6 +6,7 @@ /* eslint mozilla/avoid-Date-timing: "off" */ ChromeUtils.import("resource://gre/modules/Services.jsm"); +ChromeUtils.import("resource://gre/modules/AppConstants.jsm"); ChromeUtils.import("resource://gre/modules/E10SUtils.jsm"); var NUM_CYCLES = 5; @@ -181,7 +182,7 @@ function plInit() { toolbars = "titlebar,resizable"; } - browserWindow = Services.ww.openWindow(null, "chrome://browser/content/", "_blank", + browserWindow = Services.ww.openWindow(null, AppConstants.BROWSER_CHROME_URL, "_blank", `chrome,${toolbars},dialog=no,width=${winWidth},height=${winHeight}`, blank); gPaintWindow = browserWindow; diff --git a/testing/talos/talos/tests/devtools/addon/bootstrap.js b/testing/talos/talos/tests/devtools/addon/bootstrap.js index f753c05b0e8b..b4ec71393d25 100644 --- a/testing/talos/talos/tests/devtools/addon/bootstrap.js +++ b/testing/talos/talos/tests/devtools/addon/bootstrap.js @@ -11,6 +11,7 @@ // Reads the chrome.manifest from a legacy non-restartless extension and loads // its overlays into the appropriate top-level windows. +ChromeUtils.import("resource://gre/modules/AppConstants.jsm"); ChromeUtils.import("resource://gre/modules/Services.jsm"); const windowTracker = { @@ -26,7 +27,7 @@ const windowTracker = { let {document} = window; let {documentURI} = document; - if (documentURI !== "chrome://browser/content/browser.xul") { + if (documentURI !== AppConstants.BROWSER_CHROME_URL) { return; } initializeBrowser(window); diff --git a/testing/talos/talos/tests/tart/addon/bootstrap.js b/testing/talos/talos/tests/tart/addon/bootstrap.js index 7a6fa61c561f..491c8c5a016e 100644 --- a/testing/talos/talos/tests/tart/addon/bootstrap.js +++ b/testing/talos/talos/tests/tart/addon/bootstrap.js @@ -11,6 +11,7 @@ // Reads the chrome.manifest from a legacy non-restartless extension and loads // its overlays into the appropriate top-level windows. +ChromeUtils.import("resource://gre/modules/AppConstants.jsm"); ChromeUtils.import("resource://gre/modules/NetUtil.jsm"); ChromeUtils.import("resource://gre/modules/Services.jsm"); @@ -27,7 +28,7 @@ const windowTracker = { let {document} = window; let {documentURI} = document; - if (documentURI !== "chrome://browser/content/browser.xul") { + if (documentURI !== AppConstants.BROWSER_CHROME_URL) { return; } initializeBrowser(window);