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

Side by Side Diff: lib/src/iron-list/test/different-heights.html

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 | « lib/src/iron-list/iron-list.html ('k') | lib/src/iron-list/test/dynamic-item-size.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!doctype html>
2 <!--
3 @license
4 Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
5 This code may only be used under the BSD style license found at http://polymer.g ithub.io/LICENSE
6 The complete set of authors may be found at http://polymer.github.io/AUTHORS
7 The complete set of contributors may be found at http://polymer.github.io/CONTRI BUTORS
8 Code distributed by Google as part of the polymer project is also
9 subject to an additional IP rights grant found at http://polymer.github.io/PATEN TS
10 -->
11 <html>
12 <head>
13 <meta charset="UTF-8">
14 <title>iron-list test</title>
15 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum- scale=1.0">
16
17 <script src="../../webcomponentsjs/webcomponents-lite.js"></script>
18 <script src="../../web-component-tester/browser.js"></script>
19 <script src="../../test-fixture/test-fixture-mocha.js"></script>
20 <script src="../../iron-test-helpers/mock-interactions.js"></script>
21
22 <link rel="import" href="../../test-fixture/test-fixture.html">
23 <link rel="import" href="../../paper-styles/paper-styles.html">
24 <link rel="import" href="helpers.html">
25 <link rel="import" href="x-list.html">
26
27 </head>
28 <body>
29
30 <test-fixture id="trivialList">
31 <template>
32 <x-list></x-list>
33 </template>
34 </test-fixture>
35
36 <script>
37
38 suite('Different heights', function() {
39 var list, container;
40
41 setup(function() {
42 container = fixture('trivialList');
43 list = container.list;
44 });
45
46 test('render without gaps 1', function(done) {
47 list.items = [
48 {index: 0, height: 791},
49 {index: 1, height: 671}
50 ];
51
52 flush(function() {
53 list.push('items',
54 {index: 2, height: 251},
55 {index: 3, height: 191},
56 {index: 4, height: 151},
57 {index: 5, height: 191},
58 {index: 6, height: 51},
59 {index: 7, height: 51},
60 {index: 8, height: 51}
61 );
62
63 list.addEventListener('scroll', function() {
64 assert.isTrue(isFullOfItems(list));
65 });
66
67 simulateScroll({
68 list: list,
69 contribution: 15,
70 target: 100000
71 }, function() {
72 done();
73 });
74 });
75 });
76
77 test('render without gaps 2', function(done) {
78 var height = 2, items = [];
79
80 while (items.length < 15) {
81 items.push({height: height});
82 height *= 1.5;
83 }
84 list.items = items;
85
86 flush(function() {
87 list.addEventListener('scroll', function() {
88 assert.isTrue(isFullOfItems(list));
89 });
90
91 simulateScroll({
92 list: list,
93 contribution: 20,
94 target: 100000
95 }, function() {
96 done();
97 });
98 });
99 });
100
101 test('render without gaps 3', function(done) {
102 var heights = [20, 100, 140, 117, 800, 50, 15, 80, 90, 255, 20, 15, 19, 250, 314];
103
104 list.items = heights.map(function(height) {
105 return {height: height};
106 });
107
108 flush(function() {
109 list.addEventListener('scroll', function() {
110 assert.isTrue(isFullOfItems(list));
111 });
112
113 simulateScroll({
114 list: list,
115 contribution: 20,
116 target: 100000
117 }, function() {
118 done();
119 });
120 });
121 });
122
123 });
124
125 </script>
126
127 </body>
128 </html>
OLDNEW
« no previous file with comments | « lib/src/iron-list/iron-list.html ('k') | lib/src/iron-list/test/dynamic-item-size.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698