| <!DOCTYPE html> |
| <!-- |
| Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| Use of this source code is governed by a BSD-style license that can be |
| found in the LICENSE file. |
| --> |
| |
| <link rel="import" href="/base/ui/dropdown.html"> |
| <link rel="import" href="/base/ui/dom_helpers.html"> |
| |
| <script> |
| 'use strict'; |
| |
| tv.b.unittest.testSuite(function() { |
| test('basic', function() { |
| var dd = document.createElement('tv-b-dropdown'); |
| dd.style.marginLeft = '50px'; |
| dd.style.width = '50px'; |
| dd.iconElement.textContent = 'Settings ' + String.fromCharCode(0x2699); |
| |
| dd.appendChild(tv.b.ui.createDiv({textContent: 'item 1'})); |
| dd.appendChild(tv.b.ui.createDiv({textContent: 'item 2 longer'})); |
| dd.appendChild(tv.b.ui.createDiv({textContent: 'item 3'})); |
| |
| var container = tv.b.ui.createDiv(); |
| container.style.height = '100px'; |
| container.appendChild(dd); |
| container.appendChild(tv.b.ui.createDiv({textContent: 'some text'})); |
| container.appendChild(tv.b.ui.createDiv({textContent: 'some more text'})); |
| container.appendChild(tv.b.ui.createDiv({textContent: 'more text'})); |
| this.addHTMLOutput(container); |
| |
| dd.show(); |
| dd.close(); |
| }); |
| |
| }); |
| </script> |