Bug 1042963 - Only execute the first_error handler on test_status messages. r=Vaibhav

This commit is contained in:
Ahmed Kachkach 2014-07-28 11:44:00 +02:00
parent d35ca502b4
commit f9a5d00145

View File

@ -1916,7 +1916,7 @@ class Mochitest(MochitestUtilsMixin):
if message['action'] == 'test_start': #by default make the result key equal to pass.
key = message['test'].split('/')[-1].strip()
self.harness.result[key] = "PASS"
elif message['action'] in ['test_end', 'test_status']:
elif message['action'] == 'test_status':
if 'expected' in message:
key = message['test'].split('/')[-1].strip()
self.harness.result[key] = "FAIL"
@ -1926,10 +1926,10 @@ class Mochitest(MochitestUtilsMixin):
return message
def first_error(self, message):
if 'expected' in message and message['status'] == 'FAIL':
if message['action'] == 'test_status' and 'expected' in message and message['status'] == 'FAIL':
key = message['test'].split('/')[-1].strip()
if key not in self.harness.expectedError:
self.harness.expectedError[key] = message['message'].strip()
self.harness.expectedError[key] = message.get('message', message['subtest']).strip()
return message
def countline(self, message):