Bug 723207: fix SimpleTest.info when called as just info(), r=jmaher
authorGavin Sharp <gavin@gavinsharp.com>
Wed, 01 Feb 2012 10:11:53 -0800
changeset 86158 c831b760a443107c156143cacf129cc59937b20a
parent 86157 1fc8e624ab139aa371f759bd37a127db5663d714
child 86159 67b3f65dd019296f461de9429f0d7bf5bd9e64f1
push id21997
push usermak77@bonardo.net
push dateSat, 04 Feb 2012 10:21:04 +0000
treeherdermozilla-central@948fe2e7f1d5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs723207
milestone13.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 723207: fix SimpleTest.info when called as just info(), r=jmaher
docshell/test/chrome/test_principalInherit.xul
testing/mochitest/chrome/test_sanityChromeUtils.xul
testing/mochitest/chrome/test_sanityPluginUtils.html
testing/mochitest/tests/SimpleTest/SimpleTest.js
testing/mochitest/tests/test_SpecialPowersExtension.html
testing/mochitest/tests/test_sanityEventUtils.html
testing/mochitest/tests/test_sanitySimpletest.html
testing/mochitest/tests/test_sanityWindowSnapshot.html
--- a/docshell/test/chrome/test_principalInherit.xul
+++ b/docshell/test/chrome/test_principalInherit.xul
@@ -92,17 +92,17 @@ function loadListener(target, func) {
     func();
   }, true);
 }
 
 function nextTest() {
   if (tests.length) {
     let test = tests.shift();
     SimpleTest.executeSoon(function () {
-      SimpleTest.info("running " + test.name);
+      info("running " + test.name);
       test(nextTest);
     });
   } else
     SimpleTest.executeSoon(SimpleTest.finish);
 }
 
 ]]>
 </script>
--- a/testing/mochitest/chrome/test_sanityChromeUtils.xul
+++ b/testing/mochitest/chrome/test_sanityChromeUtils.xul
@@ -46,17 +46,17 @@
   var start = new Date();
   </script>
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/ChromeUtils.js"></script>
   <script type="text/javascript">
   var loadTime = new Date();
   </script>
   <script type="application/javascript">
   <![CDATA[
-    SimpleTest.info("\nProfile::ChromeUtilsLoadTime: " + (loadTime - start) + "\n");
+    info("\nProfile::ChromeUtilsLoadTime: " + (loadTime - start) + "\n");
     var testFile = Components.classes["@mozilla.org/file/directory_service;1"].
                       getService(Components.interfaces.nsIProperties).
                       get("CurWorkD", Components.interfaces.nsIFile);
     var regularDtForDrag1 = null;
     var gSetDropEffect = true;
     var gData;
     var gEnter = false;
     var gOver  = false;
@@ -191,17 +191,17 @@
       ok(content, "synthesizeCharAtPoint should not be null");
       ok(content.succeeded, "synthesizeCharAtPoint should succeed");
 
       content = synthesizeSelectionSet(0, 100);
       ok(content, "synthesizeSelectionSet should not be null");
       is(content, true, "synthesizeSelectionSet should succeed");
 
       var endTime = new Date();
-      SimpleTest.info("\nProfile::ChromeUtilsRunTime: " + (endTime-startTime) + "\n");
+      info("\nProfile::ChromeUtilsRunTime: " + (endTime-startTime) + "\n");
       SimpleTest.finish();
     };
   ]]>
   </script>
 
   <body xmlns="http://www.w3.org/1999/xhtml" onload="setTimeout('test()', 0)">
     <input id="textB" value="I haz a content"/>
     <p id="display"></p>
--- a/testing/mochitest/chrome/test_sanityPluginUtils.html
+++ b/testing/mochitest/chrome/test_sanityPluginUtils.html
@@ -10,29 +10,29 @@
   </script>
   <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 </head>
 <body onload="starttest()">
 <!-- load the test plugin defined at $(DIST)/bin/plugins/Test.plugin/ -->
 <embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
 <script class="testbody" type="text/javascript">
-SimpleTest.info("\nProfile::PluginUtilsLoadTime: " + (loadTime - start) + "\n");
+info("\nProfile::PluginUtilsLoadTime: " + (loadTime - start) + "\n");
 function starttest() {
   SimpleTest.waitForExplicitFinish();
   var startTime = new Date();
   //increase the runtime of the test so it is detectible, otherwise we get 0-1ms
   runtimes = 100;
   function runTest(plugin) {
     is(plugin.version, "1.0.0.0", "Make sure version is correct");
     is(plugin.name, "Test Plug-in");
   };
   while (runtimes > 0) {
     ok(PluginUtils.withTestPlugin(runTest), "Test plugin should be found");
     --runtimes;
   }
   var endTime = new Date();
-  SimpleTest.info("\nProfile::PluginUtilsRunTime: " + (endTime-startTime) + "\n");
+  info("\nProfile::PluginUtilsRunTime: " + (endTime-startTime) + "\n");
   SimpleTest.finish();
 };
 </script>
 </body>
 </html>
