Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 suite('cr-scrollable-behavior', function() { | 5 suite('cr-scrollable-behavior', function() { |
| 6 /** @type {CrScrollableListElement} */ var testElement; | 6 /** @type {CrScrollableListElement} */ var testElement; |
| 7 /** @type {HTMLDivElement} */ var container; | 7 /** @type {HTMLDivElement} */ var container; |
| 8 /** @type {IronListElement} */ var ironList; | 8 /** @type {IronListElement} */ var ironList; |
| 9 | 9 |
| 10 suiteSetup(function() { | 10 suiteSetup(function() { |
| 11 document.body.innerHTML = ` | 11 document.body.innerHTML = ` |
| 12 <dom-module is="test-element"> | 12 <dom-module is="test-element"> |
| 13 <template> | 13 <template> |
| 14 <style> | 14 <style> |
| 15 #container { | 15 #container { |
| 16 height: 30px; | 16 height: 30px; |
| 17 overflow-y: auto; | 17 overflow-y: auto; |
| 18 } | 18 } |
| 19 </style> | 19 </style> |
| 20 <div id="container" scrollable> | 20 <div id="container" scrollable> |
| 21 <iron-list scroll-target="container" items=[[items]]> | 21 <iron-list scroll-target="container" items="[[items]]"> |
|
dpapad
2017/05/19 19:35:19
Was this caught by a PRESUBMIT? I recall that we a
dschuyler
2017/05/19 19:37:10
It wasn't. I was grepping for issues (just lookin'
| |
| 22 <template> | 22 <template> |
| 23 <div>[[item]]</div> | 23 <div>[[item]]</div> |
| 24 </template> | 24 </template> |
| 25 </iron-list> | 25 </iron-list> |
| 26 </div> | 26 </div> |
| 27 </template> | 27 </template> |
| 28 </dom-module> | 28 </dom-module> |
| 29 `; | 29 `; |
| 30 | 30 |
| 31 Polymer({ | 31 Polymer({ |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 86 testElement.saveScroll(ironList); | 86 testElement.saveScroll(ironList); |
| 87 testElement.items = ['apple', 'bannana', 'cactus', 'cucumber', 'doughnut']; | 87 testElement.items = ['apple', 'bannana', 'cactus', 'cucumber', 'doughnut']; |
| 88 testElement.restoreScroll(ironList); | 88 testElement.restoreScroll(ironList); |
| 89 Polymer.dom.flush(); | 89 Polymer.dom.flush(); |
| 90 Polymer.Base.async(function() { | 90 Polymer.Base.async(function() { |
| 91 assertEquals(scrollTop, container.scrollTop); | 91 assertEquals(scrollTop, container.scrollTop); |
| 92 done(); | 92 done(); |
| 93 }); | 93 }); |
| 94 }); | 94 }); |
| 95 }); | 95 }); |
| OLD | NEW |