Commit 4f7af53f authored by Julian Pastarmov's avatar Julian Pastarmov Committed by Commit Bot

Fix the PRESUBMIT.py script to properly invoke grit

The grd reader is invoked from _GetGrdMessages with defines which
specify "chromium" build.

Drive-by fix for the MockFile to support basename on Windows.

BUG=984910
TEST=A modified grd fail doesn't trip the presubmit run.

Change-Id: I1b30dcaf8b91d40292e631ba854b4f0dfa54de69
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1705799Reviewed-by: default avatarJochen Eisinger <jochen@chromium.org>
Commit-Queue: Julian Pastarmov <pastarmovj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#678407}
parent 9f60900b
......@@ -4267,7 +4267,7 @@ def _CheckTranslationScreenshots(input_api, output_api):
"""
doc = grit.grd_reader.Parse(grd_path_or_string, dir_path,
stop_after=None, first_ids_file=None,
debug=False, defines=None,
debug=False, defines={'_chromium': 1},
tags_to_ignore=set([PART_FILE_TAG]))
return {
msg.attrs['name']:msg for msg in doc.GetChildrenOfType(
......
......@@ -220,6 +220,10 @@ class MockFile(object):
"""os.path.basename is called on MockFile so we need a len method."""
return len(self._local_path)
def replace(self, altsep, sep):
"""os.path.basename is called on MockFile so we need a replace method."""
return self._local_path.replace(altsep, sep)
class MockAffectedFile(MockFile):
def AbsoluteLocalPath(self):
......
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