Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Side by Side Diff: test/iron_list_hidden_test.dart

Issue 1418513006: update elements and fix some bugs (Closed) Base URL: git@github.com:dart-lang/polymer_elements.git@master
Patch Set: code review updates Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/iron_list_dynamic_item_size_test.html ('k') | test/iron_list_mutations_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « test/iron_list_dynamic_item_size_test.html ('k') | test/iron_list_mutations_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698