Bug 857607 - Reduce log level when launching B2G desktop client with mozrunner. r=jgriffin, a=test-only
authorDave Hunt <dhunt@mozilla.com>
Tue, 16 Apr 2013 22:35:07 +0100
changeset 119082 30dea6c6bedfa89a3dc8a5a9d3d45c1ed985b645
parent 119081 0c52884c661af5d2613f1edfd8299ce08b6d1256
child 119083 b81fce68ef67f2c354cd3a27aea678b2f1c03837
push id677
push userdhunt@mozilla.com
push dateWed, 17 Apr 2013 17:20:08 +0000
reviewersjgriffin, test-only
bugs857607
milestone18.0
Bug 857607 - Reduce log level when launching B2G desktop client with mozrunner. r=jgriffin, a=test-only
testing/marionette/client/marionette/geckoinstance.py
--- a/testing/marionette/client/marionette/geckoinstance.py
+++ b/testing/marionette/client/marionette/geckoinstance.py
@@ -1,12 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/
 
+import os
+
 from mozprofile import Profile
 from mozrunner import Runner
 
 
 class GeckoInstance(object):
 
     required_prefs = {"marionette.defaultPrefs.enabled": True,
                       "marionette.defaultPrefs.port": 2828,
@@ -23,20 +25,23 @@ class GeckoInstance(object):
         profile_path = self.profile
         profile_args = {"preferences": self.required_prefs}
         if not profile_path:
             runner_class = Runner
             profile_args["restore"] = False
         else:
             runner_class = CloneRunner
             profile_args["path_from"] = profile_path
-        print "starting runner"
-        self.runner = runner_class.create(binary=self.bin,
-                                         profile_args=profile_args,
-                                         cmdargs=['-no-remote'])
+        self.runner = runner_class.create(
+            binary=self.bin,
+            profile_args=profile_args,
+            cmdargs=['-no-remote'],
+            kp_kwargs={
+                'processOutputLine': [NullOutput()],
+                'logfile': os.path.abspath('gecko.log')})
         self.runner.start()
 
     def close(self):
         self.runner.stop()
         self.runner.cleanup()
 
 
 class B2GDesktopInstance(GeckoInstance):
@@ -44,8 +49,14 @@ class B2GDesktopInstance(GeckoInstance):
     required_prefs = {"focusmanager.testmode": True}
 
 apps = {'b2gdesktop': B2GDesktopInstance}
 
 
 class CloneRunner(Runner):
 
     profile_class = Profile.clone
+
+
+class NullOutput(object):
+
+    def __call__(self, line):
+        pass