mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-09 13:25:00 +00:00
Backed out changeset 8d5cc47b248f (bug 1401700) for failing xpcshell services/sync/tests/unit/test_bookmark_repair.js on OS X 10.10 opt. r=backout
This commit is contained in:
parent
1b6bd8290a
commit
30ccd917b0
@ -50,7 +50,6 @@ const CLIENTS_TTL_REFRESH = 604800; // 7 days
|
||||
const STALE_CLIENT_REMOTE_AGE = 604800; // 7 days
|
||||
|
||||
const SUPPORTED_PROTOCOL_VERSIONS = [SYNC_API_VERSION];
|
||||
const LAST_MODIFIED_ON_PROCESS_COMMAND_PREF = "services.sync.clients.lastModifiedOnProcessCommands";
|
||||
|
||||
function hasDupeCommand(commands, action) {
|
||||
if (!commands) {
|
||||
@ -93,17 +92,6 @@ ClientEngine.prototype = {
|
||||
allowSkippedRecord: false,
|
||||
_knownStaleFxADeviceIds: null,
|
||||
|
||||
// These two properties allow us to avoid replaying the same commands
|
||||
// continuously if we cannot manage to upload our own record.
|
||||
_localClientLastModified: 0,
|
||||
get _lastModifiedOnProcessCommands() {
|
||||
return Services.prefs.getIntPref(LAST_MODIFIED_ON_PROCESS_COMMAND_PREF, -1);
|
||||
},
|
||||
|
||||
set _lastModifiedOnProcessCommands(value) {
|
||||
Services.prefs.setIntPref(LAST_MODIFIED_ON_PROCESS_COMMAND_PREF, value);
|
||||
},
|
||||
|
||||
// Always sync client data as it controls other sync behavior
|
||||
get enabled() {
|
||||
return true;
|
||||
@ -404,7 +392,6 @@ ClientEngine.prototype = {
|
||||
// with the same name that haven't synced in over a week.
|
||||
// (Note we can't simply delete them, or we re-apply them next sync - see
|
||||
// bug 1287687)
|
||||
this._localClientLastModified = Math.round(this._incomingClients[this.localID]);
|
||||
delete this._incomingClients[this.localID];
|
||||
let names = new Set([this.localName]);
|
||||
let seenDeviceIds = new Set([localFxADeviceId]);
|
||||
@ -683,11 +670,9 @@ ClientEngine.prototype = {
|
||||
*/
|
||||
async processIncomingCommands() {
|
||||
return this._notify("clients:process-commands", "", async function() {
|
||||
if (!this.localCommands ||
|
||||
this._lastModifiedOnProcessCommands == this._localClientLastModified) {
|
||||
if (!this.localCommands) {
|
||||
return true;
|
||||
}
|
||||
this._lastModifiedOnProcessCommands = this._localClientLastModified;
|
||||
|
||||
const clearedCommands = await this._readCommands()[this.localID];
|
||||
const commands = this.localCommands.filter(command => !hasDupeCommand(clearedCommands, command));
|
||||
|
@ -1352,7 +1352,7 @@ add_task(async function test_keep_cleared_commands_after_reboot() {
|
||||
}],
|
||||
version: "48",
|
||||
protocols: ["1.5"],
|
||||
}), now - 5));
|
||||
}), now - 10));
|
||||
|
||||
// Simulate reboot
|
||||
SyncEngine.prototype._uploadOutgoing = oldUploadOutgoing;
|
||||
@ -1794,24 +1794,6 @@ add_task(async function process_incoming_refreshes_known_stale_clients() {
|
||||
stubRefresh.restore();
|
||||
});
|
||||
|
||||
add_task(async function process_incoming_refreshes_known_stale_clients() {
|
||||
Services.prefs.clearUserPref("services.sync.clients.lastModifiedOnProcessCommands");
|
||||
engine._localClientLastModified = Math.round(Date.now() / 1000);
|
||||
|
||||
const stubRemoveLocalCommand = sinon.stub(engine, "removeLocalCommand");
|
||||
const tabProcessedSpy = sinon.spy(engine, "_handleDisplayURIs");
|
||||
engine.localCommands = [{ command: "displayURI", args: ["https://foo.bar", "fxaid1", "foo"] }];
|
||||
|
||||
await engine.processIncomingCommands();
|
||||
ok(tabProcessedSpy.calledOnce);
|
||||
// Let's say we failed to upload and we end up calling processIncomingCommands again
|
||||
await engine.processIncomingCommands();
|
||||
ok(tabProcessedSpy.calledOnce);
|
||||
|
||||
tabProcessedSpy.restore();
|
||||
stubRemoveLocalCommand.restore();
|
||||
});
|
||||
|
||||
function run_test() {
|
||||
initTestLogging("Trace");
|
||||
Log.repository.getLogger("Sync.Engine.Clients").level = Log.Level.Trace;
|
||||
|
Loading…
Reference in New Issue
Block a user