diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-10-13 13:24:50 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-10-14 10:57:25 +0000 |
commit | af3d4809763ef308f08ced947a73b624729ac7ea (patch) | |
tree | 4402b911e30383f6c6dace1e8cf3b8e85355db3a /chromium/PRESUBMIT_test.py | |
parent | 0e8ff63a407fe323e215bb1a2c423c09a4747c8a (diff) | |
download | qtwebengine-chromium-af3d4809763ef308f08ced947a73b624729ac7ea.tar.gz |
BASELINE: Update Chromium to 47.0.2526.14
Also adding in sources needed for spellchecking.
Change-Id: Idd44170fa1616f26315188970a8d5ba7d472b18a
Reviewed-by: Michael BrĂ¼ning <michael.bruning@theqtcompany.com>
Diffstat (limited to 'chromium/PRESUBMIT_test.py')
-rwxr-xr-x | chromium/PRESUBMIT_test.py | 67 |
1 files changed, 44 insertions, 23 deletions
diff --git a/chromium/PRESUBMIT_test.py b/chromium/PRESUBMIT_test.py index e0de9674d33..4d40d8f9712 100755 --- a/chromium/PRESUBMIT_test.py +++ b/chromium/PRESUBMIT_test.py @@ -389,10 +389,10 @@ class BadExtensionsTest(unittest.TestCase): class CheckSingletonInHeadersTest(unittest.TestCase): def testSingletonInArbitraryHeader(self): diff_singleton_h = ['base::subtle::AtomicWord ' - 'Singleton<Type, Traits, DifferentiatingType>::'] - diff_foo_h = ['// Singleton<Foo> in comment.', - 'friend class Singleton<Foo>'] - diff_bad_h = ['Foo* foo = Singleton<Foo>::get();'] + 'base::Singleton<Type, Traits, DifferentiatingType>::'] + diff_foo_h = ['// base::Singleton<Foo> in comment.', + 'friend class base::Singleton<Foo>'] + 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), @@ -402,10 +402,10 @@ class CheckSingletonInHeadersTest(unittest.TestCase): MockOutputApi()) self.assertEqual(1, len(warnings)) self.assertEqual('error', warnings[0].type) - self.assertTrue('Found Singleton<T>' in warnings[0].message) + self.assertTrue('Found base::Singleton<T>' in warnings[0].message) def testSingletonInCC(self): - diff_cc = ['Foo* foo = Singleton<Foo>::get();'] + diff_cc = ['Foo* foo = base::Singleton<Foo>::get();'] mock_input_api = MockInputApi() mock_input_api.files = [MockAffectedFile('some/path/foo.cc', diff_cc)] warnings = PRESUBMIT._CheckSingletonInHeaders(mock_input_api, @@ -463,7 +463,7 @@ class CheckAddedDepsHaveTetsApprovalsTest(unittest.TestCase): '"+chrome/plugin/chrome_content_plugin_client.h",', '"+chrome/utility/chrome_content_utility_client.h",', '"+chromeos/chromeos_paths.h",', - '"+components/crash",', + '"+components/crash/content",', '"+components/nacl/common",', '"+content/public/browser/render_process_host.h",', '"+jni/fooblat.h",', @@ -482,7 +482,7 @@ class CheckAddedDepsHaveTetsApprovalsTest(unittest.TestCase): 'chrome/plugin/chrome_content_plugin_client.h', 'chrome/utility/chrome_content_utility_client.h', 'chromeos/chromeos_paths.h', - 'components/crash/DEPS', + 'components/crash/content/DEPS', 'components/nacl/common/DEPS', 'content/public/browser/render_process_host.h', 'policy/DEPS', @@ -840,32 +840,38 @@ class LogUsageTest(unittest.TestCase): ]), MockAffectedFile('IsInBasePackage.java', [ 'package org.chromium.base;', - 'private static final String TAG = "cr.Foo";', + 'private static final String TAG = "cr_Foo";', 'Log.d(TAG, "foo");', ]), MockAffectedFile('IsInBasePackageButImportsLog.java', [ 'package org.chromium.base;', 'import android.util.Log;', - 'private static final String TAG = "cr.Foo";', + 'private static final String TAG = "cr_Foo";', 'Log.d(TAG, "foo");', ]), MockAffectedFile('HasBothLog.java', [ 'import org.chromium.base.Log;', 'some random stuff', - 'private static final String TAG = "cr.Foo";', + 'private static final String TAG = "cr_Foo";', 'Log.d(TAG, "foo");', 'android.util.Log.d("TAG", "foo");', ]), MockAffectedFile('HasCorrectTag.java', [ 'import org.chromium.base.Log;', 'some random stuff', + 'private static final String TAG = "cr_Foo";', + 'Log.d(TAG, "foo");', + ]), + MockAffectedFile('HasOldTag.java', [ + 'import org.chromium.base.Log;', + 'some random stuff', 'private static final String TAG = "cr.Foo";', 'Log.d(TAG, "foo");', ]), - MockAffectedFile('HasShortCorrectTag.java', [ + MockAffectedFile('HasDottedTag.java', [ 'import org.chromium.base.Log;', 'some random stuff', - 'private static final String TAG = "cr";', + 'private static final String TAG = "cr_foo.bar";', 'Log.d(TAG, "foo");', ]), MockAffectedFile('HasNoTagDecl.java', [ @@ -875,17 +881,17 @@ class LogUsageTest(unittest.TestCase): ]), MockAffectedFile('HasIncorrectTagDecl.java', [ 'import org.chromium.base.Log;', - 'private static final String TAHG = "cr.Foo";', + 'private static final String TAHG = "cr_Foo";', 'some random stuff', 'Log.d(TAG, "foo");', ]), MockAffectedFile('HasInlineTag.java', [ 'import org.chromium.base.Log;', 'some random stuff', - 'private static final String TAG = "cr.Foo";', + 'private static final String TAG = "cr_Foo";', 'Log.d("TAG", "foo");', ]), - MockAffectedFile('HasIncorrectTag.java', [ + MockAffectedFile('HasUnprefixedTag.java', [ 'import org.chromium.base.Log;', 'some random stuff', 'private static final String TAG = "rubbish";', @@ -894,7 +900,7 @@ class LogUsageTest(unittest.TestCase): MockAffectedFile('HasTooLongTag.java', [ 'import org.chromium.base.Log;', 'some random stuff', - 'private static final String TAG = "cr.24_charachers_long___";', + 'private static final String TAG = "21_charachers_long___";', 'Log.d(TAG, "foo");', ]), ] @@ -902,27 +908,42 @@ class LogUsageTest(unittest.TestCase): msgs = PRESUBMIT._CheckAndroidCrLogUsage( mock_input_api, mock_output_api) - self.assertEqual(4, len(msgs)) + self.assertEqual(5, len(msgs), + 'Expected %d items, found %d: %s' % (5, len(msgs), msgs)) # Declaration format - self.assertEqual(3, len(msgs[0].items)) + nb = len(msgs[0].items) + self.assertEqual(2, nb, + 'Expected %d items, found %d: %s' % (2, nb, msgs[0].items)) self.assertTrue('HasNoTagDecl.java' in msgs[0].items) self.assertTrue('HasIncorrectTagDecl.java' in msgs[0].items) - self.assertTrue('HasIncorrectTag.java' in msgs[0].items) # Tag length - self.assertEqual(1, len(msgs[1].items)) + nb = len(msgs[1].items) + self.assertEqual(1, nb, + 'Expected %d items, found %d: %s' % (1, nb, msgs[1].items)) self.assertTrue('HasTooLongTag.java' in msgs[1].items) # Tag must be a variable named TAG - self.assertEqual(1, len(msgs[2].items)) + nb = len(msgs[2].items) + self.assertEqual(1, nb, + 'Expected %d items, found %d: %s' % (1, nb, msgs[2].items)) self.assertTrue('HasInlineTag.java:4' in msgs[2].items) # Util Log usage - self.assertEqual(2, len(msgs[3].items)) + nb = len(msgs[3].items) + self.assertEqual(2, nb, + 'Expected %d items, found %d: %s' % (2, nb, msgs[3].items)) self.assertTrue('HasAndroidLog.java:3' in msgs[3].items) self.assertTrue('IsInBasePackageButImportsLog.java:4' in msgs[3].items) + # Tag must not contain + nb = len(msgs[4].items) + self.assertEqual(2, nb, + 'Expected %d items, found %d: %s' % (2, nb, msgs[4].items)) + self.assertTrue('HasDottedTag.java' in msgs[4].items) + self.assertTrue('HasOldTag.java' in msgs[4].items) + if __name__ == '__main__': unittest.main() |