Exemple #1
0
 def testCheckDocsChanges_NoGeneratedFiles(self):
     input_api = FakeInputApi(affected_files=[
         FakeAffectedFile(
             local_path='chrome/common/extensions/api/foo.json'),
         FakeAffectedFile(
             local_path='chrome/common/extensions/docs/examples/foo/b/bz.js'
         ),
         FakeAffectedFile(
             local_path='chrome/common/extensions/docs/static/foo.html')
     ])
     expected_warning = (
         'This change modifies the extension docs but the generated docs '
         'have not been updated properly. See %s for more info.\n'
         ' - Changes to %s not reflected in generated doc.\n'
         ' - Changes to sample %s have not been re-zipped.\n'
         ' - Docs out of sync with %s changes.\n'
         'First build DumpRenderTree, then update the docs by running:\n  %s'
         %
         (os.path.normpath('chrome/common/extensions/docs/README.txt'),
          os.path.normpath('chrome/common/extensions/docs/static/foo.html'),
          os.path.normpath(
              'chrome/common/extensions/docs/examples/foo/b/bz.js'),
          os.path.normpath('chrome/common/extensions/api/foo.json'),
          os.path.normpath('chrome/common/extensions/docs/build/build.py')))
     self.assertEqual([expected_warning],
                      PRESUBMIT.CheckDocChanges(input_api, self.output_api))
Exemple #2
0
 def testCheckDocsChanges_OnlyExcpetions(self):
     input_api = FakeInputApi(affected_files=[
         FakeAffectedFile(
             local_path='chrome/common/extensions/docs/README'),
         FakeAffectedFile(local_path='chrome/common/extensions/docs/OWNERS')
     ])
     self.assertEqual([],
                      PRESUBMIT.CheckDocChanges(input_api, self.output_api))
Exemple #3
0
 def testCheckDocsChanges_OnlyGeneratedDocs(self):
     input_api = FakeInputApi(affected_files=[
         FakeAffectedFile(
             local_path='chrome/common/extensions/docs/foo.html'),
         FakeAffectedFile(
             local_path='chrome/common/extensions/docs/bar.html')
     ])
     expected_warning = (
         'This change modifies the extension docs but the generated docs '
         'have not been updated properly. See %s for more info.\n'
         ' - Changes to generated doc %s not reflected in non-generated files.\n'
         ' - Changes to generated doc %s not reflected in non-generated files.\n'
         'First build DumpRenderTree, then update the docs by running:\n  %s'
         %
         (os.path.normpath('chrome/common/extensions/docs/README.txt'),
          os.path.normpath('chrome/common/extensions/docs/bar.html'),
          os.path.normpath('chrome/common/extensions/docs/foo.html'),
          os.path.normpath('chrome/common/extensions/docs/build/build.py')))
     self.assertEqual([expected_warning],
                      PRESUBMIT.CheckDocChanges(input_api, self.output_api))
Exemple #4
0
 def testCheckDocsChanges_NoFiles(self):
     input_api = FakeInputApi(affected_files=[])
     self.assertEqual([],
                      PRESUBMIT.CheckDocChanges(input_api, self.output_api))