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

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

Issue 2812493002: MD Bookmarks: Restore any previously selected folder when clearing search (Closed)
Patch Set: Fix comment Created 3 years, 8 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
« no previous file with comments | « chrome/test/data/webui/md_bookmarks/router_test.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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-sidebar>', function() { 5 suite('<bookmarks-sidebar>', function() {
6 var sidebar; 6 var sidebar;
7 var store; 7 var store;
8 8
9 setup(function() { 9 setup(function() {
10 store = new bookmarks.TestStore({ 10 store = new bookmarks.TestStore({
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 assertEquals('0', f.style.getPropertyValue('--node-depth')); 63 assertEquals('0', f.style.getPropertyValue('--node-depth'));
64 }); 64 });
65 Array.prototype.forEach.call(firstGen, function(f) { 65 Array.prototype.forEach.call(firstGen, function(f) {
66 assertEquals(1, f.depth); 66 assertEquals(1, f.depth);
67 assertEquals('1', f.style.getPropertyValue('--node-depth')); 67 assertEquals('1', f.style.getPropertyValue('--node-depth'));
68 }); 68 });
69 Array.prototype.forEach.call(secondGen, function(f) { 69 Array.prototype.forEach.call(secondGen, function(f) {
70 assertEquals(2, f.depth); 70 assertEquals(2, f.depth);
71 assertEquals('2', f.style.getPropertyValue('--node-depth')); 71 assertEquals('2', f.style.getPropertyValue('--node-depth'));
72 }); 72 });
73 }) 73 });
74
75 test('doesn\'t highlight selected folder while searching', function() {
76 var rootFolders =
77 sidebar.$['folder-tree'].querySelectorAll('bookmarks-folder-node');
78
79 store.data.selectedFolder = '1';
80 store.notifyObservers();
81
82 assertEquals('1', rootFolders['0'].itemId);
83 assertTrue(rootFolders['0'].isSelectedFolder_);
84
85 store.data.search = {
86 term: 'test',
87 inProgress: false,
88 results: ['3'],
89 };
90 store.notifyObservers();
91
92 assertFalse(rootFolders['0'].isSelectedFolder_);
93 });
74 }); 94 });
OLDNEW
« no previous file with comments | « chrome/test/data/webui/md_bookmarks/router_test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698