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

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

Issue 2972773003: MD Bookmarks: Always select targeted item during doubleclick (Closed)
Patch Set: Fix nit Created 3 years, 5 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
« no previous file with comments | « chrome/browser/resources/md_bookmarks/item.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 94436d10fc5df58dacc2ceb881e944191549faae..d03968a50b5b8e9319dcc427ddc800416b2e4fd2 100644
--- a/chrome/test/data/webui/md_bookmarks/item_test.js
+++ b/chrome/test/data/webui/md_bookmarks/item_test.js
@@ -53,13 +53,13 @@ suite('<bookmarks-item>', function() {
store.lastAction);
});
- test('context menu selects item if unselected', function() {
+ function testEventSelection(eventname) {
item.isSelectedItem_ = true;
- item.dispatchEvent(new MouseEvent('contextmenu'));
+ item.dispatchEvent(new MouseEvent(eventname));
assertEquals(null, store.lastAction);
item.isSelectedItem_ = false;
- item.dispatchEvent(new MouseEvent('contextmenu'));
+ item.dispatchEvent(new MouseEvent(eventname));
assertDeepEquals(
bookmarks.actions.selectItem('2', store.data, {
clear: true,
@@ -67,5 +67,15 @@ suite('<bookmarks-item>', function() {
toggle: false,
}),
store.lastAction);
+ }
+
+ test('context menu selects item if unselected', function() {
+ testEventSelection('contextmenu');
+ });
+
+ test('doubleclicking selects item if unselected', function() {
+ document.body.appendChild(
+ document.createElement('bookmarks-command-manager'));
+ testEventSelection('dblclick');
});
});
« no previous file with comments | « chrome/browser/resources/md_bookmarks/item.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698