var observer1 = {
observe: function observeTC1(subject, topic) { if (topic == "timer-callback") { // Stop timer, so it doesn't repeat (if test runs slowly).
timer.cancel();
// Actual delay may not be exact, so convert to seconds and round. Assert.equal(
Math.round((Date.now() - gStartTime1) / 1000),
kExpectedDelay1
);
timer = null;
info( "1st timer triggered (before being cancelled). Should not have happened!"
); Assert.ok(false);
}
},
};
var observer2 = {
observe: function observeTC2(subject, topic) { if (topic == "timer-callback") { // Stop timer, so it doesn't repeat (if test runs slowly).
timer.cancel();
// Actual delay may not be exact, so convert to seconds and round. Assert.equal(
Math.round((Date.now() - gStartTime2) / 1000),
kExpectedDelay2
);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.