OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 suite('<bookmarks-toolbar>', function() { |
| 6 var toolbar; |
| 7 var store; |
| 8 |
| 9 setup(function() { |
| 10 store = new bookmarks.TestStore({ |
| 11 nodes: testTree(createFolder('1', [ |
| 12 createItem('2'), |
| 13 createItem('3'), |
| 14 ])), |
| 15 selection: { |
| 16 items: new Set(), |
| 17 anchor: null, |
| 18 }, |
| 19 }); |
| 20 bookmarks.Store.instance_ = store; |
| 21 |
| 22 toolbar = document.createElement('bookmarks-toolbar'); |
| 23 replaceBody(toolbar); |
| 24 }); |
| 25 |
| 26 test('selecting multiple items shows toolbar overlay', function() { |
| 27 assertFalse(toolbar.showSelectionOverlay); |
| 28 |
| 29 store.data.selection.items = new Set(['2']); |
| 30 store.notifyObservers(); |
| 31 assertFalse(toolbar.showSelectionOverlay); |
| 32 |
| 33 store.data.selection.items = new Set(['2', '3']); |
| 34 store.notifyObservers(); |
| 35 assertTrue(toolbar.showSelectionOverlay); |
| 36 }); |
| 37 }); |
OLD | NEW |