diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-01-25 11:39:07 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-01-25 15:20:42 +0000 |
commit | 6c91641271e536ffaa88a1dff5127e42ee99a91e (patch) | |
tree | 703d9dd49602377ddc90cbf886aad37913f2496b /chromium/PRESUBMIT_test.py | |
parent | b145b7fafd36f0c260d6a768c81fc14e32578099 (diff) | |
download | qtwebengine-chromium-6c91641271e536ffaa88a1dff5127e42ee99a91e.tar.gz |
BASELINE: Update Chromium to 49.0.2623.23
Also adds missing printing sources.
Change-Id: I3726b8f0c7d6751c9fc846096c571fadca7108cd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'chromium/PRESUBMIT_test.py')
-rwxr-xr-x | chromium/PRESUBMIT_test.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/chromium/PRESUBMIT_test.py b/chromium/PRESUBMIT_test.py index 4d40d8f9712..6b83350e73c 100755 --- a/chromium/PRESUBMIT_test.py +++ b/chromium/PRESUBMIT_test.py @@ -392,15 +392,18 @@ class CheckSingletonInHeadersTest(unittest.TestCase): 'base::Singleton<Type, Traits, DifferentiatingType>::'] diff_foo_h = ['// base::Singleton<Foo> in comment.', 'friend class base::Singleton<Foo>'] + diff_foo2_h = [' //Foo* bar = base::Singleton<Foo>::get();'] diff_bad_h = ['Foo* foo = base::Singleton<Foo>::get();'] mock_input_api = MockInputApi() mock_input_api.files = [MockAffectedFile('base/memory/singleton.h', diff_singleton_h), MockAffectedFile('foo.h', diff_foo_h), + MockAffectedFile('foo2.h', diff_foo2_h), MockAffectedFile('bad.h', diff_bad_h)] warnings = PRESUBMIT._CheckSingletonInHeaders(mock_input_api, MockOutputApi()) self.assertEqual(1, len(warnings)) + self.assertEqual(2, len(warnings[0].items)) self.assertEqual('error', warnings[0].type) self.assertTrue('Found base::Singleton<T>' in warnings[0].message) @@ -944,6 +947,35 @@ class LogUsageTest(unittest.TestCase): self.assertTrue('HasDottedTag.java' in msgs[4].items) self.assertTrue('HasOldTag.java' in msgs[4].items) +class HardcodedGoogleHostsTest(unittest.TestCase): + + def testWarnOnAssignedLiterals(self): + input_api = MockInputApi() + input_api.files = [ + MockFile('content/file.cc', + ['char* host = "https://www.google.com";']), + MockFile('content/file.cc', + ['char* host = "https://www.googleapis.com";']), + MockFile('content/file.cc', + ['char* host = "https://clients1.google.com";']), + ] + + warnings = PRESUBMIT._CheckHardcodedGoogleHostsInLowerLayers( + input_api, MockOutputApi()) + self.assertEqual(1, len(warnings)) + self.assertEqual(3, len(warnings[0].items)) + + def testAllowInComment(self): + input_api = MockInputApi() + input_api.files = [ + MockFile('content/file.cc', + ['char* host = "https://www.aol.com"; // google.com']) + ] + + warnings = PRESUBMIT._CheckHardcodedGoogleHostsInLowerLayers( + input_api, MockOutputApi()) + self.assertEqual(0, len(warnings)) + if __name__ == '__main__': unittest.main() |