Bug 766319 - Minor perfdata refactor, r=jgriffin, DONTBUILD because NPOTB

This commit is contained in:
Malini Das 2012-06-19 17:17:40 -04:00
parent e742f5b11c
commit 2b57d0dfae
2 changed files with 5 additions and 11 deletions

View File

@ -23,6 +23,8 @@ class CommonTestCase(unittest.TestCase):
def __init__(self, methodName):
unittest.TestCase.__init__(self, methodName)
self.loglines = None
self.perfdata = None
def kill_gaia_app(self, url):
self.marionette.execute_script("""
@ -89,14 +91,13 @@ whitelist_prefs.forEach(function (pref) {
def setUp(self):
if self.marionette.session is None:
self.marionette.start_session()
self.loglines = None
self.perfdata = None
def tearDown(self):
if self.marionette.session is not None:
self.loglines = self.marionette.get_logs()
self.perfdata = self.marionette.get_perf_data()
self.marionette.delete_session()
class MarionetteTestCase(CommonTestCase):
def __init__(self, marionette, methodName='runTest', **kwargs):
@ -174,11 +175,6 @@ class MarionetteJSTestCase(CommonTestCase):
try:
results = self.marionette.execute_js_script(js, args)
self.loglines = self.marionette.get_logs()
self.perfdata = self.marionette.get_perf_data()
print "in marionette_test"
print self.perfdata
if launch_app:
self.kill_gaia_app(launch_app)
@ -200,8 +196,6 @@ class MarionetteJSTestCase(CommonTestCase):
if not self.perfdata:
self.assertTrue(results['passed'] + results['failed'] > 0,
'no tests run')
if self.marionette.session is not None:
self.marionette.delete_session()
except ScriptTimeoutException:
if 'timeout' in self.jsFile:

View File

@ -377,7 +377,7 @@ class MarionetteTestRunner(object):
if suite.countTestCases():
results = MarionetteTextTestRunner(verbosity=3).run(suite)
self.failed += len(results.failures) + len(results.errors)
if results.perfdata:
if results.perfdata and options.perf:
self.perfrequest.add_datazilla_result(results.perfdata)
if hasattr(results, 'skipped'):
self.todo += len(results.skipped) + len(results.expectedFailures)