--- a/testing/mochitest/tests/SimpleTest/SimpleTest.js
+++ b/testing/mochitest/tests/SimpleTest/SimpleTest.js
@@ -279,17 +279,17 @@ SimpleTest._logResult = function(test, p
             parentRunner.log(msg);
         }
     } else {
         dump(msg + "\n");
     }
 };
 
 SimpleTest.info = function(name, message) {
-    this._logResult({result:true, name:name, diag:message}, "TEST-INFO");
+    SimpleTest._logResult({result:true, name:name, diag:message}, "TEST-INFO");
 };
 
 /**
  * Copies of is and isnot with the call to ok replaced by a call to todo.
 **/
 
 SimpleTest.todo_is = function (a, b, name) {
     var pass = (a == b);
--- a/testing/mochitest/tests/test_SpecialPowersExtension.html
+++ b/testing/mochitest/tests/test_SpecialPowersExtension.html
@@ -129,16 +129,16 @@ function starttest(){
   noxray.__proto__ = noxray_proto;
   var noxray_wrapper = SpecialPowers.wrap(noxray);
   is(noxray_wrapper.c, 32, "Regular properties should work.");
   is(noxray_wrapper.a, 5, "Shadow properties should work.");
   is(noxray_wrapper.b, 12, "Proto properties should work.");
   noxray.b = 122;
   is(noxray_wrapper.b, 122, "Should be able to shadow.");
 
-  SimpleTest.info("\nProfile::SpecialPowersRunTime: " + (new Date() - startTime) + "\n");
+  info("\nProfile::SpecialPowersRunTime: " + (new Date() - startTime) + "\n");
   SimpleTest.finish();
 }
 </script>
 </pre>
 </body>
 </html>
 
--- a/testing/mochitest/tests/test_sanityEventUtils.html
+++ b/testing/mochitest/tests/test_sanityEventUtils.html
@@ -25,17 +25,17 @@
 <p>blah blah blah blah</p>
 <p>blah blah blah blah</p>
 <p>blah blah blah blah</p>
 <p>blah blah blah blah</p>
 <p>blah blah blah blah</p>
 <p>blah blah blah blah</p>
 </div>
 <script class="testbody" type="text/javascript">
-SimpleTest.info("\nProfile::EventUtilsLoadTime: " + (loadTime - start) + "\n");
+info("\nProfile::EventUtilsLoadTime: " + (loadTime - start) + "\n");
 function starttest() {
   SimpleTest.waitForFocus(
     function () {
       SimpleTest.waitForExplicitFinish();
       var startTime = new Date();
       var check = false;
       
       /* test send* functions */
@@ -159,16 +159,16 @@ function starttest() {
       querySelectedText = synthesizeQuerySelectedText();
       ok(querySelectedText, "query selected text event result is null");
       ok(querySelectedText.succeeded, "query selected text event failed");
       is(querySelectedText.offset, 0,
          "query selected text event returns wrong offset");
       is(querySelectedText.text, "",
          "query selected text event returns wrong selected text");
       var endTime = new Date();
-      SimpleTest.info("\nProfile::EventUtilsRunTime: " + (endTime-startTime) + "\n");
+      info("\nProfile::EventUtilsRunTime: " + (endTime-startTime) + "\n");
       SimpleTest.finish();
     }
   );
 };
 </script>
 </body>
 </html>
--- a/testing/mochitest/tests/test_sanitySimpletest.html
+++ b/testing/mochitest/tests/test_sanitySimpletest.html
@@ -10,24 +10,24 @@
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
   <script type="text/javascript">
   var loadTime = new Date();
   </script>
 </head>
 <body>
 <input id="textB"/>
 <script class="testbody" type="text/javascript">
-SimpleTest.info("Profile::SimpleTestLoadTime: " + (loadTime - start));
+info("Profile::SimpleTestLoadTime: " + (loadTime - start));
 var startTime = new Date();
 SimpleTest.waitForExplicitFinish();
 function starttest() {
   SimpleTest.waitForFocus(
     function() {
       //test log
-      SimpleTest.info("Logging some info")
+      info("Logging some info")
     
       //basic usage
       ok(true, "test ok", "This should be true");
       is(0, 0, "is() test failed");
       isnot(0, 1, "isnot() test failed");
     
       //todo tests
       todo(false, "test todo", "todo() test should not pass");
@@ -70,17 +70,17 @@ function starttest() {
 
       //note: this also adds a short wait period
       SimpleTest.executeSoon(
         function () {
           //finish() calls a slew of SimpleTest functions
           SimpleTest.finish();
           //call this after finish so we can make sure it works and doesn't hang our process
           var endTime = new Date();
-          SimpleTest.info("Profile::SimpleTestRunTime: " + (endTime-startTime));
+          info("Profile::SimpleTestRunTime: " + (endTime-startTime));
           //expect and throw exception here. Otherwise, any code that follows the throw call will never be executed
           SimpleTest.expectUncaughtException();
           //make sure we catch this error
           throw "i am an uncaught exception"
         }
       );
     }
   );
--- a/testing/mochitest/tests/test_sanityWindowSnapshot.html
+++ b/testing/mochitest/tests/test_sanityWindowSnapshot.html
@@ -9,27 +9,27 @@
   <script type="text/javascript">
   var loadTime = new Date();
   </script>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body onload="starttest()">
 <script class="testbody" type="text/javascript">
-SimpleTest.info("\nProfile::WindowSnapshotLoadTime: " + (loadTime - start) + "\n");
+info("\nProfile::WindowSnapshotLoadTime: " + (loadTime - start) + "\n");
 function starttest() {
   SimpleTest.waitForExplicitFinish();
   var startTime = new Date();
   var snap = snapshotWindow(window, false);
   var snap2 = snapshotWindow(window, false);
   is(compareSnapshots(snap, snap2, true)[0], true, "this should be true");
   var div1 = createEl('div', {'id': 'somediv', 'display': 'block'}, "I am a div");
   document.body.appendChild(div1);
   snap2 = snapshotWindow(window, false);
   is(compareSnapshots(snap, snap2, true)[0], false, "this should be false");
   document.body.removeChild(div1);
   var endTime = new Date();
-  SimpleTest.info("\nProfile::WindowSnapshotRunTime: " + (endTime-startTime) + "\n");
+  info("\nProfile::WindowSnapshotRunTime: " + (endTime-startTime) + "\n");
   SimpleTest.finish();
 };
 </script>
 </body>
 </html>