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

Unified Diff: tools/telemetry/telemetry/results/chart_json_output_formatter_unittest.py

Issue 551063005: [Telemetry] Fix handling for two-part per-page value names in Chart JSON. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 3 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
Index: tools/telemetry/telemetry/results/chart_json_output_formatter_unittest.py
diff --git a/tools/telemetry/telemetry/results/chart_json_output_formatter_unittest.py b/tools/telemetry/telemetry/results/chart_json_output_formatter_unittest.py
index b7359b2cae25685f6c86757000389fd4af3a3c55..23a8b964f09060042455e817711e158291555aa6 100644
--- a/tools/telemetry/telemetry/results/chart_json_output_formatter_unittest.py
+++ b/tools/telemetry/telemetry/results/chart_json_output_formatter_unittest.py
@@ -80,7 +80,23 @@ class ChartJsonTest(unittest.TestCase):
self.assertTrue('foo' in d['charts'])
self.assertTrue('http://www.foo.com/' in d['charts']['foo'])
- def testAsChartDictPageSpecificValuesAndComputedSummary(self):
+ def testAsChartDictPageSpecificValuesAndComputedSummaryWithTraceName(self):
+ v0 = scalar.ScalarValue(self._page_set[0], 'foo.bar', 'seconds', 3)
+ v1 = scalar.ScalarValue(self._page_set[1], 'foo.bar', 'seconds', 4)
+ page_specific_values = [v0, v1]
+ summary_values = []
+
+ d = chart_json_output_formatter._ResultsAsChartDict( # pylint: disable=W0212
+ self._benchmark_metadata,
+ page_specific_values,
+ summary_values)
+
+ self.assertTrue('foo' in d['charts'])
+ self.assertTrue('http://www.foo.com/' in d['charts']['foo'])
+ self.assertTrue('http://www.bar.com/' in d['charts']['foo'])
+ self.assertTrue('bar' in d['charts']['foo'])
+
+ def testAsChartDictPageSpecificValuesAndComputedSummaryWithoutTraceName(self):
v0 = scalar.ScalarValue(self._page_set[0], 'foo', 'seconds', 3)
v1 = scalar.ScalarValue(self._page_set[1], 'foo', 'seconds', 4)
page_specific_values = [v0, v1]
« no previous file with comments | « tools/telemetry/telemetry/results/chart_json_output_formatter.py ('k') | tools/telemetry/telemetry/value/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698