Backout 66a9982a4bc9 (bug 760902) for frequent orange

This commit is contained in:
Gregory Szorc 2012-07-13 23:15:21 -07:00
parent def0adbb1e
commit f98517622f

View File

@ -144,46 +144,6 @@ add_test(function test_manager_alreadysynced() {
}
});
add_test(function test_manager_getfrequency() {
const activeFreq = 500;
const username = "resu";
PREFS.set("manager.getActiveFreq", activeFreq);
let lastRequestTime = 0;
let mockRequestCount = 0;
let server = get_server_with_user(username);
server.onRequest = function onRequest() {
mockRequestCount++;
let timeDiff = Date.now() - lastRequestTime;
// We assume nsITimer has +/- 100ms variance.
do_check_true(activeFreq <= timeDiff + 100);
lastRequestTime = Date.now();
// Run for 4 GETs, then stop.
if (mockRequestCount == 4) {
manager._state = manager._PASSIVE;
manager._client = null;
manager._lastToken = null;
server.stop(run_next_test);
}
};
server.mockStatus = {code: 304};
let client = get_client_for_server(username, server);
let manager = new AitcManager(function() {
CommonUtils.nextTick(gotManager);
}, client);
function gotManager() {
// Token is all good.
manager._lastTokenTime = new Date();
// Initiate GETs at active frequency.
manager._state = manager._ACTIVE;
}
});
add_test(function test_401_responses() {
PREFS.set("client.backoff", "50");
PREFS.set("manager.putFreq", 50);