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

Unified Diff: tracing/tracing/value/chart_json_converter_test.html

Issue 3008223002: Plumb traceUrls through ChartJsonConverter. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « tracing/tracing/value/chart_json_converter.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/value/chart_json_converter_test.html
diff --git a/tracing/tracing/value/chart_json_converter_test.html b/tracing/tracing/value/chart_json_converter_test.html
index 34956e595b1924e269cf6f497bdc603ade34e3b5..549a111894686c711638320c18dc3a66aaa4a18e 100644
--- a/tracing/tracing/value/chart_json_converter_test.html
+++ b/tracing/tracing/value/chart_json_converter_test.html
@@ -24,7 +24,6 @@ tr.b.unittest.testSuite(function() {
name: 'mean_frame_time',
type: 'list_of_scalar_values',
improvement_direction: 'down',
- important: true,
units: 'ms',
page_id: 16,
description: 'Arithmetic mean of frame times.'
@@ -33,7 +32,6 @@ tr.b.unittest.testSuite(function() {
std: 0.0,
name: 'mean_frame_time',
improvement_direction: 'down',
- important: true,
units: 'ms',
type: 'list_of_scalar_values',
description: 'Arithmetic mean of frame times.'
@@ -68,7 +66,6 @@ tr.b.unittest.testSuite(function() {
name: 'mean_frame_time',
type: 'list_of_scalar_values',
improvement_direction: 'down',
- important: true,
values: [42],
units: 'ms',
page_id: 16,
@@ -78,7 +75,6 @@ tr.b.unittest.testSuite(function() {
std: 0.0,
name: 'mean_frame_time',
improvement_direction: 'down',
- important: true,
values: [
16.693,
16.646,
@@ -183,5 +179,52 @@ tr.b.unittest.testSuite(function() {
assert.strictEqual(tr.b.Unit.byName.timeDurationInMs_smallerIsBetter,
hist.unit);
});
+
+ test('traceUrls', function() {
+ const charts = {
+ charts: {
+ measurementA: {
+ storyA: {
+ units: 'ms',
+ type: 'list_of_scalar_values',
+ values: [100],
+ name: 'measurementA',
+ },
+ storyB: {
+ units: 'ms',
+ type: 'list_of_scalar_values',
+ values: [200],
+ name: 'measurementA',
+ },
+ },
+ trace: {
+ storyA: {
+ name: 'trace',
+ type: 'trace',
+ file_path: '/home/user/storyA_1900-01-01_00-00-00.html',
+ },
+ storyB: {
+ name: 'trace',
+ type: 'trace',
+ cloud_url: 'https://console.developers.google.com/m/cloudstorage/chromium-telemetry/o/storyB_1900-01-01_00-00-00.html',
+ },
+ },
+ },
+ };
+ let histograms = new tr.v.HistogramSet();
+ tr.v.ChartJsonConverter.convertChartJson(charts, histograms);
+ histograms = [...histograms];
+ assert.lengthOf(histograms, 2);
+ assert.strictEqual(tr.v.HistogramGrouping.BY_KEY.get(
+ tr.v.d.RESERVED_NAMES.STORIES).callback(histograms[0]), 'storyA');
+ assert.strictEqual(tr.v.HistogramGrouping.BY_KEY.get(
+ tr.v.d.RESERVED_NAMES.STORIES).callback(histograms[1]), 'storyB');
+ assert.strictEqual(tr.b.getOnlyElement(histograms[0].diagnostics.get(
+ tr.v.d.RESERVED_NAMES.TRACE_URLS)),
+ 'file:///home/user/storyA_1900-01-01_00-00-00.html');
+ assert.strictEqual(tr.b.getOnlyElement(histograms[1].diagnostics.get(
+ tr.v.d.RESERVED_NAMES.TRACE_URLS)),
+ 'https://console.developers.google.com/m/cloudstorage/chromium-telemetry/o/storyB_1900-01-01_00-00-00.html');
+ });
});
</script>
« no previous file with comments | « tracing/tracing/value/chart_json_converter.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698