def test_start(self):
   callback = MockCallback()
   parser = result_parser.JavaScriptTestResultParser(callback)
   parser.process_line(
       '[13748:13748:1202/184723.926074:INFO:CONSOLE(136)] '
       '"INFO: [ RUN      ] BackgroundPageTest.SendCrashReportsFromRelease", '
       'source: chrome-extension://dummy_hash_code/chrome_test.js (136)')
   self.assertEqual(
       [('start_test', 'BackgroundPageTest#SendCrashReportsFromRelease')],
       callback.result)
   self.assertFalse(parser.test_method_results)
    def run(self, test_methods_to_run, scoreboard):
        self._result_parser = result_parser.JavaScriptTestResultParser(
            scoreboard)

        args = self.get_launch_chrome_command(
            self._get_launch_chrome_options(),
            additional_metadata=self._get_additional_metadata(
                test_methods_to_run))
        try:
            self.run_subprocess(args)
        except subprocess.CalledProcessError:
            pass
  def test_success(self):
    callback = MockCallback()
    parser = result_parser.JavaScriptTestResultParser(callback)
    parser.process_line(
        '[13748:13748:1202/184723:INFO:CONSOLE(136)] '
        '"INFO: [       OK ] BackgroundPageTest.SendCrashReportsFromRelease '
        '(215ms)", source: chrome-extension://dummy_hash_code/chrome_test.js '
        '(136)')
    self.assertEqual(1, len(callback.result))
    self.assertEqual('update', callback.result[0][0])

    update_result = callback.result[0][1]
    self.assertEqual(1, len(update_result))
    self.assertEqual('BackgroundPageTest#SendCrashReportsFromRelease',
                     update_result[0].name)
    self.assertTrue(update_result[0].passed)
    self.assertAlmostEqual(0.215, update_result[0].duration)