| OLD | NEW |
| 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 function replaceStore() { | 9 function replaceStore() { |
| 10 store = document.createElement('bookmarks-store'); | 10 store = document.createElement('bookmarks-store'); |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 | 216 |
| 217 // Edit url and title updates idToNodeMap_ properly. | 217 // Edit url and title updates idToNodeMap_ properly. |
| 218 store.onBookmarkChanged_('2', { | 218 store.onBookmarkChanged_('2', { |
| 219 'title': 'test', | 219 'title': 'test', |
| 220 'url': 'http://www.google.com', | 220 'url': 'http://www.google.com', |
| 221 }); | 221 }); |
| 222 assertEquals('test', store.idToNodeMap_['2'].title); | 222 assertEquals('test', store.idToNodeMap_['2'].title); |
| 223 assertEquals('http://www.google.com', store.idToNodeMap_['2'].url); | 223 assertEquals('http://www.google.com', store.idToNodeMap_['2'].url); |
| 224 }); | 224 }); |
| 225 | 225 |
| 226 test('folder gets updated after renaming', function() { |
| 227 store.onBookmarkChanged_('3', {'title': 'Main Folder'}); |
| 228 assertEquals('Main Folder', store.idToNodeMap_['3'].title); |
| 229 assertEquals(undefined, store.idToNodeMap_['3'].url); |
| 230 }); |
| 231 |
| 226 ////////////////////////////////////////////////////////////////////////////// | 232 ////////////////////////////////////////////////////////////////////////////// |
| 227 // search tests: | 233 // search tests: |
| 228 | 234 |
| 229 test('displayedList updates after searchTerm changes', function() { | 235 test('displayedList updates after searchTerm changes', function() { |
| 230 var SEARCH_RESULTS = [ | 236 var SEARCH_RESULTS = [ |
| 231 'cat', | 237 'cat', |
| 232 'apple', | 238 'apple', |
| 233 'Paris', | 239 'Paris', |
| 234 ]; | 240 ]; |
| 235 overrideBookmarksSearch(SEARCH_RESULTS); | 241 overrideBookmarksSearch(SEARCH_RESULTS); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 replaceStore(); | 308 replaceStore(); |
| 303 assertEquals(selectedId, store.selectedId); | 309 assertEquals(selectedId, store.selectedId); |
| 304 }); | 310 }); |
| 305 | 311 |
| 306 test('route updates from selectedId', function() { | 312 test('route updates from selectedId', function() { |
| 307 var selectedId = '2'; | 313 var selectedId = '2'; |
| 308 store.selectedId = selectedId; | 314 store.selectedId = selectedId; |
| 309 assertEquals('chrome://bookmarks/?id=' + selectedId, window.location.href); | 315 assertEquals('chrome://bookmarks/?id=' + selectedId, window.location.href); |
| 310 }); | 316 }); |
| 311 }); | 317 }); |
| OLD | NEW |