Bug 683124 - Add function to xpcshell-test harness to output info text. r=ted.mielczarek
authorBlair McBride <bmcbride@mozilla.com>
Wed, 07 Sep 2011 16:26:20 +1200
changeset 77972 f9c574a28a7a33a63fcc80ffbac9ab65d552c92b
parent 77971 c5aa67488400c90644d4fbbbaad34e96ed403701
child 77973 02f42784ccb28b942b345d44d3465daf4ed78376
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs683124
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 683124 - Add function to xpcshell-test harness to output info text. r=ted.mielczarek
testing/xpcshell/head.js
--- a/testing/xpcshell/head.js
+++ b/testing/xpcshell/head.js
@@ -383,16 +383,24 @@ function _load_files(aFiles) {
 
   aFiles.forEach(loadTailFile);
 }
 
 
 /************** Functions to be used from the tests **************/
 
 /**
+ * Prints a message to the output log.
+ */
+function do_print(msg) {
+  var caller_stack = Components.stack.caller;
+  _dump("TEST-INFO | " + caller_stack.filename + " | " + msg + "\n");
+}
+
+/**
  * Calls the given function at least the specified number of milliseconds later.
  * The callback will not undershoot the given time, but it might overshoot --
  * don't expect precision!
  *
  * @param delay : uint
  *   the number of milliseconds to delay
  * @param callback : function() : void
  *   the function to call