mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 16:25:38 +00:00
Bug 1486944 - Part 2: Add tests to ensure that the reject foreign cookie behavior also depends on the browser.contentblocking.enabled pref; r=baku
This commit is contained in:
parent
d1d402d14c
commit
faefec50e9
@ -28,6 +28,7 @@ support-files = server.sjs
|
||||
[browser_imageCache3.js]
|
||||
[browser_imageCache4.js]
|
||||
[browser_imageCache5.js]
|
||||
[browser_imageCache6.js]
|
||||
[browser_onBeforeRequestNotificationForTrackingResources.js]
|
||||
[browser_onModifyRequestNotificationForTrackingResources.js]
|
||||
[browser_subResources.js]
|
||||
|
@ -0,0 +1,15 @@
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
let cookieBehavior = BEHAVIOR_REJECT_FOREIGN;
|
||||
let blockingByContentBlocking = false;
|
||||
let blockingByAllowList = false;
|
||||
|
||||
let rootDir = getRootDirectory(gTestPath);
|
||||
let jar = getJar(rootDir);
|
||||
if (jar) {
|
||||
let tmpdir = extractJarToTmp(jar);
|
||||
rootDir = "file://" + tmpdir.path + "/";
|
||||
}
|
||||
/* import-globals-from imageCacheWorker.js */
|
||||
Services.scriptloader.loadSubScript(rootDir + "imageCacheWorker.js", this);
|
||||
|
@ -53,7 +53,7 @@ this.AntiTracking = {
|
||||
|
||||
// Phase 1: Here we want to test that a 3rd party context is not blocked if pref is off.
|
||||
if (runExtraTests) {
|
||||
// There are four ways in which the third-party context may be blocked:
|
||||
// There are four ways in which the third-party context may not be blocked:
|
||||
// * If the cookieBehavior pref causes it to not be blocked.
|
||||
// * If the contentBlocking pref causes it to not be blocked.
|
||||
// * If both of these prefs cause it to not be blocked.
|
||||
@ -62,9 +62,18 @@ this.AntiTracking = {
|
||||
this._createTask(name, BEHAVIOR_ACCEPT, true, false, callbackNonTracking);
|
||||
this._createCleanupTask(cleanupFunction);
|
||||
|
||||
this._createTask(name, BEHAVIOR_REJECT_FOREIGN, false, false, callbackNonTracking);
|
||||
this._createCleanupTask(cleanupFunction);
|
||||
|
||||
this._createTask(name, BEHAVIOR_REJECT_TRACKER, false, false, callbackNonTracking);
|
||||
this._createCleanupTask(cleanupFunction);
|
||||
|
||||
this._createTask(name, BEHAVIOR_REJECT_FOREIGN, false, true, callbackNonTracking);
|
||||
this._createCleanupTask(cleanupFunction);
|
||||
|
||||
this._createTask(name, BEHAVIOR_REJECT_TRACKER, false, true, callbackNonTracking);
|
||||
this._createCleanupTask(cleanupFunction);
|
||||
|
||||
this._createTask(name, BEHAVIOR_ACCEPT, false, false, callbackNonTracking);
|
||||
this._createCleanupTask(cleanupFunction);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user