android_webview/javatests/PRESUBMIT.py
def _CheckNoSkipCommandLineAnnotation(input_api, output_api):
  """Checks that tests do not add @SkipCommandLineParameterization annotation.
  This was previously used to run the test in single-process-mode only (or,
  multi-process-mode only if used with
  @CommandLineFlags.Add(AwSwitches.WEBVIEW_SANDBOXED_RENDERER)). This is
  obsolete because we have dedicated annotations (@OnlyRunInSingleProcessMode
  and @OnlyRunInMultiProcessMode).
  """

  skip_command_line_annotation = input_api.re.compile(
      r'^\s*@SkipCommandLineParameterization.*$')

  errors = []

  def _FilterFile(affected_file):
    return input_api.FilterSourceFile(
        affected_file,
        files_to_skip=input_api.DEFAULT_FILES_TO_SKIP,
        files_to_check=[r'.*\.java$'])

  for f in input_api.AffectedSourceFiles(_FilterFile):
    for line_num, line in f.ChangedContents():
      match = skip_command_line_annotation.search(line)
      if match:
        errors.append("%s:%d" % (f.LocalPath(), line_num))

  results = []

  if errors:
    results.append(output_api.PresubmitPromptWarning("""
android_webview/javatests/ should not use @SkipCommandLineParameterization to
run in either multi-process or single-process only. Instead, use @OnlyRunIn.
""", errors))

  return results
Checks that tests do not add @SkipCommandLineParameterization annotation.
  This was previously used to run the test in single-process-mode only (or,
  multi-process-mode only if used with
  @CommandLineFlags.Add(AwSwitches.WEBVIEW_SANDBOXED_RENDERER)). This is
  obsolete because we have dedicated annotations (@OnlyRunInSingleProcessMode
  and @OnlyRunInMultiProcessMode).
  
Checks that tests do not add @SkipCommandLineParameterization annotation.
This was previously used to run the test in single-process-mode only (or,
multi-process-mode only if used with
@CommandLineFlags.Add(AwSwitches.WEBVIEW_SANDBOXED_RENDERER)). This is
obsolete because we have dedicated annotations (@OnlyRunInSingleProcessMode
and @OnlyRunInMultiProcessMode).
Checks that tests do not add @SkipCommandLineParameterization annotation . This was previously used to run the test in single - process - mode only ( or multi - process - mode only if used with @CommandLineFlags . Add ( AwSwitches . WEBVIEW_SANDBOXED_RENDERER )) . This is obsolete because we have dedicated annotations ( @OnlyRunInSingleProcessMode and @OnlyRunInMultiProcessMode ) .
def _CheckNoSkipCommandLineAnnotation(input_api, output_api):
  skip_command_line_annotation = input_api.re.compile(
      r'^\s*@SkipCommandLineParameterization.*$')
  errors = []
  def _FilterFile(affected_file):
    return input_api.FilterSourceFile(
        affected_file,
        files_to_skip=input_api.DEFAULT_FILES_TO_SKIP,
        files_to_check=[r'.*\.java$'])
  for f in input_api.AffectedSourceFiles(_FilterFile):
    for line_num, line in f.ChangedContents():
      match = skip_command_line_annotation.search(line)
      if match:
        errors.append("%s:%d" % (f.LocalPath(), line_num))
  results = []
  if errors:
    results.append(output_api.PresubmitPromptWarning("""
android_webview/javatests/ should not use @SkipCommandLineParameterization to
run in either multi-process or single-process only. Instead, use @OnlyRunIn.
""", errors))
  return results
def _CheckNoSkipCommandLineAnnotation ( input_api , output_api ) : skip_command_line_annotation = input_api . re . compile ( r'^\s*@SkipCommandLineParameterization.*$' ) errors = [ ] def _FilterFile ( affected_file ) : return input_api . FilterSourceFile ( affected_file , files_to_skip = input_api . DEFAULT_FILES_TO_SKIP , files_to_check = [ r'.*\.java$' ] ) for f in input_api . AffectedSourceFiles ( _FilterFile ) : for line_num , line in f . ChangedContents ( ) : match = skip_command_line_annotation . search ( line ) if match : errors . append ( "%s:%d" % ( f . LocalPath ( ) , line_num ) ) results = [ ] if errors : results . append ( output_api . PresubmitPromptWarning ( """
android_webview/javatests/ should not use @SkipCommandLineParameterization to
run in either multi-process or single-process only. Instead, use @OnlyRunIn.
""" , errors ) ) return results
Checks that tests do not add @SkipCommandLineParameterization annotation.
Checks that tests do not add @SkipCommandLineParameterization annotation .
"""Checks that tests do not add @SkipCommandLineParameterization annotation.
  This was previously used to run the test in single-process-mode only (or,
  multi-process-mode only if used with
  @CommandLineFlags.Add(AwSwitches.WEBVIEW_SANDBOXED_RENDERER)). This is
  obsolete because we have dedicated annotations (@OnlyRunInSingleProcessMode
  and @OnlyRunInMultiProcessMode).
  """
input_api
output_api