Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8739)

Unified Diff: chrome/test/data/webui/md_bookmarks/toolbar_test.js

Issue 2827573002: MD Bookmarks: Show toolbar overlay when multiple items are selected (Closed)
Patch Set: Review comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
+ });
+});

Powered by Google App Engine
This is Rietveld 408576698