OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 suite('<bookmarks-item>', function() { |
| 6 var item; |
| 7 var TEST_ITEM = { |
| 8 id: '0', url: 'http://www.google.com' |
| 9 }; |
| 10 |
| 11 setup(function() { |
| 12 item = document.createElement('bookmarks-item'); |
| 13 replaceBody(item); |
| 14 item.item = TEST_ITEM; |
| 15 }); |
| 16 |
| 17 test('changing the url changes the favicon', function() { |
| 18 var favicon = item.$.icon.style.backgroundImage; |
| 19 item.set('item.url', 'http://www.mail.google.com'); |
| 20 assertNotEquals(favicon, item.$.icon.style.backgroundImage); |
| 21 }); |
| 22 |
| 23 test('changing isFolder_ hides/unhides the folder/icon', function() { |
| 24 item.isFolder_ = true; |
| 25 assertFalse(item.$['folder-icon'].hidden); |
| 26 assertTrue(item.$.icon.hidden); |
| 27 |
| 28 item.isFolder_ = false; |
| 29 assertTrue(item.$['folder-icon'].hidden); |
| 30 assertFalse(item.$.icon.hidden); |
| 31 }); |
| 32 }); |
OLD | NEW |