diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /browser/components/privatebrowsing | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/privatebrowsing')
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; |