forked from Floorp-Projects/Floorp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge inbound to mozilla-central. a=merge
- Loading branch information
Showing
123 changed files
with
2,390 additions
and
756 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
browser/components/enterprisepolicies/tests/browser/browser_policy_clear_blocked_cookies.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* Any copyright is dedicated to the Public Domain. | ||
* http://creativecommons.org/publicdomain/zero/1.0/ */ | ||
"use strict"; | ||
|
||
add_task(async function setup() { | ||
EnterprisePolicyTesting.resetRunOnceState(); | ||
const expiry = Date.now() + 24 * 60 * 60; | ||
Services.cookies.add("example.com", "/", "secure", "true", true, false, false, expiry, {}); | ||
Services.cookies.add("example.com", "/", "insecure", "true", false, false, false, expiry, {}); | ||
Services.cookies.add("example.org", "/", "secure", "true", true, false, false, expiry, {}); | ||
Services.cookies.add("example.org", "/", "insecure", "true", false, false, false, expiry, {}); | ||
Services.cookies.add("example.net", "/", "secure", "true", true, false, false, expiry, {}); | ||
await setupPolicyEngineWithJson({ | ||
"policies": { | ||
"Cookies": { | ||
"Block": [ | ||
"http://example.com", | ||
"https://example.org:8080" | ||
] | ||
} | ||
} | ||
}); | ||
}); | ||
|
||
function retrieve_all_cookies(host) { | ||
const values = []; | ||
const cookies = Services.cookies.getCookiesFromHost(host, {}); | ||
while (cookies.hasMoreElements()) { | ||
const cookie = cookies.getNext().QueryInterface(Ci.nsICookie); | ||
values.push({ | ||
host: cookie.host, | ||
name: cookie.name, | ||
path: cookie.path | ||
}); | ||
} | ||
return values; | ||
} | ||
|
||
add_task(async function test_cookies_for_blocked_sites_cleared() { | ||
const cookies = { | ||
hostname: retrieve_all_cookies("example.com"), | ||
origin: retrieve_all_cookies("example.org"), | ||
keep: retrieve_all_cookies("example.net") | ||
}; | ||
const expected = { | ||
hostname: [], | ||
origin: [], | ||
keep: [ | ||
{host: "example.net", | ||
name: "secure", | ||
path: "/"} | ||
] | ||
}; | ||
is(JSON.stringify(cookies), JSON.stringify(expected), | ||
"All stored cookies for blocked origins should be cleared"); | ||
}); | ||
|
||
add_task(function teardown() { | ||
for (let host of ["example.com", "example.org", "example.net"]) { | ||
Services.cookies.removeCookiesWithOriginAttributes("{}", host); | ||
} | ||
EnterprisePolicyTesting.resetRunOnceState(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
if test -d "$topsrcdir/clang/bin"; then | ||
CLANG_DIR=`cd "$topsrcdir/clang/bin" ; pwd` | ||
export PATH="${CLANG_DIR}:${PATH}" | ||
|
||
mk_export_correct_style PATH | ||
fi | ||
|
||
export LINKER=lld-link |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.