| 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-app>', function() { | 5 suite('<bookmarks-app>', function() { |
| 6 var app; | 6 var app; |
| 7 var store; | 7 var store; |
| 8 | 8 |
| 9 function resetStore() { | 9 function resetStore() { |
| 10 store = new bookmarks.TestStore({}); | 10 store = new bookmarks.TestStore({}); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 resetStore(); | 49 resetStore(); |
| 50 app = document.createElement('bookmarks-app'); | 50 app = document.createElement('bookmarks-app'); |
| 51 replaceBody(app); | 51 replaceBody(app); |
| 52 | 52 |
| 53 // Ensure closed folders are read from local storage. | 53 // Ensure closed folders are read from local storage. |
| 54 assertDeepEquals(closedFoldersList, normalizeSet(store.data.closedFolders)); | 54 assertDeepEquals(closedFoldersList, normalizeSet(store.data.closedFolders)); |
| 55 }); | 55 }); |
| 56 | 56 |
| 57 test('write and load sidebar width', function() { | 57 test('write and load sidebar width', function() { |
| 58 assertEquals( | 58 assertEquals( |
| 59 app.$.sidebar.getComputedStyleValue('width'), app.sidebarWidth_); | 59 getComputedStyle(app.$.sidebar).width, app.sidebarWidth_); |
| 60 | 60 |
| 61 var sidebarWidth = '500px'; | 61 var sidebarWidth = '500px'; |
| 62 app.$.sidebar.style.width = sidebarWidth; | 62 app.$.sidebar.style.width = sidebarWidth; |
| 63 cr.dispatchSimpleEvent(app.$.splitter, 'resize'); | 63 cr.dispatchSimpleEvent(app.$.splitter, 'resize'); |
| 64 assertEquals( | 64 assertEquals( |
| 65 sidebarWidth, window.localStorage[LOCAL_STORAGE_TREE_WIDTH_KEY]); | 65 sidebarWidth, window.localStorage[LOCAL_STORAGE_TREE_WIDTH_KEY]); |
| 66 | 66 |
| 67 app = document.createElement('bookmarks-app'); | 67 app = document.createElement('bookmarks-app'); |
| 68 replaceBody(app); | 68 replaceBody(app); |
| 69 | 69 |
| 70 assertEquals(sidebarWidth, app.$.sidebar.style.width); | 70 assertEquals(sidebarWidth, app.$.sidebar.style.width); |
| 71 }); | 71 }); |
| 72 }); | 72 }); |
| OLD | NEW |