| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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-router>', function() { | 5 suite('<bookmarks-router>', function() { |
| 6 var store; | 6 var store; |
| 7 var router; | 7 var router; |
| 8 | 8 |
| 9 function navigateTo(route) { | 9 function navigateTo(route) { |
| 10 window.history.replaceState({}, '', route); | 10 window.history.replaceState({}, '', route); |
| 11 window.dispatchEvent(new CustomEvent('location-changed')); | 11 window.dispatchEvent(new CustomEvent('location-changed')); |
| 12 } | 12 } |
| 13 | 13 |
| 14 setup(function() { | 14 setup(function() { |
| 15 store = new bookmarks.TestStore({ | 15 store = new bookmarks.TestStore({ |
| 16 selectedId: '1', | 16 selectedFolder: '1', |
| 17 search: { | 17 search: { |
| 18 term: '', | 18 term: '', |
| 19 }, | 19 }, |
| 20 }); | 20 }); |
| 21 bookmarks.Store.instance_ = store; | 21 bookmarks.Store.instance_ = store; |
| 22 | 22 |
| 23 router = document.createElement('bookmarks-router'); | 23 router = document.createElement('bookmarks-router'); |
| 24 replaceBody(router); | 24 replaceBody(router); |
| 25 }); | 25 }); |
| 26 | 26 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 } | 71 } |
| 72 | 72 |
| 73 if (window.searchedQuery) { | 73 if (window.searchedQuery) { |
| 74 verifySearch(window.searchedQuery); | 74 verifySearch(window.searchedQuery); |
| 75 return; | 75 return; |
| 76 } | 76 } |
| 77 | 77 |
| 78 chrome.bookmarks.search = verifySearch; | 78 chrome.bookmarks.search = verifySearch; |
| 79 }); | 79 }); |
| 80 }); | 80 }); |
| OLD | NEW |