Bug 740769. (Bv1) Convert test_bug325418.js file to LF end-of-lines, Fix nsITimer.idl documentation. r=bzbarsky.

DONTBUILD.
This commit is contained in:
Serge Gautherie 2012-04-10 04:32:19 +02:00
parent b6b17661cb
commit f5cb497d42
2 changed files with 32 additions and 33 deletions

View File

@ -1,31 +1,31 @@
const Cc = Components.classes;
const Ci = Components.interfaces;
var timer;
const start_time = (new Date()).getTime();
const expected_time = 1;
var observer = {
observe: function observeTC(subject, topic, data) {
if (topic == "timer-callback") {
timer.cancel();
timer = null;
// expected time may not be exact so convert to seconds and round down.
var result = Math.floor(((new Date()).getTime() - start_time) / 1000);
do_check_eq(result, expected_time);
do_test_finished();
}
}
};
function run_test() {
do_test_pending();
timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
// Start a 5 second timer, than cancel it and start a 1 second timer.
timer.init(observer, 5000, timer.TYPE_REPEATING_PRECISE);
timer.cancel();
timer.init(observer, 1000, timer.TYPE_REPEATING_PRECISE);
}
const Cc = Components.classes;
const Ci = Components.interfaces;
var timer;
const start_time = (new Date()).getTime();
const expected_time = 1;
var observer = {
observe: function observeTC(subject, topic, data) {
if (topic == "timer-callback") {
timer.cancel();
timer = null;
// expected time may not be exact so convert to seconds and round down.
var result = Math.floor(((new Date()).getTime() - start_time) / 1000);
do_check_eq(result, expected_time);
do_test_finished();
}
}
};
function run_test() {
do_test_pending();
timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
// Start a 5 second timer, than cancel it and start a 1 second timer.
timer.init(observer, 5000, timer.TYPE_REPEATING_PRECISE);
timer.cancel();
timer.init(observer, 1000, timer.TYPE_REPEATING_PRECISE);
}

View File

@ -177,8 +177,7 @@ interface nsITimer : nsISupports
/**
* Initialize a timer to fire after the given millisecond interval.
* This version takes a function to call and a closure to pass to
* that function.
* This version takes a function to call.
*
* @param aFunc nsITimerCallback interface to call when timer expires
* @param aDelay The millisecond interval