| <!DOCTYPE html> |
| <html> |
| <body> |
| |
| <script> |
| |
| function testClearPinnedItem() { |
| var list = document.createElement('ul'); |
| list.style.position = 'absolute'; |
| list.style.width = '800px'; |
| list.style.height = '800px'; |
| cr.ui.List.decorate(list); |
| document.body.appendChild(list); |
| |
| var model = new cr.ui.ArrayDataModel(['Item A', 'Item B']); |
| list.dataModel = model; |
| list.selectionModel.setIndexSelected(0, true); |
| list.selectionModel.leadIndex = 0; |
| list.ensureLeadItemExists(); |
| |
| list.style.height = '0px'; |
| model.splice(0, 1); |
| |
| list.style.height = '800px'; |
| list.redraw(); |
| assertEquals('Item B', |
| list.querySelectorAll('li')[0].textContent); |
| } |
| |
| </script> |
| |
| </body> |
| </html> |