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

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

Issue 2639453002: [MD Bookmarks] Add Select for Bookmarks. (Closed)
Patch Set: 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..4f2c07918efb3f16daef54ca0af717f35028bca4 100644
--- a/chrome/test/data/webui/md_bookmarks/item_test.js
+++ b/chrome/test/data/webui/md_bookmarks/item_test.js
@@ -27,4 +27,31 @@ suite('<bookmarks-item>', function() {
assertTrue(item.$['folder-icon'].hidden);
assertFalse(item.$.icon.hidden);
});
+
+ test('pressing the buttons fires the right event', function() {
+ var shiftEventCount = 0;
+ var ctrlEventCount = 0;
+ var normalEventCount = 0;
+
+ document.addEventListener('select-single-item', function() {
+ normalEventCount++;
+ });
+ MockInteractions.tap(item);
+ assertEquals(1, normalEventCount);
+
+ document.addEventListener('shift-select-multiple-items', function() {
+ shiftEventCount++;
+ });
+ customClick(item, {shiftKey: true});
+ assertEquals(1, normalEventCount);
+ assertEquals(1, shiftEventCount);
+
+ document.addEventListener('ctrl-select-multiple-items', function() {
+ ctrlEventCount++;
+ });
+ customClick(item, {ctrlKey: true});
+ assertEquals(1, normalEventCount);
+ assertEquals(1, shiftEventCount);
+ assertEquals(1, ctrlEventCount);
+ });
});

Powered by Google App Engine
This is Rietveld 408576698