Upstream version 11.39.266.0
[platform/framework/web/crosswalk.git] / src / third_party / trace-viewer / third_party / tvcm / src / tvcm / ui / sunburst_chart_test.html
1 <!DOCTYPE html>
2 <!--
3 Copyright (c) 2014 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file.
6 -->
7 <link rel="import" href="/tvcm/ui/sunburst_chart.html">
8 <script>
9 'use strict';
10
11 tvcm.unittest.testSuite(function() {
12   test('simple', function() {
13     var chart = new tvcm.ui.SunburstChart();
14     chart.width = 600;
15     chart.height = 600;
16     assertEquals('600', chart.getAttribute('width'));
17     assertEquals('600', chart.getAttribute('height'));
18     chart.chartTitle = 'Chart title';
19     var nodes = {
20       category: 'root',
21       name: '<All Threads>',
22       children: [
23         {
24           category: 'Thread',
25           name: 'Thread 1',
26           children: [
27             {
28               category: 'Chrome',
29               name: 'foo()',
30               children: [
31                 {
32                   category: 'Chrome',
33                   name: 'foo()',
34                   size: 150
35                 },
36                 {
37                   category: 'Chrome',
38                   name: 'bar()',
39                   size: 200
40                 }]
41             },
42             {
43               category: 'Chrome',
44               name: 'bar()',
45               size: 200
46             }]
47         },
48         {
49           category: 'Thread',
50           name: 'Thread 2',
51           children: [
52             {
53               category: 'Java',
54               name: 'Java',
55               size: 100
56             }]
57         }]
58     };
59     chart.data = {
60       nodes: nodes
61     };
62     this.addHTMLOutput(chart);
63   });
64 });
65 </script>