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

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

Issue 2740863003: MD Bookmarks: Implement search and selection in new data flow system (Closed)
Patch Set: Review round 2 Created 3 years, 9 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 store; 7 var store;
8 var TEST_ITEM = createItem('0'); 8 var TEST_ITEM = createItem('0');
9 9
10 setup(function() { 10 setup(function() {
11 store = new bookmarks.TestStore({ 11 store = new bookmarks.TestStore({
12 nodes: testTree(createFolder('1', [createItem(['0'])])), 12 nodes: testTree(createFolder('1', [createItem(['2'])])),
13 }); 13 });
14 bookmarks.Store.instance_ = store; 14 bookmarks.Store.instance_ = store;
15 15
16 item = document.createElement('bookmarks-item'); 16 item = document.createElement('bookmarks-item');
17 item.itemId = '0'; 17 item.itemId = '2';
18 replaceBody(item); 18 replaceBody(item);
19 }); 19 });
20 20
21 test('changing the url changes the favicon', function() { 21 test('changing the url changes the favicon', function() {
22 var favicon = item.$.icon.style.backgroundImage; 22 var favicon = item.$.icon.style.backgroundImage;
23 store.data.nodes['0'] = createItem('0', {url: 'https://mail.google.com'}); 23 store.data.nodes['2'] = createItem('0', {url: 'https://mail.google.com'});
24 store.notifyObservers(); 24 store.notifyObservers();
25 assertNotEquals(favicon, item.$.icon.style.backgroundImage); 25 assertNotEquals(favicon, item.$.icon.style.backgroundImage);
26 }); 26 });
27 27
28 test('changing to folder hides/unhides the folder/icon', function() { 28 test('changing to folder hides/unhides the folder/icon', function() {
29 // Starts test as an item. 29 // Starts test as an item.
30 assertTrue(item.$['folder-icon'].hidden); 30 assertTrue(item.$['folder-icon'].hidden);
31 assertFalse(item.$.icon.hidden); 31 assertFalse(item.$.icon.hidden);
32 32
33 // Change to a folder. 33 // Change to a folder.
34 item.itemId = '1'; 34 item.itemId = '1';
35 35
36 assertFalse(item.$['folder-icon'].hidden); 36 assertFalse(item.$['folder-icon'].hidden);
37 assertTrue(item.$.icon.hidden); 37 assertTrue(item.$.icon.hidden);
38 }); 38 });
39 }); 39 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_bookmarks/util.js ('k') | chrome/test/data/webui/md_bookmarks/reducers_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698