Commit 560a6590 authored by Bill Orr's avatar Bill Orr Committed by Commit Bot

Fix PRESUBMIT.py for web_features.mojom enums.xml check on Windows

The output XML contains a relative path to the mojom file. On Windows,
the expected path contains '\' separators, but the actual contains '/'.
tools/metrics/histograms/update_use_counter_feature_enum.py will update
the enums.xml file, but uses a hardcoded path.  The fix is to use a
hardcoded path for
third_party/blink/public/mojom/web_feature/PRESUBMIT.py as well.

Bug: 966496
Change-Id: Iad605bea175ee86abe7bb8c160ae2be30bf8f65e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1627636Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Reviewed-by: default avatarMike West <mkwst@chromium.org>
Commit-Queue: Bill Orr <billorr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#666311}
parent ecb0b699
...@@ -21,14 +21,13 @@ def _RunUmaHistogramChecks(input_api, output_api): # pylint: disable=C0103 ...@@ -21,14 +21,13 @@ def _RunUmaHistogramChecks(input_api, output_api): # pylint: disable=C0103
finally: finally:
sys.path = original_sys_path sys.path = original_sys_path
source_path = ''
for f in input_api.AffectedFiles(): for f in input_api.AffectedFiles():
if f.LocalPath().endswith('web_feature.mojom'): if f.LocalPath().endswith('web_feature.mojom'):
source_path = f.LocalPath()
break break
else: else:
return [] return []
source_path = 'third_party/blink/public/mojom/web_feature/web_feature.mojom'
start_marker = '^enum WebFeature {' start_marker = '^enum WebFeature {'
end_marker = '^kNumberOfFeatures' end_marker = '^kNumberOfFeatures'
presubmit_error = update_histogram_enum.CheckPresubmitErrors( presubmit_error = update_histogram_enum.CheckPresubmitErrors(
......
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