mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
45d3f90cf3
Engines now maintain a reference to the service they belong to. This allows them to obtain references to other engine instances belonging to that service and that service only. Stores and trackers now maintain a reference to the engine they belong to. Engine managers now maintain a reference back to a service. The clients singleton has been removed. It now exists as an instance variable on Service. Parts of ClientsEngine do behave as singletons (e.g. commands). This will be addressed in future refactoring.
31 lines
908 B
JavaScript
31 lines
908 B
JavaScript
/* Any copyright is dedicated to the Public Domain.
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
Cu.import("resource://services-sync/engines.js");
|
|
Cu.import("resource://services-sync/service.js");
|
|
|
|
function run_test() {
|
|
let tracker = new Tracker("Tracker", Service);
|
|
let id = "the_id!";
|
|
|
|
_("Make sure nothing exists yet..");
|
|
do_check_eq(tracker.changedIDs[id], null);
|
|
|
|
_("Make sure adding of time 0 works");
|
|
tracker.addChangedID(id, 0);
|
|
do_check_eq(tracker.changedIDs[id], 0);
|
|
|
|
_("A newer time will replace the old 0");
|
|
tracker.addChangedID(id, 10);
|
|
do_check_eq(tracker.changedIDs[id], 10);
|
|
|
|
_("An older time will not replace the newer 10");
|
|
tracker.addChangedID(id, 5);
|
|
do_check_eq(tracker.changedIDs[id], 10);
|
|
|
|
_("Adding without time defaults to current time");
|
|
tracker.addChangedID(id);
|
|
do_check_true(tracker.changedIDs[id] > 10);
|
|
tracker._lazySave.clear()
|
|
}
|