OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright (c) 2015 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2015 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="/tracing/ui/base/dropdown.html"> | 8 <link rel="import" href="/tracing/ui/base/dropdown.html"> |
9 <link rel="import" href="/tracing/ui/base/dom_helpers.html"> | 9 <link rel="import" href="/tracing/ui/base/dom_helpers.html"> |
10 | 10 |
11 <script> | 11 <script> |
12 'use strict'; | 12 'use strict'; |
13 | 13 |
14 tr.b.unittest.testSuite(function() { | 14 tr.b.unittest.testSuite(function() { |
15 test('basic', function() { | 15 test('basic', function() { |
16 var dd = document.createElement('tr-ui-b-dropdown'); | 16 var dd = document.createElement('tr-ui-b-dropdown'); |
17 dd.style.marginLeft = '50px'; | 17 dd.style.marginLeft = '50px'; |
18 dd.style.width = '50px'; | 18 dd.style.width = '50px'; |
19 dd.iconElement.textContent = 'Settings ' + String.fromCharCode(0x2699); | 19 dd.iconElement.textContent = 'Settings ' + String.fromCharCode(0x2699); |
20 | 20 |
21 dd.appendChild(tr.ui.b.createDiv({textContent: 'item 1'})); | 21 Polymer.dom(dd).appendChild(tr.ui.b.createDiv({textContent: 'item 1'})); |
22 dd.appendChild(tr.ui.b.createDiv({textContent: 'item 2 longer'})); | 22 Polymer.dom(dd).appendChild( |
23 dd.appendChild(tr.ui.b.createDiv({textContent: 'item 3'})); | 23 tr.ui.b.createDiv({textContent: 'item 2 longer'})); |
| 24 Polymer.dom(dd).appendChild( |
| 25 tr.ui.b.createDiv({textContent: 'item 3'})); |
24 | 26 |
25 var container = tr.ui.b.createDiv(); | 27 var container = tr.ui.b.createDiv(); |
26 container.style.height = '100px'; | 28 container.style.height = '100px'; |
27 container.appendChild(dd); | 29 Polymer.dom(container).appendChild(dd); |
28 container.appendChild(tr.ui.b.createDiv({textContent: 'some text'})); | 30 Polymer.dom(container).appendChild( |
29 container.appendChild(tr.ui.b.createDiv({textContent: 'some more text'})); | 31 tr.ui.b.createDiv({textContent: 'some text'})); |
30 container.appendChild(tr.ui.b.createDiv({textContent: 'more text'})); | 32 Polymer.dom(container).appendChild( |
| 33 tr.ui.b.createDiv({textContent: 'some more text'})); |
| 34 Polymer.dom(container).appendChild( |
| 35 tr.ui.b.createDiv({textContent: 'more text'})); |
31 this.addHTMLOutput(container); | 36 this.addHTMLOutput(container); |
32 | 37 |
33 dd.show(); | 38 dd.show(); |
34 dd.close(); | 39 dd.close(); |
35 }); | 40 }); |
36 | 41 |
37 }); | 42 }); |
38 </script> | 43 </script> |
OLD | NEW |