summaryrefslogtreecommitdiff
path: root/chromium/PRESUBMIT_test.py
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-01-20 13:40:20 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-01-22 12:41:23 +0000
commit7961cea6d1041e3e454dae6a1da660b453efd238 (patch)
treec0eeb4a9ff9ba32986289c1653d9608e53ccb444 /chromium/PRESUBMIT_test.py
parentb7034d0803538058e5c9d904ef03cf5eab34f6ef (diff)
downloadqtwebengine-chromium-7961cea6d1041e3e454dae6a1da660b453efd238.tar.gz
BASELINE: Update Chromium to 78.0.3904.130
Change-Id: If185e0c0061b3437531c97c9c8c78f239352a68b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/PRESUBMIT_test.py')
-rwxr-xr-xchromium/PRESUBMIT_test.py47
1 files changed, 47 insertions, 0 deletions
diff --git a/chromium/PRESUBMIT_test.py b/chromium/PRESUBMIT_test.py
index 6e32dd42d71..847f17a7396 100755
--- a/chromium/PRESUBMIT_test.py
+++ b/chromium/PRESUBMIT_test.py
@@ -968,6 +968,15 @@ class IncludeGuardTest(unittest.TestCase):
'struct SomeFileFoo;',
'#endif // REQUIRED_RPCNDR_H_',
]),
+ # Not having proper include guard in *_message_generator.h
+ # for old IPC messages is allowed.
+ MockAffectedFile('content/common/content_message_generator.h', [
+ '#undef CONTENT_COMMON_FOO_MESSAGES_H_',
+ '#include "content/common/foo_messages.h"',
+ '#ifndef CONTENT_COMMON_FOO_MESSAGES_H_',
+ '#error "Failed to include content/common/foo_messages.h"',
+ '#endif',
+ ]),
]
msgs = PRESUBMIT._CheckForIncludeGuards(
mock_input_api, mock_output_api)
@@ -2459,5 +2468,43 @@ class BuildtoolsRevisionsAreInSyncTest(unittest.TestCase):
self.assertNotEqual(results, [])
+class CheckFuzzTargetsTest(unittest.TestCase):
+
+ def _check(self, files):
+ mock_input_api = MockInputApi()
+ mock_input_api.files = []
+ for fname, contents in files.items():
+ mock_input_api.files.append(MockFile(fname, contents.splitlines()))
+ return PRESUBMIT._CheckFuzzTargets(mock_input_api, MockOutputApi())
+
+ def testLibFuzzerSourcesIgnored(self):
+ results = self._check({
+ "third_party/lib/Fuzzer/FuzzerDriver.cpp": "LLVMFuzzerInitialize",
+ })
+ self.assertEqual(results, [])
+
+ def testNonCodeFilesIgnored(self):
+ results = self._check({
+ "README.md": "LLVMFuzzerInitialize",
+ })
+ self.assertEqual(results, [])
+
+ def testNoErrorHeaderPresent(self):
+ results = self._check({
+ "fuzzer.cc": (
+ "#include \"testing/libfuzzer/libfuzzer_exports.h\"\n" +
+ "LLVMFuzzerInitialize"
+ )
+ })
+ self.assertEqual(results, [])
+
+ def testErrorMissingHeader(self):
+ results = self._check({
+ "fuzzer.cc": "LLVMFuzzerInitialize"
+ })
+ self.assertEqual(len(results), 1)
+ self.assertEqual(results[0].items, ['fuzzer.cc'])
+
+
if __name__ == '__main__':
unittest.main()