• Vaclav Brozek's avatar
    Improve presubmit for histogram name typos · 0e730cbd
    Vaclav Brozek authored
    Currently, _CheckUmaHistogramChanges detects the cases like calling
      UMA_HISTOGRAM_BOOLEAN("NonexistingHistogram.Typo", true)
    when "NonexistingHistogram.Typo" is not a histogram name defined in
    histograms.xml.
    
    However, it won't detect the case when the name is after a line break:
      UMA_HISTOGRAM_BOOLEAN(
          "NonexistingHistogram.VeeeeeeeryLoooooooongName.WithSubitems",
          true)
    
    This will be often the case once the check gets extended to Java,
    where the UMA_HISTOGRAM* macros are replaced with the
    RecordHistogram.record*Histogram methods, which have longer names.
    
    Bug: 821981
    Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
    Change-Id: I71d01f3b7012e8a8d6c4628d67a470c57005cd56
    Reviewed-on: https://chromium-review.googlesource.com/978219
    Commit-Queue: Vaclav Brozek <vabr@chromium.org>
    Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#545676}
    0e730cbd
PRESUBMIT_test.py 55.7 KB