(layout, validate, complete)
| 126 | } |
| 127 | |
| 128 | function verifyTreeUpdate(layout, validate, complete) { |
| 129 | WinJS.UI._VirtualizeContentsView._chunkSize = 15; |
| 130 | WinJS.UI._VirtualizeContentsView._maxTimePerCreateContainers = Number.MAX_VALUE; |
| 131 | |
| 132 | var placeholder = createListViewElement(); |
| 133 | |
| 134 | var list = new WinJS.Binding.List(initData()), |
| 135 | listView = new ListView(placeholder, { |
| 136 | itemDataSource: list.dataSource, |
| 137 | itemTemplate: generateRenderer("50px"), |
| 138 | layout: layout |
| 139 | }); |
| 140 | |
| 141 | listView.selection.set([0, 5, 10]); |
| 142 | |
| 143 | return Helper.ListView.waitForReady(listView)().then(function () { |
| 144 | |
| 145 | validate(listView); |
| 146 | |
| 147 | list.splice(9, 1); |
| 148 | list.shift(); |
| 149 | list.shift(); |
| 150 | list.shift(); |
| 151 | list.unshift({ |
| 152 | title: "NewItem0", |
| 153 | group: 0 |
| 154 | }); |
| 155 | |
| 156 | return Helper.ListView.waitForReady(listView, -1)(); |
| 157 | }).then(function () { |
| 158 | |
| 159 | validate(listView); |
| 160 | |
| 161 | for (var i = 0; i < 10; i++) { |
| 162 | list.unshift({ |
| 163 | title: "NI" + i, |
| 164 | group: 0 |
| 165 | }); |
| 166 | } |
| 167 | |
| 168 | return Helper.ListView.waitForReady(listView, -1)(); |
| 169 | }).then(function () { |
| 170 | |
| 171 | validate(listView); |
| 172 | |
| 173 | while (list.length) { |
| 174 | list.pop(); |
| 175 | } |
| 176 | |
| 177 | return Helper.ListView.waitForReady(listView, -1)(); |
| 178 | }).then(function () { |
| 179 | |
| 180 | validate(listView); |
| 181 | |
| 182 | list.unshift({ |
| 183 | title: "SNI", |
| 184 | group: 0 |
| 185 | }); |
no test coverage detected