summaryrefslogtreecommitdiffstats
path: root/browser/components/privatebrowsing
diff options
context:
space:
mode:
Diffstat (limited to 'browser/components/privatebrowsing')
-rw-r--r--browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about.js27
-rw-r--r--browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadLastDir.js2
-rw-r--r--browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadLastDir_c.js2
3 files changed, 24 insertions, 7 deletions
diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about.js
index af8bac9727..19d82e42ff 100644
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about.js
@@ -55,7 +55,7 @@ add_setup(async function () {
Ci.nsISearchService.CHANGE_REASON_UNKNOWN
);
expectedEngineAlias = privateEngine.aliases[0];
- expectedIconURL = privateEngine.getIconURL();
+ expectedIconURL = await privateEngine.getIconURL();
registerCleanupFunction(async () => {
await Services.search.setDefaultPrivate(
@@ -101,11 +101,28 @@ add_task(async function test_search_icon() {
let { win, tab } = await openAboutPrivateBrowsing();
await SpecialPowers.spawn(tab, [expectedIconURL], async function (iconURL) {
- is(
- content.document.body.getAttribute("style"),
- `--newtab-search-icon: url(${iconURL});`,
- "Should have the correct icon URL for the logo"
+ let computedStyle = content.window.getComputedStyle(content.document.body);
+ await ContentTaskUtils.waitForCondition(
+ () => computedStyle.getPropertyValue("--newtab-search-icon") != "null",
+ "Search Icon should get set."
);
+
+ if (iconURL.startsWith("blob:")) {
+ // We don't check the data here as `browser_contentSearch.js` performs
+ // those checks.
+ Assert.ok(
+ computedStyle
+ .getPropertyValue("--newtab-search-icon")
+ .startsWith("url(blob:"),
+ "Should have a blob URL for the logo"
+ );
+ } else {
+ Assert.equal(
+ computedStyle.getPropertyValue("--newtab-search-icon"),
+ `url(${iconURL})`,
+ "Should have the correct icon URL for the logo"
+ );
+ }
});
await BrowserTestUtils.closeWindow(win);
diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadLastDir.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadLastDir.js
index dd358bee73..4311638ec1 100644
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadLastDir.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadLastDir.js
@@ -17,7 +17,7 @@ function test() {
source: Services.io.newURI("http://test1.com/file"),
};
- MockFilePicker.init(window);
+ MockFilePicker.init(window.browsingContext);
MockFilePicker.returnValue = Ci.nsIFilePicker.returnOK;
let prefs = Services.prefs.getBranch("browser.download.");
diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadLastDir_c.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadLastDir_c.js
index 04e510096a..9973874b25 100644
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadLastDir_c.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadLastDir_c.js
@@ -14,7 +14,7 @@ function test() {
);
let MockFilePicker = SpecialPowers.MockFilePicker;
- MockFilePicker.init(window);
+ MockFilePicker.init(window.browsingContext);
MockFilePicker.returnValue = Ci.nsIFilePicker.returnOK;
let validateFileNameToRestore = validateFileName;