0
Commit Graph

2 Commits

Author SHA1 Message Date
lukasza
14d9a1a8ca Fix presubmit_scheme_histograms.py and presubmit_bad_message_reasons.py
This CL fixes presubmit_scheme_histograms.py and
presubmit_bad_message_reasons.py which after r462591 would always report
presubmit errors (because it started returning a tuple from HistogramNeedsUpdate
which always coerces to True in the broken presubmit scripts).

After r462591 HistogramNeedsUpdate effectively checks all
histogram-enum-related presubmits (both for updating histograms.xml and
for detecting duplicate values).  Therefore the current CL renames this
function to CheckPresubmitErrors and makes it return a presubmit error
(rather than a tuple of (needs_updating, duplicates)).  This refactoring
has a nice side benefit - after this CL, all presubmits going through
CheckPresubmitErrors will check for duplicate values (r462591 only added
this check for UseCounter histograms).

This CL also tweaks content/browser/PRESUBMIT.py so that it applies
*both* to upload-time and commit-time checks (without this change
|git cl presubmit| would not hit the checks related to
content/browser/bad_message.h - they would only be hit when running
|git cl presubmit --upload|).

Manual testing done:
- Make changes in content/browser/bad_message.h,
  chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc,
  third_party/WebKit/Source/code/frame
- Run git cl presubmit and verify that the presubmit
  checks detect 1) duplicates and 2) the need to update histograms.xml

BUG=577772
TEST=See "Manual testing done" above.
TBR=sky@chromium.org, jochen@chromium.org, rdevlin.cronin@chromium.org

Review-Url: https://codereview.chromium.org/2841823007
Cr-Commit-Position: refs/heads/master@{#468003}
2017-04-28 15:23:57 +00:00
dougt
b53dc5998d Add presubmit scripts to check histograms.xml if bad_message.h changes.
BUG=None
R=dgozman

Review-Url: https://codereview.chromium.org/2653273003
Cr-Commit-Position: refs/heads/master@{#447531}
2017-02-01 16:25:00 +00:00