def test_disable_xvfb(self): """Test disable xvfb.""" reproducer = reproducers.LinuxChromeJobReproducer( self.provider, self.testcase, 'UBSAN', True, '--test --disable-gl-drawing-for-tests', False) reproducer.setup_args() self.assertEqual('--repro --test %s' % self.testcase_path, reproducer.args)
def test_chromium(self): """Test chromium's reproduce_crash.""" self.mock.start_execute.return_value = mock.Mock() self.mock.__enter__.return_value = ':display' mocked_testcase = mock.Mock( id=1234, reproduction_args='--repro', environment={'ASAN_OPTIONS': 'test-asan'}, gestures=None, stacktrace_lines=[{ 'content': 'line' }], job_type='job_type') mocked_testcase.get_testcase_path.return_value = self.testcase_path mocked_provider = mock.Mock( symbolizer_path='%s/llvm-symbolizer' % self.app_directory) mocked_provider.get_binary_path.return_value = '%s/d8' % self.app_directory mocked_provider.get_build_dir_path.return_value = self.app_directory reproducer = reproducers.LinuxChromeJobReproducer( self.definition, mocked_provider, mocked_testcase, 'UBSAN', libs.make_options(target_args='--test')) reproducer.gestures = ['gesture,1', 'gesture,2'] reproducer.setup_args() err, text = reproducer.reproduce_crash() self.assertEqual(err, 0) self.assertEqual(text, 'symbolized') self.assert_exact_calls(self.mock.start_execute, [ mock.call( '/chrome/source/folder/d8', '--repro --test %s' % self.testcase_path, '/chrome/source/folder', env={ 'DISPLAY': ':display', 'ASAN_OPTIONS': 'test-asan', }, redirect_stderr_to_stdout=True, stdin=self.mock.UserStdin.return_value) ]) self.assert_exact_calls(self.mock.wait_execute, [ mock.call( self.mock.start_execute.return_value, exit_on_error=False, timeout=30, stdout_transformer=mock.ANY, read_buffer_length=1) ]) self.assert_exact_calls(self.mock.run_gestures, [ mock.call(reproducer, self.mock.start_execute.return_value, ':display') ])
def test_disable_xvfb(self): """Test disable xvfb.""" reproducer = reproducers.LinuxChromeJobReproducer( self.definition, self.provider, self.testcase, 'UBSAN', libs.make_options( disable_xvfb=True, target_args='--test --disable-gl-drawing-for-tests')) reproducer.setup_args() self.assertEqual('--repro --test %s' % self.testcase_path, reproducer.args)
def test_enable_xvfb(self): """Test disable xvfb.""" def edit(content, prefix, comment): # pylint: disable=unused-argument return '--new-argument' + ' ' + content self.mock.edit.side_effect = edit reproducer = reproducers.LinuxChromeJobReproducer( self.provider, self.testcase, 'UBSAN', False, '--test', True) reproducer.setup_args() self.assertEqual( '--new-argument --repro --test %s' % self.testcase_path, reproducer.args)
def test_enable_xvfb(self): """Test enable xvfb and edit args.""" def edit(content, prefix, comment): # pylint: disable=unused-argument return '--new-argument' + ' ' + content self.mock.edit.side_effect = edit reproducer = reproducers.LinuxChromeJobReproducer( self.definition, self.provider, self.testcase, 'UBSAN', libs.make_options(target_args='--test', edit_mode=True)) reproducer.setup_args() self.assertEqual( '--new-argument --repro --test %s' % self.testcase_path, reproducer.args)
def test_enable_xvfb(self): """Test enable xvfb and edit args.""" reproducer = reproducers.LinuxChromeJobReproducer( self.definition, self.provider, self.testcase, 'UBSAN', libs.make_options(target_args='--test', edit_mode=True)) reproducer.setup_args() self.assertEqual('--repro --test %s' % self.testcase_path, reproducer.args) self.mock.update_for_gdb_if_needed.assert_called_once_with( reproducer.binary_path, reproducer.args, reproducer.timeout, reproducer.options.enable_debug) self.mock.edit_if_needed.assert_called_once_with( reproducer.args, prefix=mock.ANY, comment=mock.ANY, should_edit=reproducer.options.edit_mode)
def test_disable_xvfb(self): """Test disable xvfb.""" reproducer = reproducers.LinuxChromeJobReproducer( self.definition, self.provider, self.testcase, 'UBSAN', libs.make_options( disable_xvfb=True, target_args='--test --disable-gl-drawing-for-tests')) reproducer.args = '--repro %TESTCASE_FILE_URL%' reproducer.setup_args() self.assertEqual('--repro %s --test' % self.testcase_path, reproducer.args) self.mock.update_for_gdb_if_needed.assert_called_once_with( reproducer.binary_path, reproducer.args, reproducer.timeout, reproducer.options.enable_debug) self.mock.edit_if_needed.assert_called_once_with( reproducer.args, prefix=mock.ANY, comment=mock.ANY, should_edit=reproducer.options.edit_mode)