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

Side by Side Diff: chrome/test/data/webui/md_bookmarks/item_test.js

Issue 2613943003: [MD Bookmarks] Test Util (Closed)
Patch Set: style fix Created 3 years, 11 months 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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('<bookmarks-item>', function() { 5 suite('<bookmarks-item>', function() {
6 var item; 6 var item;
7 var TEST_ITEM = { 7 var TEST_ITEM = createItem('0');
8 id: '0', url: 'http://www.google.com'
9 };
10 8
11 setup(function() { 9 setup(function() {
12 item = document.createElement('bookmarks-item'); 10 item = document.createElement('bookmarks-item');
13 replaceBody(item); 11 replaceBody(item);
14 item.item = TEST_ITEM; 12 item.item = TEST_ITEM;
15 }); 13 });
16 14
17 test('changing the url changes the favicon', function() { 15 test('changing the url changes the favicon', function() {
18 var favicon = item.$.icon.style.backgroundImage; 16 var favicon = item.$.icon.style.backgroundImage;
19 item.set('item.url', 'http://www.mail.google.com'); 17 item.set('item.url', 'http://www.mail.google.com');
20 assertNotEquals(favicon, item.$.icon.style.backgroundImage); 18 assertNotEquals(favicon, item.$.icon.style.backgroundImage);
21 }); 19 });
22 20
23 test('changing isFolder_ hides/unhides the folder/icon', function() { 21 test('changing isFolder_ hides/unhides the folder/icon', function() {
24 item.isFolder_ = true; 22 item.isFolder_ = true;
25 assertFalse(item.$['folder-icon'].hidden); 23 assertFalse(item.$['folder-icon'].hidden);
26 assertTrue(item.$.icon.hidden); 24 assertTrue(item.$.icon.hidden);
27 25
28 item.isFolder_ = false; 26 item.isFolder_ = false;
29 assertTrue(item.$['folder-icon'].hidden); 27 assertTrue(item.$['folder-icon'].hidden);
30 assertFalse(item.$.icon.hidden); 28 assertFalse(item.$.icon.hidden);
31 }); 29 });
32 }); 30 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698