| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 @TestOn('browser') | 4 @TestOn('browser') |
| 5 library polymer_elements.test.iron_list_hidden_test; | 5 library polymer_elements.test.iron_list_hidden_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 import 'dart:js'; | 9 import 'dart:js'; |
| 10 import 'package:polymer/polymer.dart'; | 10 import 'package:polymer/polymer.dart'; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 list = container.list; | 27 list = container.list; |
| 28 }); | 28 }); |
| 29 | 29 |
| 30 test('list size', () async { | 30 test('list size', () async { |
| 31 list.items = buildDataSet(100); | 31 list.items = buildDataSet(100); |
| 32 await wait(1); | 32 await wait(1); |
| 33 expect(list.offsetWidth, 0); | 33 expect(list.offsetWidth, 0); |
| 34 expect(list.offsetHeight, 0); | 34 expect(list.offsetHeight, 0); |
| 35 }); | 35 }); |
| 36 | 36 |
| 37 test('resize', () { | 37 test('iron-resize', () { |
| 38 var done = new Completer(); | 38 var done = new Completer(); |
| 39 list.items = buildDataSet(100); | 39 list.items = buildDataSet(100); |
| 40 list.fire('resize'); | 40 list.fire('iron-resize'); |
| 41 | 41 |
| 42 expect(getFirstItemFromList(list).text, isNot('0')); | 42 expect(getFirstItemFromList(list).text, isNot('0')); |
| 43 context['Polymer']['RenderStatus'].callMethod('whenReady', [() async { | 43 context['Polymer']['RenderStatus'].callMethod('whenReady', [() async { |
| 44 container.attributes.remove('hidden'); | 44 container.attributes.remove('hidden'); |
| 45 | 45 |
| 46 expect(getFirstItemFromList(list).text, isNot('0')); | 46 expect(getFirstItemFromList(list).text, isNot('0')); |
| 47 list.fire('resize'); | 47 list.fire('iron-resize'); |
| 48 await wait(1); | 48 await wait(1); |
| 49 | 49 |
| 50 expect(list.jsElement['isAttached'], isTrue); | 50 expect(list.jsElement['isAttached'], isTrue); |
| 51 expect(getFirstItemFromList(list).text, '0'); | 51 expect(getFirstItemFromList(list).text, '0'); |
| 52 done.complete(); | 52 done.complete(); |
| 53 }]); | 53 }]); |
| 54 | 54 |
| 55 return done.future; | 55 return done.future; |
| 56 }); | 56 }); |
| 57 }); | 57 }); |
| 58 } | 58 } |
| OLD | NEW |