| Index: chrome/test/data/webui/md_bookmarks/store_test.js
|
| diff --git a/chrome/test/data/webui/md_bookmarks/store_test.js b/chrome/test/data/webui/md_bookmarks/store_test.js
|
| index 554c23a06b7e00e10c5ff058a3557f17053d6909..22e0d5a669aa91298e01f752088cc0077f45cf4e 100644
|
| --- a/chrome/test/data/webui/md_bookmarks/store_test.js
|
| +++ b/chrome/test/data/webui/md_bookmarks/store_test.js
|
| @@ -261,6 +261,29 @@ suite('<bookmarks-store>', function() {
|
| assertEquals('http://www.google.com', store.idToNodeMap_['2'].url);
|
| });
|
|
|
| + test('adding a folder updates tree with new node', function() {
|
| + chrome.bookmarks.create = function(info) {};
|
| +
|
| + // Create a bookmark at end.
|
| + var parent = store.idToNodeMap_['8'];
|
| + var id = '9';
|
| + var config = {parentId: parent.id, index: parent.children.length};
|
| + store.onBookmarkCreated_(id, createItem(id, config));
|
| + var node = store.idToNodeMap_[id];
|
| + assertEquals(node, parent.children[config.index]);
|
| + assertEquals(parent.path + '.children.#' + config.index, node.path);
|
| + assertTrue('url' in node);
|
| +
|
| + // Create a folder at the beginning.
|
| + var id = '10';
|
| + config = {parentId: parent.id, index: 0};
|
| + store.onBookmarkCreated_(id, createFolder(id, [], config));
|
| + node = store.idToNodeMap_[id];
|
| + assertEquals(node, parent.children[config.index]);
|
| + assertEquals(parent.path + '.children.#' + config.index, node.path);
|
| + assertFalse('url' in node);
|
| + });
|
| +
|
| test('folder gets updated after renaming', function() {
|
| store.onBookmarkChanged_('3', {'title': 'Main Folder'});
|
| assertEquals('Main Folder', store.idToNodeMap_['3'].title);
|
|
|