Bug 1059381 - Implement SimpleTest.requestCompleteLog for mochitest browser. r=jmaher
authorChris Manchester <cmanchester@mozilla.com>
Wed, 03 Sep 2014 11:25:18 -0400
changeset 203274 869d64f8ab6cab793226803df56edc68e7e9ec6d
parent 203273 2d687e266e656206c2cae6645c2e76d9e163d81d
child 203275 b7d2c160e1f01470620cbd031842994e2067225c
push id48650
push userryanvm@gmail.com
push dateWed, 03 Sep 2014 17:23:48 +0000
treeherdermozilla-inbound@b7d2c160e1f0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1059381
milestone35.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 1059381 - Implement SimpleTest.requestCompleteLog for mochitest browser. r=jmaher
testing/mochitest/browser-test.js
testing/mochitest/tests/browser/browser_pass.js
--- a/testing/mochitest/browser-test.js
+++ b/testing/mochitest/browser-test.js
@@ -20,17 +20,17 @@ XPCOMUtils.defineLazyModuleGetter(this, 
 
 XPCOMUtils.defineLazyModuleGetter(this, "CustomizationTabPreloader",
   "resource:///modules/CustomizationTabPreloader.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "ContentSearch",
   "resource:///modules/ContentSearch.jsm");
 
 const SIMPLETEST_OVERRIDES =
-  ["ok", "is", "isnot", "ise", "todo", "todo_is", "todo_isnot", "info", "expectAssertions"];
+  ["ok", "is", "isnot", "ise", "todo", "todo_is", "todo_isnot", "info", "expectAssertions", "requestCompleteLog"];
 
 window.addEventListener("load", function testOnLoad() {
   window.removeEventListener("load", testOnLoad);
   window.addEventListener("MozAfterPaint", function testOnMozAfterPaint() {
     window.removeEventListener("MozAfterPaint", testOnMozAfterPaint);
     setTimeout(testInit, 0);
   });
 });
@@ -903,16 +903,23 @@ function testScope(aTester, aTest) {
         if (self.__done && self.__waitTimer) {
           clearTimeout(self.__waitTimer);
           self.__waitTimer = null;
           self.__tester.nextTest();
         }
       });
     }
   };
+
+  this.requestCompleteLog = function test_requestCompleteLog() {
+    self.__tester.dumper.structuredLogger.deactivateBuffering();
+    self.registerCleanupFunction(function() {
+      self.__tester.dumper.structuredLogger.activateBuffering();
+    })
+  };
 }
 testScope.prototype = {
   __done: true,
   __generator: null,
   __tasks: null,
   __waitTimer: null,
   __cleanupFunctions: [],
   __timeoutFactor: 1,
--- a/testing/mochitest/tests/browser/browser_pass.js
+++ b/testing/mochitest/tests/browser/browser_pass.js
@@ -1,9 +1,10 @@
 function test() {
+  SimpleTest.requestCompleteLog();
   ok(true, "pass ok");
   is(true, true, "pass is");
   isnot(false, true, "pass isnot");
   ise(true, true, "pass ise");
   todo(false, "pass todo");
   todo_is(false, true, "pass todo_is");
   todo_isnot(true, true, "pass todo_isnot");
   info("info message");