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

Unified Diff: tracing/tracing/ui/base/bar_chart_test.html

Issue 2162963002: [polymer] Merge of master into polymer10-migration (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Merge polymer10-migration int polymer10-merge Created 4 years, 5 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/ui/base/bar_chart.html ('k') | tracing/tracing/ui/base/chart_base.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/ui/base/bar_chart_test.html
diff --git a/tracing/tracing/ui/base/bar_chart_test.html b/tracing/tracing/ui/base/bar_chart_test.html
index 24d9de51dc2dbe9fac7fededa04191b0c7123633..157b20232f1565709f10c4d473bcaf87df7120ad 100644
--- a/tracing/tracing/ui/base/bar_chart_test.html
+++ b/tracing/tracing/ui/base/bar_chart_test.html
@@ -6,11 +6,63 @@ found in the LICENSE file.
-->
<link rel="import" href="/tracing/ui/base/bar_chart.html">
+<link rel="import" href="/tracing/ui/base/deep_utils.html">
<script>
'use strict';
tr.b.unittest.testSuite(function() {
+ test('chartLegendKey', function() {
+ var key = document.createElement('tr-ui-b-chart-legend-key');
+ key.textContent = 'Lorem ipsum dolor sit amet';
+ key.color = 'red';
+ this.addHTMLOutput(key);
+
+ key = document.createElement('tr-ui-b-chart-legend-key');
+ key.textContent = 'ipsum dolor sit amet';
+ key.target = 'orange ipsum';
+ key.color = 'orange';
+ this.addHTMLOutput(key);
+ key.addEventListener('requestSelectionChange', function(e) {
+ console.debug(e);
+ });
+
+ key = document.createElement('tr-ui-b-chart-legend-key');
+ key.target = 'brown dolor';
+ key.color = 'brown';
+ key.textContent = 'dolor sit amet';
+ this.addHTMLOutput(key);
+ key.addEventListener('requestSelectionChange', function(e) {
+ console.debug(e);
+ });
+ });
+
+ test('instantiation_legendTargets', function() {
+ var chart = new tr.ui.b.BarChart();
+ chart.customizeLegendTargets({
+ lorem_ipsum: 'lorem_ipsumTarget',
+ qux: 'quxTarget'
+ });
+ chart.customizeOptionalSeries({lorem_ipsum: true, bar: true});
+ chart.isStacked = true;
+ chart.hideXAxis = true;
+ chart.width = 140;
+ chart.height = 200;
+ chart.chartTitle = 'title';
+ chart.data = [{x: 0, foo: 3, lorem_ipsum: 5, bar: 1, qux: 2}];
+ this.addHTMLOutput(chart);
+ chart.addEventListener('requestSelectionChange', function(e) {
+ console.debug(e);
+ });
+
+ assert.isDefined(tr.b.findDeepElementMatchingPredicate(
+ chart, function(element) {
+ return element.tagName === 'TR-UI-B-CHART-LEGEND-KEY' &&
+ element.textContent === 'lorem_ipsum' &&
+ element.target === 'lorem_ipsumTarget';
+ }));
+ });
+
test('instantiation_singleSeries', function() {
var chart = new tr.ui.b.BarChart();
chart.width = 400;
@@ -26,6 +78,34 @@ tr.b.unittest.testSuite(function() {
this.addHTMLOutput(chart);
});
+ test('instantiation_singleDatum', function() {
+ var chart = new tr.ui.b.BarChart();
+ chart.width = 400;
+ chart.height = 200;
+ chart.chartTitle = 'Chart title';
+ var data = [
+ {x: 0, value: 100},
+ ];
+ chart.data = data;
+ this.addHTMLOutput(chart);
+ });
+
+ test('instantiation_stacked', function() {
+ var chart = new tr.ui.b.BarChart();
+ chart.isStacked = true;
+ chart.width = 400;
+ chart.height = 200;
+ chart.chartTitle = 'title';
+ var data = [
+ {x: 10, foo: 10, bar: 5, qux: 7},
+ {x: 20, foo: 11, bar: 6, qux: 3},
+ {x: 30, foo: 10, bar: 4, qux: 8},
+ {x: 40, foo: 5, bar: 1, qux: 2}
+ ];
+ chart.data = data;
+ this.addHTMLOutput(chart);
+ });
+
test('instantiation_singleSeries_yLogScale', function() {
var chart = new tr.ui.b.BarChart();
chart.isYLogScale = true;
« no previous file with comments | « tracing/tracing/ui/base/bar_chart.html ('k') | tracing/tracing/ui/base/chart_base.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698