示例#1
0
def _compute_chrome_params(parsed_args):
  chrome_path = _get_chrome_path(parsed_args)
  params = [chrome_path]

  if parsed_args.mode in ('perftest', 'atftest'):
    # Do not show the New Tab Page because showing NTP during perftest makes the
    # benchmark score look unnecessarily bad.
    # TODO(crbug.com/315356): Remove the IF once 315356 is fixed.
    params.append('about:blank')
    # Append flags for performance measurement in test modes to stabilize
    # integration tests and perf score. Do not append these flags in run mode
    # because apps that depend on component extensions (e.g. Files.app) will not
    # work with these flags.
    params.extend(_compute_chrome_performance_test_params(parsed_args))
    # Make the window size small on Goobuntu so that it does not cover the whole
    # desktop during perftest/integration_test.
    params.append('--window-size=500,500')

  if parsed_args.lang:
    params.append('--lang=' + parsed_args.lang)
    # LANGUAGE takes priority over --lang option in Linux.
    os.environ['LANGUAGE'] = parsed_args.lang
    # In Mac, there is no handy way to change the locale.
    if platform_util.is_running_on_mac():
      print '\nWARNING: --lang is not supported in Mac.'

  if (parsed_args.mode == 'atftest' and
      not platform_util.is_running_on_chromeos() and
      not platform_util.is_running_on_mac()):
    # This launches ARC without creating a browser window.  We only do it for
    # automated tests, in case the user wants to do something like examine the
    # Chromium settings ("about:flags" for example), which requires using the
    # browser window. Note that this does not work on Mac, and should be
    # unnecessary on a remote Chromebook target.
    params.append('--silent-launch')

  params.extend(_compute_chrome_plugin_params(parsed_args))
  params.extend(_compute_chrome_sandbox_params(parsed_args))
  params.extend(_compute_chrome_graphics_params(parsed_args))
  params.extend(_compute_chrome_debugging_params(parsed_args))
  diagnostic_params, diagnostic_params_startwith = (
      _compute_chrome_diagnostic_params(parsed_args))
  params.extend(diagnostic_params)
  params = diagnostic_params_startwith + params
  remote_executor.maybe_extend_remote_host_chrome_params(parsed_args, params)

  params.append(
      '--load-and-launch-app=' +
      remote_executor.resolve_path(parsed_args.arc_data_dir))

  # This prevents Chrome to add icon to Gnome panel, which current leaks memory.
  # See http://crbug.com/341724 for details.
  params.append('--disable-background-mode')

  if parsed_args.chrome_args:
    params.extend(parsed_args.chrome_args)

  return params
示例#2
0
def _compute_chrome_plugin_params(parsed_args):
  params = []
  params.append(
      '--load-extension=' +
      remote_executor.resolve_path(build_common.get_runtime_out_dir()))

  # Do not use user defined data directory if user name for remote host is
  # provided. The mounted cryptohome directory is used instead.
  if not parsed_args.login_user:
    params.append(
        '--user-data-dir=' + remote_executor.resolve_path(_USER_DATA_DIR))

  # Force-enable nonsfi mode on targets that do not allow it by default
  # (for example, non-ChromeOS Linux) for testing purposes.
  if (OPTIONS.is_bare_metal_build() and
      not platform_util.is_running_on_chromeos()):
    params.append('--enable-nacl-nonsfi-mode')

  return params