def reproduce_crash(self): """Reproduce crash on Android.""" android.reset(self.testcase.android_package_name) android.reboot() android.ensure_active() android.clear_log() ret_value, _ = android.adb_shell( 'am start -a android.intent.action.MAIN ' "-n {package_name}/{class_name} '{testcase_url}'".format( package_name=self.testcase.android_package_name, class_name=self.testcase.android_main_class_name, testcase_url=self.get_testcase_url()), redirect_stderr_to_stdout=True, stdout_transformer=output_transformer.Identity()) time.sleep(TEST_TIMEOUT) run_monkey_gestures_if_needed(self.testcase.android_package_name, self.testcase.gestures) output = android.get_log() android.kill(self.testcase.android_package_name) lib_tmp_dir_path = tempfile.mkdtemp(dir=common.CLUSTERFUZZ_TMP_DIR) symbolized_output = symbolize( output=android.fix_lib_path( content=android.filter_log(output), search_paths=[ self.binary_provider.get_unstripped_lib_dir_path(), self.binary_provider.get_android_libclang_dir_path() ], lib_tmp_dir_path=lib_tmp_dir_path), source_dir_path=self.binary_provider.get_source_dir_path()) common.delete_if_exists(lib_tmp_dir_path) return ret_value, symbolized_output
def pre_build_steps(self): """Pre-build step.""" # Ensure that the user sets ANDROID_SERIAL. Because adb uses it. device_id = self.get_device_id() android.ensure_root_and_remount() android.ensure_active() android.ensure_asan(android_libclang_dir_path=( self.binary_provider.get_android_libclang_dir_path()), device_id=device_id) super(AndroidChromeReproducer, self).pre_build_steps() for path, content in self.testcase.files.iteritems(): android.write_content(path, content) android.write_content(self.testcase.command_line_file_path, 'chrome %s' % self.args) self.install()