Index: chrome/test/data/webui/md_bookmarks/toolbar_test.js |
diff --git a/chrome/test/data/webui/md_bookmarks/toolbar_test.js b/chrome/test/data/webui/md_bookmarks/toolbar_test.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1cd78ffb9c9a0bae3d3f9f503ffb0e212e8e7ca5 |
--- /dev/null |
+++ b/chrome/test/data/webui/md_bookmarks/toolbar_test.js |
@@ -0,0 +1,37 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+suite('<bookmarks-toolbar>', function() { |
+ var toolbar; |
+ var store; |
+ |
+ setup(function() { |
+ store = new bookmarks.TestStore({ |
+ nodes: testTree(createFolder('1', [ |
+ createItem('2'), |
+ createItem('3'), |
+ ])), |
+ selection: { |
+ items: new Set(), |
+ anchor: null, |
+ }, |
+ }); |
+ bookmarks.Store.instance_ = store; |
+ |
+ toolbar = document.createElement('bookmarks-toolbar'); |
+ replaceBody(toolbar); |
+ }); |
+ |
+ test('selecting multiple items shows toolbar overlay', function() { |
+ assertFalse(toolbar.showSelectionOverlay); |
+ |
+ store.data.selection.items = new Set(['2']); |
+ store.notifyObservers(); |
+ assertFalse(toolbar.showSelectionOverlay); |
+ |
+ store.data.selection.items = new Set(['2', '3']); |
+ store.notifyObservers(); |
+ assertTrue(toolbar.showSelectionOverlay); |
+ }); |
+}); |