Bug 1357676 - Modify failed tests r=jdm

We've introduced a new pref network.cookie.quotaPerHost and also a rule that the value of network.cookie.maxPerHost should always be bigger than network.cookie.quotaPerHost. So, before changing the value of network.cookie.maxPerHost, we have to set network.cookie.quotaPerHost first.
This patch only sets network.cookie.quotaPerHost equal to network.cookie.maxPerHost - 1 in all failed tests.

Differential Revision: https://phabricator.services.mozilla.com/D4346

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Kershaw Chang 2018-08-30 15:41:37 +00:00
Родитель 5cbb200d5c
Коммит 08bb991b4d
4 изменённых файлов: 17 добавлений и 0 удалений

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

@ -19,6 +19,9 @@ function continue_test()
function* do_run_test()
{
// Set quotaPerHost to maxPerHost - 1, so there is only one cookie
// will be evicted everytime.
Services.prefs.setIntPref("network.cookie.quotaPerHost", 49);
// Set the base domain limit to 50 so we have a known value.
Services.prefs.setIntPref("network.cookie.maxPerHost", 50);

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

@ -30,6 +30,7 @@ static NS_DEFINE_CID(kPrefServiceCID, NS_PREFSERVICE_CID);
// various pref strings
static const char kCookiesPermissions[] = "network.cookie.cookieBehavior";
static const char kPrefCookieQuotaPerHost[] = "network.cookie.quotaPerHost";
static const char kCookiesMaxPerHost[] = "network.cookie.maxPerHost";
static const char kCookieLeaveSecurityAlone[] = "network.cookie.leave-secure-alone";
@ -179,6 +180,9 @@ InitPrefs(nsIPrefBranch *aPrefBranch)
// however, we don't test third party blocking here.
aPrefBranch->SetIntPref(kCookiesPermissions, 0); // accept all
aPrefBranch->SetBoolPref(kCookieLeaveSecurityAlone, true);
// Set quotaPerHost to maxPerHost - 1, so there is only one cookie
// will be evicted everytime.
aPrefBranch->SetIntPref(kPrefCookieQuotaPerHost, 49);
// Set the base domain limit to 50 so we have a known value.
aPrefBranch->SetIntPref(kCookiesMaxPerHost, 50);
}

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

@ -17,8 +17,13 @@
add_task(async function init() {
// We need to trigger a cookie eviction in order to test our batch delete
// observer.
// Set quotaPerHost to maxPerHost - 1, so there is only one cookie
// will be evicted everytime.
SpecialPowers.setIntPref("network.cookie.quotaPerHost", 2);
SpecialPowers.setIntPref("network.cookie.maxPerHost", 3);
SimpleTest.registerCleanupFunction(() => {
SpecialPowers.clearUserPref("network.cookie.quotaPerHost");
SpecialPowers.clearUserPref("network.cookie.maxPerHost");
});
});

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

@ -17,8 +17,13 @@
add_task(async function init() {
// We need to trigger a cookie eviction in order to test our batch delete
// observer.
// Set quotaPerHost to maxPerHost - 1, so there is only one cookie
// will be evicted everytime.
SpecialPowers.setIntPref("network.cookie.quotaPerHost", 2);
SpecialPowers.setIntPref("network.cookie.maxPerHost", 3);
SimpleTest.registerCleanupFunction(() => {
SpecialPowers.clearUserPref("network.cookie.quotaPerHost");
SpecialPowers.clearUserPref("network.cookie.maxPerHost");
});
});