Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
36
gaia/apps/sharedtest/test/unit/sync/sync-engine/adapter-mock.js
Executable file
36
gaia/apps/sharedtest/test/unit/sync/sync-engine/adapter-mock.js
Executable file
|
|
@ -0,0 +1,36 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
'use strict';
|
||||
|
||||
/* exported
|
||||
AdapterMock
|
||||
*/
|
||||
|
||||
var AdapterMock = (action, args) => {
|
||||
return {
|
||||
update(kintoColl, options) {
|
||||
AdapterMock.options = options;
|
||||
if (action === 'noop') {
|
||||
// Even if the adapter makes changes, we want to see that
|
||||
// SyncEngine does not sync those changes up if the adapter
|
||||
// return false.
|
||||
return kintoColl.update.apply(kintoColl, args).then(() => {
|
||||
return false;
|
||||
});
|
||||
}
|
||||
if (action) {
|
||||
return kintoColl[action].apply(kintoColl, args).then(() => {
|
||||
return true;
|
||||
});
|
||||
}
|
||||
return Promise.resolve(false);
|
||||
},
|
||||
handleConflict(conflict) {
|
||||
return Promise.resolve(conflict.local);
|
||||
},
|
||||
reset() {
|
||||
return Promise.resolve();
|
||||
}
|
||||
};
|
||||
};
|
||||
Loading…
Reference in a new issue