Bug 1642006 - Part 2: test case; r=baku

Depends on D78272

Differential Revision: https://phabricator.services.mozilla.com/D78273
This commit is contained in:
Liang-Heng Chen 2020-06-04 15:36:31 +00:00
Родитель c1ca99a8d2
Коммит e9679af252
1 изменённых файлов: 34 добавлений и 0 удалений

Просмотреть файл

@ -28,6 +28,10 @@ add_task(async () => {
"network.cookie.cookieBehavior",
Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN,
],
["privacy.restrict3rdpartystorage.heuristic.redirect", false],
["privacy.trackingprotection.enabled", false],
["privacy.trackingprotection.pbmode.enabled", false],
["privacy.trackingprotection.annotate_channels", true],
],
});
registerCleanupFunction(cleanup);
@ -155,6 +159,9 @@ add_task(async () => {
thirdParty: "thirdParty",
});
// mark third-party as tracker
await UrlClassifierTestUtils.addTestTrackers();
info("load third-party content as first-party");
await redirectWithUserInteraction(
browser,
@ -173,6 +180,33 @@ add_task(async () => {
TEST_TOP_PAGE
);
info("third-party tracker should NOT able to access first-party data");
await checkData(browser, {
firstParty: "firstParty",
thirdParty: "",
});
// remove third-party from tracker
await UrlClassifierTestUtils.cleanupTestTrackers();
info("load third-party content as first-party");
await redirectWithUserInteraction(
browser,
TEST_REDIRECT_3RD_PARTY_PAGE,
TEST_3RD_PARTY_PAGE
);
await checkData(browser, {
firstParty: "heuristicFirstParty",
});
info("redirect back to first-party page");
await redirectWithUserInteraction(
browser,
TEST_REDIRECT_TOP_PAGE,
TEST_TOP_PAGE
);
info("third-party page should able to access first-party data");
await checkData(browser, {
firstParty: "firstParty",