| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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('layout tests', function() { | 5 suite('layout tests', function() { |
| 6 /** @type {!downloads.Manager} */ | 6 /** @type {!downloads.Manager} */ |
| 7 var manager; | 7 var manager; |
| 8 | 8 |
| 9 setup(function() { | 9 setup(function() { |
| 10 PolymerTest.clearBody(); | 10 PolymerTest.clearBody(); |
| 11 manager = document.createElement('downloads-manager'); | 11 manager = document.createElement('downloads-manager'); |
| 12 document.body.appendChild(manager); | 12 document.body.appendChild(manager); |
| 13 assertEquals(manager, downloads.Manager.get()); | 13 assertEquals(manager, downloads.Manager.get()); |
| 14 }); | 14 }); |
| 15 | 15 |
| 16 test('long URLs ellide', function() { | 16 test('long URLs ellide', function() { |
| 17 downloads.Manager.insertItems(0, [{ | 17 downloads.Manager.insertItems(0, [{ |
| 18 file_name: 'file name', | 18 file_name: 'file name', |
| 19 state: downloads.States.COMPLETE, | 19 state: downloads.States.COMPLETE, |
| 20 url: 'a'.repeat(1000), | 20 url: 'a'.repeat(1000), |
| 21 }]); | 21 }]); |
| 22 | 22 |
| 23 Polymer.dom.flush(); | 23 Polymer.dom.flush(); |
| 24 | 24 |
| 25 var item = manager.$$('downloads-item'); | 25 var item = manager.$$('downloads-item'); |
| 26 assertLT(item.$$('#url').offsetWidth, item.offsetWidth); | 26 assertLT(item.$$('#url').offsetWidth, item.offsetWidth); |
| 27 assertEquals(300, item.$$('#url').textContent.length); |
| 27 }); | 28 }); |
| 28 }); | 29 }); |
| OLD | NEW |