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

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

Issue 2617943002: [MD Bookmarks] Edit Bookmarks. (Closed)
Patch Set: test 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-store>', function() { 5 suite('<bookmarks-store>', function() {
6 var store; 6 var store;
7 var TEST_TREE; 7 var TEST_TREE;
8 8
9 setup(function() { 9 setup(function() {
10 TEST_TREE = createFolder('0', [ 10 TEST_TREE = createFolder('0', [
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 store.onBookmarkRemoved_('2', {parentId:'1', index:'0'}); 160 store.onBookmarkRemoved_('2', {parentId:'1', index:'0'});
161 assertTrue(store.idToNodeMap_['1'].isSelected); 161 assertTrue(store.idToNodeMap_['1'].isSelected);
162 assertEquals('1', store.selectedId); 162 assertEquals('1', store.selectedId);
163 163
164 // A folder with selected folder in it gets removed. 164 // A folder with selected folder in it gets removed.
165 store.selectedId = '3'; 165 store.selectedId = '3';
166 store.onBookmarkRemoved_('1', {parentId:'0', index:'0'}); 166 store.onBookmarkRemoved_('1', {parentId:'0', index:'0'});
167 assertTrue(store.idToNodeMap_['0'].isSelected); 167 assertTrue(store.idToNodeMap_['0'].isSelected);
168 assertEquals('0', store.selectedId); 168 assertEquals('0', store.selectedId);
169 }); 169 });
170
171 test('bookmark gets updated after editing', function() {
172 // Edit title updates idToNodeMap_ properly.
173 store.onBookmarkChanged_('4', {'title': 'test'});
174 assertEquals('test', store.idToNodeMap_['4'].title);
175 assertEquals('link4', store.idToNodeMap_['4'].url);
176
177 // Edit url updates idToNodeMap_ properly.
178 store.onBookmarkChanged_('5', {'url': 'http://www.google.com'});
179 assertEquals('', store.idToNodeMap_['5'].title);
180 assertEquals('http://www.google.com', store.idToNodeMap_['5'].url);
181
182 // Edit url and title updates idToNodeMap_ properly.
183 store.onBookmarkChanged_('2', {
184 'title': 'test',
185 'url': 'http://www.google.com',
186 });
187 assertEquals('test', store.idToNodeMap_['2'].title);
188 assertEquals('http://www.google.com', store.idToNodeMap_['2'].url);
189 });
170 }); 190 });
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.cc ('k') | components/bookmark_component_strings.grdp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698