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

Unified Diff: chrome/test/data/webui/md_history/history_item_test.js

Issue 2409063003: MD History: Select items when tapping anywhere inside the item (Closed)
Patch Set: Remove <a> test Created 4 years, 1 month 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_history/history_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_history/history_item_test.js
diff --git a/chrome/test/data/webui/md_history/history_item_test.js b/chrome/test/data/webui/md_history/history_item_test.js
index 7b5ab0de1912ed9f36aa7ccecb79a11cdce1d5ec..e91a5f5c5ebaea73699981b82c5680bac00f4a5c 100644
--- a/chrome/test/data/webui/md_history/history_item_test.js
+++ b/chrome/test/data/webui/md_history/history_item_test.js
@@ -10,7 +10,6 @@ cr.define('md_history.history_item_test', function() {
var SEARCH_HISTORY_RESULTS;
suiteSetup(function() {
- element = $('history-app').$['history'].$['infinite-list'];
TEST_HISTORY_RESULTS = [
createHistoryEntry('2016-03-16 10:00', 'http://www.google.com'),
createHistoryEntry('2016-03-16 9:00', 'http://www.example.com'),
@@ -27,6 +26,10 @@ cr.define('md_history.history_item_test', function() {
];
});
+ setup(function() {
+ element = replaceApp().$['history'].$['infinite-list'];
+ });
+
test('basic separator insertion', function() {
element.addNewResults(TEST_HISTORY_RESULTS);
return PolymerTest.flushTasks().then(function() {
@@ -97,9 +100,27 @@ cr.define('md_history.history_item_test', function() {
});
});
- teardown(function() {
- element.historyData_ = [];
- element.searchedTerm = '';
+ test('click targets for selection', function() {
+ var item = document.createElement('history-item');
+ var selectionCount = 0;
+ item.item = TEST_HISTORY_RESULTS[0];
+ item.addEventListener('history-checkbox-select', function() {
+ selectionCount++;
+ });
+
+ replaceBody(item);
+
+ // Checkbox should trigger selection.
+ MockInteractions.tap(item.$.checkbox);
+ assertEquals(1, selectionCount);
+
+ // Non-interactive text should trigger selection.
+ MockInteractions.tap(item.$['time-accessed']);
+ assertEquals(2, selectionCount);
+
+ // Menu button should not trigger selection.
+ MockInteractions.tap(item.$['menu-button']);
+ assertEquals(2, selectionCount);
});
});
}
« no previous file with comments | « chrome/browser/resources/md_history/history_item.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698