Added a trivial fault tolerance JS module with a trivial test suite.

This commit is contained in:
Atul Varma 2008-05-28 11:25:28 -07:00
parent c8b1c91b51
commit c00c81efab
2 changed files with 25 additions and 0 deletions

View 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);
}
};

View 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");
}