mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Added a trivial fault tolerance JS module with a trivial test suite.
This commit is contained in:
parent
c8b1c91b51
commit
c00c81efab
18
services/sync/modules/faultTolerance.js
Normal file
18
services/sync/modules/faultTolerance.js
Normal file
@ -0,0 +1,18 @@
|
||||
const EXPORTED_SYMBOLS = ["FaultTolerance"];
|
||||
|
||||
FaultTolerance = {
|
||||
get Service() {
|
||||
if (!this._Service)
|
||||
this._Service = new FaultToleranceService();
|
||||
return this._Service;
|
||||
}
|
||||
}
|
||||
|
||||
function FaultToleranceService() {
|
||||
}
|
||||
|
||||
FaultToleranceService.prototype = {
|
||||
processMessage: function FTApp_doAppend(message) {
|
||||
dump(message);
|
||||
}
|
||||
};
|
7
services/sync/tests/unit/test_fault_tolerance.js
Normal file
7
services/sync/tests/unit/test_fault_tolerance.js
Normal file
@ -0,0 +1,7 @@
|
||||
function run_test() {
|
||||
Components.utils.import("resource://weave/faultTolerance.js");
|
||||
|
||||
// Just make sure the getter works and the service is a singleton.
|
||||
FaultTolerance.Service._testProperty = "hi";
|
||||
do_check_eq(FaultTolerance.Service._testProperty, "hi");
|
||||
}
|
Loading…
Reference in New Issue
Block a user