Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Unified Diff: tools/telemetry/telemetry/page_benchmark_results_unittest.py

Issue 11778100: Telemetry: Add tests which would've caught the memory_benchmark breakage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/telemetry/telemetry/csv_page_benchmark_results_unittest.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/page_benchmark_results_unittest.py
diff --git a/tools/telemetry/telemetry/page_benchmark_results_unittest.py b/tools/telemetry/telemetry/page_benchmark_results_unittest.py
index fec3aafcbbe0cd7e6789a16241e216b6edb035a5..f2e5ab2f0b9596e6b36c237a644d6e2acc3ab10c 100644
--- a/tools/telemetry/telemetry/page_benchmark_results_unittest.py
+++ b/tools/telemetry/telemetry/page_benchmark_results_unittest.py
@@ -105,3 +105,32 @@ class PageBenchmarkResultsTest(unittest.TestCase):
self.assertEquals(
benchmark_results.results,
expected)
+
+ def test_histogram(self):
+ page_set = _MakePageSet()
+
+ benchmark_results = SummarySavingPageBenchmarkResults()
+ benchmark_results.WillMeasurePage(page_set.pages[0])
+ benchmark_results.Add('a', '',
+ '{"buckets": [{"low": 1, "high": 2, "count": 1}]}',
+ data_type='histogram')
+ benchmark_results.DidMeasurePage()
+
+ benchmark_results.WillMeasurePage(page_set.pages[1])
+ benchmark_results.Add('a', '',
+ '{"buckets": [{"low": 2, "high": 3, "count": 1}]}',
+ data_type='histogram')
+ benchmark_results.DidMeasurePage()
+
+ benchmark_results.PrintSummary(None)
+
+ expected = [
+ '*HISTOGRAM a_by_url.http___www.foo.com_: ' +
+ 'a_by_url.http___www.foo.com_= ' +
+ '{"buckets": [{"low": 1, "high": 2, "count": 1}]}\n' +
+ 'Avg a_by_url.http___www.foo.com_: 1.500000',
+ '*HISTOGRAM a_by_url.http___www.bar.com_: ' +
+ 'a_by_url.http___www.bar.com_= ' +
+ '{"buckets": [{"low": 2, "high": 3, "count": 1}]}\n' +
+ 'Avg a_by_url.http___www.bar.com_: 2.500000']
+ self.assertEquals(benchmark_results.results, expected)
« no previous file with comments | « tools/telemetry/telemetry/csv_page_benchmark_results_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698