Commit 1d3b59de authored by Oksana Zhuravlova's avatar Oksana Zhuravlova Committed by Commit Bot

[mojo] Change mojo::ConvertTo presubmit check from error to warning

Bug: 621383
Change-Id: Ie2da4387a8352073c6d2221274b39034c8ee285c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1616148
Commit-Queue: Oksana Zhuravlova <oksamyt@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#660665}
parent c1ad9463
......@@ -775,7 +775,7 @@ _BANNED_CPP_FUNCTIONS = (
'StringTraits if you would like to convert between custom types and',
'the wire format of mojom types.'
),
True,
False,
(
r'^third_party/blink/.*\.(cc|h)$',
r'^content/renderer/.*\.(cc|h)$',
......
......@@ -1938,14 +1938,16 @@ class BannedFunctionCheckTest(unittest.TestCase):
['mojo::ConvertTo<>']),
]
errors = PRESUBMIT._CheckNoBannedFunctions(input_api, MockOutputApi())
self.assertEqual(1, len(errors))
self.assertTrue('some/cpp/problematic/file.cc' in errors[0].message)
self.assertTrue('some/cpp/problematic/file2.cc' in errors[0].message)
self.assertTrue('some/cpp/ok/file.cc' not in errors[0].message)
self.assertTrue('some/cpp/ok/file2.cc' not in errors[0].message)
self.assertTrue('third_party/blink/ok/file3.cc' not in errors[0].message)
self.assertTrue('content/renderer/ok/file3.cc' not in errors[0].message)
results = PRESUBMIT._CheckNoBannedFunctions(input_api, MockOutputApi())
# warnings are results[0], errors are results[1]
self.assertEqual(2, len(results))
self.assertTrue('some/cpp/problematic/file.cc' in results[1].message)
self.assertTrue('some/cpp/problematic/file2.cc' in results[0].message)
self.assertTrue('some/cpp/ok/file.cc' not in results[1].message)
self.assertTrue('some/cpp/ok/file2.cc' not in results[1].message)
self.assertTrue('third_party/blink/ok/file3.cc' not in results[0].message)
self.assertTrue('content/renderer/ok/file3.cc' not in results[0].message)
class NoProductionCodeUsingTestOnlyFunctionsTest(unittest.TestCase):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment