summaryrefslogtreecommitdiff
path: root/chromium/PRESUBMIT_test.py
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-11-18 16:35:47 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-11-18 15:45:54 +0000
commit32f5a1c56531e4210bc4cf8d8c7825d66e081888 (patch)
treeeeeec6822f4d738d8454525233fd0e2e3a659e6d /chromium/PRESUBMIT_test.py
parent99677208ff3b216fdfec551fbe548da5520cd6fb (diff)
downloadqtwebengine-chromium-32f5a1c56531e4210bc4cf8d8c7825d66e081888.tar.gz
BASELINE: Update Chromium to 87.0.4280.67
Change-Id: Ib157360be8c2ffb2c73125751a89f60e049c1d54 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/PRESUBMIT_test.py')
-rwxr-xr-xchromium/PRESUBMIT_test.py39
1 files changed, 37 insertions, 2 deletions
diff --git a/chromium/PRESUBMIT_test.py b/chromium/PRESUBMIT_test.py
index c6f01c89fef..5c52d08996e 100755
--- a/chromium/PRESUBMIT_test.py
+++ b/chromium/PRESUBMIT_test.py
@@ -2888,6 +2888,22 @@ class StringTest(unittest.TestCase):
'</message>',
'</grit-part>')
+ NEW_GRDP_CONTENTS5 = (
+ '<?xml version="1.0" encoding="utf-8"?>',
+ '<grit-part>',
+ '<message name="IDS_PART_TEST1" meaning="Meaning with typo.">',
+ 'Part string 1',
+ '</message>',
+ '</grit-part>')
+
+ NEW_GRDP_CONTENTS6 = (
+ '<?xml version="1.0" encoding="utf-8"?>',
+ '<grit-part>',
+ '<message name="IDS_PART_TEST1" meaning="Meaning with typo fixed.">',
+ 'Part string 1',
+ '</message>',
+ '</grit-part>')
+
# A grdp file with one ICU syntax message without syntax errors.
NEW_GRDP_CONTENTS_ICU_SYNTAX_OK1 = (
'<?xml version="1.0" encoding="utf-8"?>',
@@ -2993,12 +3009,12 @@ class StringTest(unittest.TestCase):
def testModifiedMessageDescription(self):
# CL modified a message description for a message that does not yet have a
- # screenshot. Should warn.
+ # screenshot. Should not warn.
input_api = self.makeInputApi([
MockAffectedFile('part.grdp', self.NEW_GRDP_CONTENTS3,
self.NEW_GRDP_CONTENTS4, action='M')])
warnings = PRESUBMIT.CheckStrings(input_api, MockOutputApi())
- self.assertEqual(1, len(warnings))
+ self.assertEqual(0, len(warnings))
# CL modified a message description for a message that already has a
# screenshot. Should not warn.
@@ -3010,6 +3026,25 @@ class StringTest(unittest.TestCase):
warnings = PRESUBMIT.CheckStrings(input_api, MockOutputApi())
self.assertEqual(0, len(warnings))
+ def testModifiedMessageMeaning(self):
+ # CL modified a message meaning for a message that does not yet have a
+ # screenshot. Should warn.
+ input_api = self.makeInputApi([
+ MockAffectedFile('part.grdp', self.NEW_GRDP_CONTENTS5,
+ self.NEW_GRDP_CONTENTS6, action='M')])
+ warnings = PRESUBMIT.CheckStrings(input_api, MockOutputApi())
+ self.assertEqual(1, len(warnings))
+
+ # CL modified a message meaning for a message that already has a
+ # screenshot. Should not warn.
+ input_api = self.makeInputApi([
+ MockAffectedFile('part.grdp', self.NEW_GRDP_CONTENTS5,
+ self.NEW_GRDP_CONTENTS6, action='M'),
+ MockFile(os.path.join('part_grdp', 'IDS_PART_TEST1.png.sha1'),
+ 'binary', action='A')])
+ warnings = PRESUBMIT.CheckStrings(input_api, MockOutputApi())
+ self.assertEqual(0, len(warnings))
+
def testPngAddedSha1NotAdded(self):
# CL added one new message in a grd file and added the png file associated
# with it, but did not add the corresponding sha1 file. This should warn