chrome/PRESUBMIT.py
def _CheckNoContentUnitTestsInChrome(input_api, output_api):
  """Makes sure that no unit tests from content/ are included in unit_tests."""
  problems = []
  for f in input_api.AffectedFiles():
    if not f.LocalPath().endswith('BUILD.gn'):
      continue

    for line_num, line in f.ChangedContents():
      m = re.search(r"'(.*\/content\/.*unittest.*)'", line)
      if m:
        problems.append(m.group(1))

  if not problems:
    return []
  return [output_api.PresubmitPromptWarning(
      'Unit tests located in content/ should be added to the ' +
      'content_unittests target.',
      items=problems)]
Makes sure that no unit tests from content/ are included in unit_tests.
Makes sure that no unit tests from content/ are included in unit_tests.
Makes sure that no unit tests from content / are included in unit_tests .
def _CheckNoContentUnitTestsInChrome(input_api, output_api):
  problems = []
  for f in input_api.AffectedFiles():
    if not f.LocalPath().endswith('BUILD.gn'):
      continue
    for line_num, line in f.ChangedContents():
      m = re.search(r"'(.*\/content\/.*unittest.*)'", line)
      if m:
        problems.append(m.group(1))
  if not problems:
    return []
  return [output_api.PresubmitPromptWarning(
      'Unit tests located in content/ should be added to the ' +
      'content_unittests target.',
      items=problems)]
def _CheckNoContentUnitTestsInChrome ( input_api , output_api ) : problems = [ ] for f in input_api . AffectedFiles ( ) : if not f . LocalPath ( ) . endswith ( 'BUILD.gn' ) : continue for line_num , line in f . ChangedContents ( ) : m = re . search ( r"'(.*\/content\/.*unittest.*)'" , line ) if m : problems . append ( m . group ( 1 ) ) if not problems : return [ ] return [ output_api . PresubmitPromptWarning ( 'Unit tests located in content/ should be added to the ' + 'content_unittests target.' , items = problems ) ]
Makes sure that no unit tests from content/ are included in unit_tests.
Makes sure that no unit tests from content / are included in unit_tests .
"""Makes sure that no unit tests from content/ are included in unit_tests."""
input_api
output_api