From 32f5a1c56531e4210bc4cf8d8c7825d66e081888 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 18 Nov 2020 16:35:47 +0100 Subject: BASELINE: Update Chromium to 87.0.4280.67 Change-Id: Ib157360be8c2ffb2c73125751a89f60e049c1d54 Reviewed-by: Allan Sandfeld Jensen --- chromium/PRESUBMIT_test.py | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) (limited to 'chromium/PRESUBMIT_test.py') 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): '', '') + NEW_GRDP_CONTENTS5 = ( + '', + '', + '', + 'Part string 1', + '', + '') + + NEW_GRDP_CONTENTS6 = ( + '', + '', + '', + 'Part string 1', + '', + '') + # A grdp file with one ICU syntax message without syntax errors. NEW_GRDP_CONTENTS_ICU_SYNTAX_OK1 = ( '', @@ -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 -- cgit v1.2.1