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

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

Issue 2639453002: [MD Bookmarks] Add Select for Bookmarks. (Closed)
Patch Set: add removeChild Created 3 years, 11 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/item_test.js
diff --git a/chrome/test/data/webui/md_bookmarks/item_test.js b/chrome/test/data/webui/md_bookmarks/item_test.js
index e97f7f2464762021b298f05e974ee73dcfd8fa5b..8c1507fc48df215691a3a171a1fe535e9b97d21a 100644
--- a/chrome/test/data/webui/md_bookmarks/item_test.js
+++ b/chrome/test/data/webui/md_bookmarks/item_test.js
@@ -27,4 +27,28 @@ suite('<bookmarks-item>', function() {
assertTrue(item.$['folder-icon'].hidden);
assertFalse(item.$.icon.hidden);
});
+
+ test('pressing the buttons fires the right event', function() {
+ var counter = [0, 0, 0];
+ document.addEventListener('select-item', function(e) {
+ if (e.detail.range)
+ counter[0]++;
+ else if (e.detail.add)
+ counter[1]++;
+ else
+ counter[2]++;
+ });
+
+ customClick(item);
+ assertDeepEquals([0, 0, 1], counter);
+
+ customClick(item, {shiftKey: true});
+ assertDeepEquals([1, 0, 1], counter);
+
+ customClick(item, {ctrlKey: true});
+ assertDeepEquals([1, 1, 1], counter);
+
+ customClick(item, {shiftKey: true, ctrlKey: true});
+ assertDeepEquals([2, 1, 1], counter);
+ });
});

Powered by Google App Engine
This is Rietveld 408576698