mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-21 17:59:34 +00:00
Bug 648068: Remove "reset" from the days since last request blocklist variable. r=dtownsend
This commit is contained in:
parent
909f9077e7
commit
bd258fd2d3
@ -433,12 +433,8 @@ Blocklist.prototype = {
|
||||
var pingCountVersion = getPref("getIntPref", PREF_BLOCKLIST_PINGCOUNTVERSION, 0);
|
||||
var pingCountTotal = getPref("getIntPref", PREF_BLOCKLIST_PINGCOUNTTOTAL, 1);
|
||||
var daysSinceLastPing = 0;
|
||||
if (pingCountVersion < 1 || pingCountTotal < 1) {
|
||||
daysSinceLastPing = pingCountVersion == 0 ? "new" : "reset";
|
||||
if (pingCountVersion < 1)
|
||||
pingCountVersion = 1;
|
||||
if (pingCountTotal < 1)
|
||||
pingCountTotal = 1;
|
||||
if (pingCountVersion == 0) {
|
||||
daysSinceLastPing = "new";
|
||||
}
|
||||
else {
|
||||
// Seconds in one day is used because nsIUpdateTimerManager stores the
|
||||
@ -458,6 +454,11 @@ Blocklist.prototype = {
|
||||
}
|
||||
}
|
||||
|
||||
if (pingCountVersion < 1)
|
||||
pingCountVersion = 1;
|
||||
if (pingCountTotal < 1)
|
||||
pingCountTotal = 1;
|
||||
|
||||
dsURI = dsURI.replace(/%APP_ID%/g, gApp.ID);
|
||||
dsURI = dsURI.replace(/%APP_VERSION%/g, gApp.version);
|
||||
dsURI = dsURI.replace(/%PRODUCT%/g, gApp.name);
|
||||
|
@ -68,7 +68,7 @@ function test4() {
|
||||
Services.prefs.setIntPref(PREF_BLOCKLIST_LASTUPDATETIME,
|
||||
(getNowInSeconds() - (SECONDS_IN_DAY * 2)));
|
||||
gNextTest = test5;
|
||||
gExpectedQueryString = "1&3&reset";
|
||||
gExpectedQueryString = "1&3&2";
|
||||
notify_blocklist();
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ function test8() {
|
||||
Services.prefs.setIntPref(PREF_BLOCKLIST_LASTUPDATETIME,
|
||||
(getNowInSeconds() - (SECONDS_IN_DAY * 5)));
|
||||
gNextTest = test9;
|
||||
gExpectedQueryString = "1&6&reset";
|
||||
gExpectedQueryString = "1&6&5";
|
||||
notify_blocklist();
|
||||
}
|
||||
|
||||
@ -116,8 +116,25 @@ function test9() {
|
||||
function test10() {
|
||||
Services.prefs.setIntPref(PREF_BLOCKLIST_LASTUPDATETIME,
|
||||
(getNowInSeconds() - (SECONDS_IN_DAY * 7)));
|
||||
gNextTest = test11;
|
||||
gExpectedQueryString = "3&1&7";
|
||||
notify_blocklist();
|
||||
}
|
||||
|
||||
function test11() {
|
||||
Services.prefs.setIntPref(PREF_BLOCKLIST_PINGCOUNTVERSION, -1);
|
||||
Services.prefs.setIntPref(PREF_BLOCKLIST_LASTUPDATETIME,
|
||||
(getNowInSeconds() - (SECONDS_IN_DAY * 8)));
|
||||
gNextTest = test12;
|
||||
gExpectedQueryString = "1&2&8";
|
||||
notify_blocklist();
|
||||
}
|
||||
|
||||
function test12() {
|
||||
Services.prefs.setIntPref(PREF_BLOCKLIST_LASTUPDATETIME,
|
||||
(getNowInSeconds() - (SECONDS_IN_DAY * 9)));
|
||||
gNextTest = finish;
|
||||
gExpectedQueryString = "3&1&reset";
|
||||
gExpectedQueryString = "2&3&9";
|
||||
notify_blocklist();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user