Make HistogramTester treat empty histograms uniformly.
Some of the Expect* methods of HistogramTester fail if the queried histogram has no data. Other methods allow querying empty histograms and treat them as a collection of empty buckets. Failing while inspecting empty histograms can make it awkward to verify certain test cases. For example, to check that a particular test case does not write to a particular bucket with ExpectBucketCount, a write to a separate bucket would be required. Alternatively, just asserting that the histogram is empty isn't quite right either because the test case would fail if an unrelated bucket happened to be updated. This CL changes HistogramTester to be consistent about what is queryable by treating empty histograms as collections of empty buckets. Change-Id: Id97356edb0bf983ff9487a2b749e028147400a97 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1879608Reviewed-by:Alexei Svitkine <asvitkine@chromium.org> Commit-Queue: Tom McKee <tommckee@chromium.org> Cr-Commit-Position: refs/heads/master@{#710938}
Showing
Please register or sign in to comment