Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / test / data / webui / list_test.html
1 <!DOCTYPE html>
2 <html>
3 <body>
4
5 <script>
6
7 function testClearPinnedItem() {
8   var list = document.createElement('ul');
9   list.style.position = 'absolute';
10   list.style.width = '800px';
11   list.style.height = '800px';
12   cr.ui.List.decorate(list);
13   document.body.appendChild(list);
14
15   var model = new cr.ui.ArrayDataModel(['Item A', 'Item B']);
16   list.dataModel = model;
17   list.selectionModel.setIndexSelected(0, true);
18   list.selectionModel.leadIndex = 0;
19   list.ensureLeadItemExists();
20
21   list.style.height = '0px';
22   model.splice(0, 1);
23
24   list.style.height = '800px';
25   list.redraw();
26   assertEquals('Item B',
27                list.querySelectorAll('li')[0].textContent);
28 }
29
30 </script>
31
32 </body>
33 </html>