diff --git a/ipc/ipdl/Makefile.in b/ipc/ipdl/Makefile.in index 327b1d6ac43bf6e74ac4ad54d03548ebf9028c3f..39d575f8e7a690148761ebe6f8cc3ce34d717c57 100644 --- a/ipc/ipdl/Makefile.in +++ b/ipc/ipdl/Makefile.in @@ -115,7 +115,7 @@ include $(topsrcdir)/config/rules.mk # NB: the IPDL compiler manages .ipdl-->.h/.cpp dependencies itself, # which is why we don't have explicit .h/.cpp targets here export:: $(ALL_IPDLSRCS) - $(PYTHON_PATH) \ + $(PYTHON) $(topsrcdir)/config/pythonpath.py \ $(PLY_INCLUDE) \ $(srcdir)/ipdl.py \ --outheaders-dir=_ipdlheaders \ diff --git a/js/xpconnect/src/Makefile.in b/js/xpconnect/src/Makefile.in index 2f7c566650999059d6916acc06f7b600e7616def..35dfa68a6a3d7a89fb8712574f106a3f8e81f2ba 100644 --- a/js/xpconnect/src/Makefile.in +++ b/js/xpconnect/src/Makefile.in @@ -150,7 +150,7 @@ dom_quickstubs.cpp: $(srcdir)/dom_quickstubs.qsconf \ $(topsrcdir)/xpcom/idl-parser/header.py \ $(topsrcdir)/xpcom/idl-parser/xpidl.py \ $(DEPTH)/js/src/js-confdefs.h - $(PYTHON_PATH) \ + $(PYTHON) $(topsrcdir)/config/pythonpath.py \ $(PLY_INCLUDE) \ -I$(topsrcdir)/xpcom/idl-parser \ $(srcdir)/qsgen.py \ @@ -171,7 +171,7 @@ dombindings_gen.h: $(srcdir)/dombindings.conf \ $(topsrcdir)/xpcom/idl-parser/header.py \ $(topsrcdir)/xpcom/idl-parser/xpidl.py \ $(DEPTH)/js/src/js-confdefs.h - $(PYTHON_PATH) \ + $(PYTHON) $(topsrcdir)/config/pythonpath.py \ $(PLY_INCLUDE) \ -I$(topsrcdir)/xpcom/idl-parser \ $(srcdir)/dombindingsgen.py \ @@ -188,7 +188,7 @@ dombindings_gen.cpp: $(srcdir)/dombindings.conf \ $(topsrcdir)/xpcom/idl-parser/header.py \ $(topsrcdir)/xpcom/idl-parser/xpidl.py \ $(DEPTH)/js/src/js-confdefs.h - $(PYTHON_PATH) \ + $(PYTHON) $(topsrcdir)/config/pythonpath.py \ $(PLY_INCLUDE) \ -I$(topsrcdir)/xpcom/idl-parser \ $(srcdir)/dombindingsgen.py \ @@ -207,7 +207,7 @@ DictionaryHelpers.h: $(srcdir)/dictionary_helper_gen.conf \ $(topsrcdir)/xpcom/idl-parser/header.py \ $(topsrcdir)/xpcom/idl-parser/xpidl.py \ $(DEPTH)/js/src/js-confdefs.h - $(PYTHON_PATH) \ + $(PYTHON) $(topsrcdir)/config/pythonpath.py \ $(PLY_INCLUDE) \ -I$(topsrcdir)/xpcom/idl-parser \ $(srcdir)/dictionary_helper_gen.py \ @@ -222,7 +222,7 @@ DictionaryHelpers.cpp: $(srcdir)/dictionary_helper_gen.conf \ $(topsrcdir)/xpcom/idl-parser/header.py \ $(topsrcdir)/xpcom/idl-parser/xpidl.py \ $(DEPTH)/js/src/js-confdefs.h - $(PYTHON_PATH) \ + $(PYTHON) $(topsrcdir)/config/pythonpath.py \ $(PLY_INCLUDE) \ -I$(topsrcdir)/xpcom/idl-parser \ $(srcdir)/dictionary_helper_gen.py \ diff --git a/xpcom/tests/unit/test_bug325418.js b/xpcom/tests/unit/test_bug325418.js index 5c2f164e6835103b161bade78e138a4e5b8d223b..5445507e3398acf00346ce42026ce71425b4a041 100644 --- a/xpcom/tests/unit/test_bug325418.js +++ b/xpcom/tests/unit/test_bug325418.js @@ -1,31 +1,61 @@ -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); -} \ No newline at end of file +const Cc = Components.classes; +const Ci = Components.interfaces; + +// 5 seconds. +const kExpectedDelay1 = 5; +// 1 second. +const kExpectedDelay2 = 1; + +var gStartTime1; +var gStartTime2; +var timer; + +var observer1 = { + observe: function observeTC1(subject, topic, data) { + 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 down. + do_check_eq(Math.floor((Date.now() - gStartTime1) / 1000), + kExpectedDelay1); + + timer = null; + + do_print("1st timer triggered (before being cancelled). Should not have happened!"); + do_check_true(false); + } + } +}; + +var observer2 = { + observe: function observeTC2(subject, topic, data) { + 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 down. + do_check_eq(Math.floor((Date.now() - gStartTime2) / 1000), + kExpectedDelay2); + + timer = null; + + do_test_finished(); + } + } +}; + +function run_test() { + do_test_pending(); + + timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer); + + // Initialize the timer (with some delay), then cancel it. + gStartTime1 = Date.now(); + timer.init(observer1, kExpectedDelay1 * 1000, timer.TYPE_REPEATING_PRECISE); + timer.cancel(); + + // Re-initialize the timer (with a different delay). + gStartTime2 = Date.now(); + timer.init(observer2, kExpectedDelay2 * 1000, timer.TYPE_REPEATING_PRECISE); +} diff --git a/xpcom/threads/nsITimer.idl b/xpcom/threads/nsITimer.idl index d94c7c4728982082e5e76465130f1b507ef66841..8121ed47b650cd92df66db70b397e89eb705a822 100644 --- a/xpcom/threads/nsITimer.idl +++ b/xpcom/threads/nsITimer.idl @@ -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