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 76661 f9c574a28a7a33a63fcc80ffbac9ab65d552c92b
parent 76660 c5aa67488400c90644d4fbbbaad34e96ed403701
child 76662 02f42784ccb28b942b345d44d3465daf4ed78376
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersted
bugs683124
milestone9.0a1
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