Esempio n. 1
0
 def _RunTest(self, new_file_path):
     input_api, output_api = self._PrepareTest(new_file_path)
     checker = StrictEnumValueChecker(input_api, output_api,
                                      self.START_MARKER, self.END_MARKER,
                                      self.MOCK_FILE_LOCAL_PATH)
     results = checker.Run()
     return results
Esempio n. 2
0
def _CreateHistogramValueChecker(input_api, output_api, path):
  original_sys_path = sys.path

  try:
    sys.path.append(input_api.os_path.join(
        input_api.PresubmitLocalPath(), '..', '..', 'tools',
        'strict_enum_value_checker'))
    from strict_enum_value_checker import StrictEnumValueChecker
  finally:
    sys.path = original_sys_path

  return StrictEnumValueChecker(input_api, output_api,
      start_marker='enum HistogramValue {', end_marker='  // Last entry:',
      path=path)
Esempio n. 3
0
def _CreateAPIPermissionIDChecker(input_api, output_api):
  original_sys_path = sys.path

  try:
    sys.path.append(input_api.os_path.join(
        input_api.PresubmitLocalPath(), '..', '..', '..', 'tools',
        'strict_enum_value_checker'))
    from strict_enum_value_checker import StrictEnumValueChecker
  finally:
    sys.path = original_sys_path

  return StrictEnumValueChecker(input_api, output_api,
      start_marker='  enum ID {', end_marker='    // Last entry:',
      path='extensions/common/permissions/api_permission.h')
Esempio n. 4
0
def _CreatePermissionMessageEnumChecker(input_api, output_api):
    original_sys_path = sys.path

    try:
        sys.path.append(
            input_api.os_path.join(input_api.PresubmitLocalPath(), '..', '..',
                                   '..', 'tools', 'strict_enum_value_checker'))
        from strict_enum_value_checker import StrictEnumValueChecker
    finally:
        sys.path = original_sys_path

    return StrictEnumValueChecker(
        input_api,
        output_api,
        start_marker='  enum ID {',
        end_marker='    kEnumBoundary',
        path='extensions/common/permissions/permission_message.h')