diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /toolkit/components/antitracking/test/browser | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/antitracking/test/browser')
9 files changed, 102 insertions, 9 deletions
diff --git a/toolkit/components/antitracking/test/browser/browser.toml b/toolkit/components/antitracking/test/browser/browser.toml index 9d0874ed3a..edb429b49e 100644 --- a/toolkit/components/antitracking/test/browser/browser.toml +++ b/toolkit/components/antitracking/test/browser/browser.toml @@ -1,5 +1,9 @@ [DEFAULT] -skip-if = ["os == 'linux' && (asan || tsan)"] # bug 1662229 - task exception +skip-if = [ + "os == 'linux' && os_version == '18.04' && asan", # bug 1662229 - task exception + "os == 'linux' && os_version == '18.04' && tsan", # bug 1662229 - task exception + "debug", # bug 1884982 - takes 20+ minutes to run on debug +] prefs = [ "dom.storage_access.prompt.testing=true", # Disable the Storage Access API prompts for all of the tests in this directory "dom.storage_access.prompt.testing.allow=true", @@ -108,6 +112,8 @@ skip-if = ["os == 'mac' && !debug"] # Bug 1503778, 1577362 ["browser_onModifyRequestNotificationForTrackingResources.js"] +["browser_partitionedABA.js"] + ["browser_partitionedClearSiteDataHeader.js"] support-files = ["clearSiteData.sjs"] @@ -194,7 +200,7 @@ support-files = [ "!/browser/components/originattributes/test/browser/file_thirdPartyChild.request.html", "!/browser/components/originattributes/test/browser/file_thirdPartyChild.script.js", "!/browser/components/originattributes/test/browser/file_thirdPartyChild.sharedworker.js", - "!/browser/components/originattributes/test/browser/file_thirdPartyChild.video.ogv", + "!/browser/components/originattributes/test/browser/file_thirdPartyChild.video.webm", "!/browser/components/originattributes/test/browser/file_thirdPartyChild.worker.fetch.html", "!/browser/components/originattributes/test/browser/file_thirdPartyChild.worker.js", "!/browser/components/originattributes/test/browser/file_thirdPartyChild.worker.request.html", @@ -210,7 +216,7 @@ support-files = [ "file_saveAsImage.sjs", "file_saveAsVideo.sjs", "file_saveAsPageInfo.html", - "file_video.ogv", + "file_video.webm", ] ["browser_staticPartition_tls_session.js"] diff --git a/toolkit/components/antitracking/test/browser/browser_doublyNestedTracker.js b/toolkit/components/antitracking/test/browser/browser_doublyNestedTracker.js index 4f38b29a7d..c3b6342ce1 100644 --- a/toolkit/components/antitracking/test/browser/browser_doublyNestedTracker.js +++ b/toolkit/components/antitracking/test/browser/browser_doublyNestedTracker.js @@ -36,7 +36,7 @@ add_task(async function () { async function runChecks() { is(document.cookie, "", "No cookies for me"); document.cookie = "name=value"; - is(document.cookie, "name=value", "I have the cookies!"); + is(document.cookie, "", "I don't have the cookies!"); } await new Promise(resolve => { diff --git a/toolkit/components/antitracking/test/browser/browser_partitionedABA.js b/toolkit/components/antitracking/test/browser/browser_partitionedABA.js new file mode 100644 index 0000000000..b6acc82d48 --- /dev/null +++ b/toolkit/components/antitracking/test/browser/browser_partitionedABA.js @@ -0,0 +1,86 @@ +/* vim: set ts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* + * A test to verify that ABA iframes partition at least localStorage and document.cookie + */ + +"use strict"; + +add_setup(async function () { + await setCookieBehaviorPref( + BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN, + false + ); +}); + +add_task(async function runTest() { + info("Creating the tab"); + let tab = BrowserTestUtils.addTab(gBrowser, TEST_TOP_PAGE); + gBrowser.selectedTab = tab; + + let browser = tab.linkedBrowser; + await BrowserTestUtils.browserLoaded(browser); + + info("Creating the third-party iframe"); + let ifrBC = await SpecialPowers.spawn( + browser, + [TEST_TOP_PAGE_7], + async page => { + let ifr = content.document.createElement("iframe"); + + let loading = ContentTaskUtils.waitForEvent(ifr, "load"); + content.document.body.appendChild(ifr); + ifr.src = page; + await loading; + + return ifr.browsingContext; + } + ); + + info("Creating the ABA iframe"); + let ifrABABC = await SpecialPowers.spawn( + ifrBC, + [TEST_TOP_PAGE], + async page => { + let ifr = content.document.createElement("iframe"); + + let loading = ContentTaskUtils.waitForEvent(ifr, "load"); + content.document.body.appendChild(ifr); + ifr.src = page; + await loading; + + return ifr.browsingContext; + } + ); + + info("Write cookie to the ABA third-party iframe"); + await SpecialPowers.spawn(ifrABABC, [], async _ => { + content.document.cookie = "foo; SameSite=None; Secure; Partitioned"; + }); + + let cookie = await SpecialPowers.spawn(browser, [], async () => { + return content.document.cookie; + }); + is(cookie, "", "Cookie is not in the top level"); + + info("Write localstorage to the ABA third-party iframe"); + await SpecialPowers.spawn(ifrABABC, [], async _ => { + content.localStorage.setItem("foo", "bar"); + }); + + let storage = await SpecialPowers.spawn(browser, [], async () => { + return content.localStorage.getItem("foo"); + }); + is(storage, null, "LocalStorage update is not in the top level"); + + info("Clean up"); + BrowserTestUtils.removeTab(tab); + await new Promise(resolve => { + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => + resolve() + ); + }); +}); diff --git a/toolkit/components/antitracking/test/browser/browser_staticPartition_cache.js b/toolkit/components/antitracking/test/browser/browser_staticPartition_cache.js index 9afe3180fb..9383e5a6f9 100644 --- a/toolkit/components/antitracking/test/browser/browser_staticPartition_cache.js +++ b/toolkit/components/antitracking/test/browser/browser_staticPartition_cache.js @@ -105,7 +105,7 @@ add_task(async function () { // The CSS cache needs to be cleared in-process. content.windowUtils.clearSharedStyleSheetCache(); - let videoURL = arg.urlPrefix + "file_thirdPartyChild.video.ogv"; + let videoURL = arg.urlPrefix + "file_thirdPartyChild.video.webm"; let audioURL = arg.urlPrefix + "file_thirdPartyChild.audio.ogg"; let URLSuffix = "?r=" + arg.randomSuffix; @@ -176,7 +176,7 @@ add_task(async function () { "xhr.html", "worker.xhr.html", "audio.ogg", - "video.ogv", + "video.webm", "fetch.html", "worker.fetch.html", "request.html", diff --git a/toolkit/components/antitracking/test/browser/browser_staticPartition_saveAs.js b/toolkit/components/antitracking/test/browser/browser_staticPartition_saveAs.js index b9984829eb..9da751cadb 100644 --- a/toolkit/components/antitracking/test/browser/browser_staticPartition_saveAs.js +++ b/toolkit/components/antitracking/test/browser/browser_staticPartition_saveAs.js @@ -401,7 +401,7 @@ add_task(async function testPageInfoMediaSaveAs() { ); info("Open the media panel of the pageinfo."); - let pageInfo = BrowserPageInfo( + let pageInfo = BrowserCommands.pageInfo( gBrowser.selectedBrowser.currentURI.spec, "mediaTab" ); @@ -478,7 +478,7 @@ add_task(async function testPageInfoMediaMultipleSelectedSaveAs() { ); info("Open the media panel of the pageinfo."); - let pageInfo = BrowserPageInfo( + let pageInfo = BrowserCommands.pageInfo( gBrowser.selectedBrowser.currentURI.spec, "mediaTab" ); diff --git a/toolkit/components/antitracking/test/browser/browser_storageAccessThirdPartyChecks_alwaysPartition.js b/toolkit/components/antitracking/test/browser/browser_storageAccessThirdPartyChecks_alwaysPartition.js index f31c7893d0..8ea97dac68 100644 --- a/toolkit/components/antitracking/test/browser/browser_storageAccessThirdPartyChecks_alwaysPartition.js +++ b/toolkit/components/antitracking/test/browser/browser_storageAccessThirdPartyChecks_alwaysPartition.js @@ -53,6 +53,7 @@ AntiTracking._createTask({ "https://tracking.example.org", "https://tracking.example.org", "https://tracking.example.org", + "https://another-tracking.example.net", "https://itisatracker.org", ], }); diff --git a/toolkit/components/antitracking/test/browser/file_saveAsPageInfo.html b/toolkit/components/antitracking/test/browser/file_saveAsPageInfo.html index aa3de2a555..c8c409d130 100644 --- a/toolkit/components/antitracking/test/browser/file_saveAsPageInfo.html +++ b/toolkit/components/antitracking/test/browser/file_saveAsPageInfo.html @@ -1,6 +1,6 @@ <html> <body> <img src="http://example.net/browser/toolkit/components/antitracking/test/browser/raptor.jpg" id="image1"> - <video src="http://example.net/browser/toolkit/components/antitracking/test/browser/file_video.ogv" id="video1"> </video> + <video src="http://example.net/browser/toolkit/components/antitracking/test/browser/file_video.webm" id="video1"> </video> </body> </html> diff --git a/toolkit/components/antitracking/test/browser/file_video.ogv b/toolkit/components/antitracking/test/browser/file_video.ogv Binary files differdeleted file mode 100644 index 68dee3cf2b..0000000000 --- a/toolkit/components/antitracking/test/browser/file_video.ogv +++ /dev/null diff --git a/toolkit/components/antitracking/test/browser/file_video.webm b/toolkit/components/antitracking/test/browser/file_video.webm Binary files differnew file mode 100644 index 0000000000..2cee5a9e51 --- /dev/null +++ b/toolkit/components/antitracking/test/browser/file_video.webm |