Upstream version 9.37.197.0
[platform/framework/web/crosswalk.git] / src / third_party / trace-viewer / third_party / tvcm / src / tvcm / ui / bar_chart_test.js
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 'use strict';
6
7 tvcm.require('tvcm.ui.bar_chart');
8
9 tvcm.testSuite('tvcm.ui.bar_chart_test', function() {
10   test('singleSeries', function() {
11     var chart = new tvcm.ui.BarChart();
12     chart.width = 400;
13     chart.height = 200;
14     chart.chartTitle = 'Chart title';
15     var data = [
16       {label: 'a', value: 100},
17       {label: 'b', value: 40},
18       {label: 'c', value: 20}
19     ];
20     chart.setDataAndXLabelKey(data, 'label');
21     this.addHTMLOutput(chart);
22   });
23
24   test('twoSeries', function() {
25     var chart = new tvcm.ui.BarChart();
26     chart.width = 400;
27     chart.height = 200;
28     chart.chartTitle = 'Chart title';
29     var data = [
30       {label: 'a', value1: 100, value2: 50},
31       {label: 'b', value1: 75, value2: 10},
32       {label: 'c', value1: 50, value2: 125}
33     ];
34     chart.setDataAndXLabelKey(data, 'label');
35     this.addHTMLOutput(chart);
36   });
37 });