'Handle the results of the js tests by either converting them
with the results adapter or checking for a failure list.'

def handle_js_results(self, results):

    if self.results_adapter:
        self.results_adapter.convert(results, self)
    else:
        js_test_results = json.loads(results)
        failures = js_test_results['failures']
        assert (len(failures) == 0), (('%d    assertions    failed    in    the    headless    browser    tests' % len(failures)) + '    (see    the    log    for    details)')
