OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright 2016 The Chromium Authors. All rights reserved. | 3 Copyright 2016 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 | 7 |
8 <link rel="import" href="/dashboard/elements/chart-legend-tooltip.html"> | 8 <link rel="import" href="/dashboard/elements/chart-legend-tooltip.html"> |
9 <link rel="import" href="/tracing/core/test_utils.html"> | 9 <link rel="import" href="/tracing/core/test_utils.html"> |
| 10 <link rel="import" href="/tracing/ui/base/deep_utils.html"> |
10 | 11 |
11 <script> | 12 <script> |
12 'use strict'; | 13 'use strict'; |
13 | 14 |
14 tr.b.unittest.testSuite(function() { | 15 tr.b.unittest.testSuite(function() { |
15 const testOptions = { | 16 const testOptions = { |
16 setUp() { | 17 setUp() { |
17 }, | 18 }, |
18 tearDown() { | 19 tearDown() { |
19 } | 20 } |
20 }; | 21 }; |
21 | 22 |
22 test('instantiate', function() { | 23 test('instantiate', function() { |
23 const legendTooltip = document.createElement('chart-legend-tooltip'); | 24 const legendTooltip = document.createElement('chart-legend-tooltip'); |
24 legendTooltip.description = 'Amazing description.'; | 25 legendTooltip.description = 'Amazing description.'; |
25 legendTooltip.direction = 'Lower'; | 26 legendTooltip.direction = 'Lower'; |
26 legendTooltip.path = 'Master/bot/test.suite/metric'; | 27 legendTooltip.path = 'Master/bot/test.suite/metric'; |
27 legendTooltip.units = 'us'; | 28 legendTooltip.units = 'us'; |
28 | 29 |
29 const container = document.createElement('div'); | 30 const container = document.createElement('div'); |
30 const text = document.createElement('span'); | 31 const text = document.createElement('span'); |
31 Polymer.dom(text).textContent = | 32 Polymer.dom(text).textContent = |
32 'this_is_a_long_mertric_name'; | 33 'this_is_a_long_mertric_name'; |
33 Polymer.dom(container).appendChild(text); | 34 Polymer.dom(container).appendChild(text); |
34 Polymer.dom(container).appendChild(legendTooltip); | 35 Polymer.dom(container).appendChild(legendTooltip); |
35 | 36 |
36 this.addHTMLOutput(container); | 37 this.addHTMLOutput(container); |
37 document.getElementById('info').click(); | 38 tr.ui.b.findDeepElementMatching(document.body, '#info').click(); |
38 }, testOptions); | 39 }, testOptions); |
39 }); | 40 }); |
40 </script> | 41 </script> |
OLD | NEW |