Exemplo n.º 1
0
 def finalize(self, test_methods_to_run):
   # Use the args as those of prepare to run remove_crx_at_exit_if_needed in
   # the same condition.
   args = self._build_launch_chrome_command(test_methods_to_run)
   parsed_args = launch_chrome_options.parse_args(args)
   # Removing the CRX is deferred in case this is running for the remote
   # execution, which needs to copy all the CRXs after all the suite runners
   # in the local host have finished.
   prep_launch_chrome.remove_crx_at_exit_if_needed(parsed_args)
Exemplo n.º 2
0
 def finalize(self, test_methods_to_run):
     # Use the args as those of prepare to run remove_crx_at_exit_if_needed in
     # the same condition.
     args = self._build_launch_chrome_command(test_methods_to_run)
     parsed_args = launch_chrome_options.parse_args(args)
     # Removing the CRX is deferred in case this is running for the remote
     # execution, which needs to copy all the CRXs after all the suite runners
     # in the local host have finished.
     prep_launch_chrome.remove_crx_at_exit_if_needed(parsed_args)
Exemplo n.º 3
0
def main():
  signal_util.setup()

  OPTIONS.parse_configure_file()

  parsed_args = launch_chrome_options.parse_args(sys.argv)
  logging_util.setup(
      level=logging.DEBUG if parsed_args.verbose else logging.INFO)

  _prepare_chrome_user_data_dir(parsed_args)
  global _CHROME_PID_PATH
  _CHROME_PID_PATH = os.path.join(_USER_DATA_DIR, 'chrome.pid')

  # If there is an X server at :0.0 and GPU is enabled, set it as the
  # current display.
  if parsed_args.display:
    os.environ['DISPLAY'] = parsed_args.display

  os.chdir(_ROOT_DIR)

  if not parsed_args.remote:
    _kill_running_chrome()

  if parsed_args.run_ninja:
    build_common.run_ninja()

  ld_library_path = os.environ.get('LD_LIBRARY_PATH')
  lib_paths = ld_library_path.split(':') if ld_library_path else []
  lib_paths.append(build_common.get_load_library_path())
  # Add the directory of the chrome binary so that .so files in the directory
  # can be loaded. This is needed for loading libudev.so.0.
  # TODO(crbug.com/375609): Remove the hack once it becomes no longer needed.
  lib_paths.append(os.path.dirname(_get_chrome_path(parsed_args)))
  os.environ['LD_LIBRARY_PATH'] = ':'.join(lib_paths)
  launch_chrome_util.set_environment_for_chrome()

  if not platform_util.is_running_on_remote_host():
    _check_apk_existence(parsed_args)

  if not platform_util.is_running_on_remote_host():
    prep_launch_chrome.prepare_crx(parsed_args)
  prep_launch_chrome.remove_crx_at_exit_if_needed(parsed_args)

  if parsed_args.remote:
    remote_executor.launch_remote_chrome(parsed_args, sys.argv[1:])
  else:
    platform_util.assert_machine(OPTIONS.target())
    _check_crx_existence(parsed_args)
    _run_chrome_iterations(parsed_args)

  return 0