| 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);
|
| });
|
| });
|
| }
|
|
|