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

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

Issue 2684693004: MD History: Remove list-container and list-behavior (Closed)
Patch Set: Rename listeners Created 3 years, 10 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_history/history_list_test.js
diff --git a/chrome/test/data/webui/md_history/history_list_test.js b/chrome/test/data/webui/md_history/history_list_test.js
index 8fb2ddafa6067b7ca1b9695bbe2bed29b6abfe47..f37ea4e5206e83c047f295d526d53cf82b8bb779 100644
--- a/chrome/test/data/webui/md_history/history_list_test.js
+++ b/chrome/test/data/webui/md_history/history_list_test.js
@@ -28,8 +28,8 @@ suite('<history-list>', function() {
setup(function() {
app = replaceApp();
- element = app.$['history'].$['infinite-list'];
- toolbar = app.$['toolbar'];
+ element = app.$.history;
+ toolbar = app.$.toolbar;
app.queryState_.incremental = true;
});
@@ -96,63 +96,46 @@ suite('<history-list>', function() {
MockInteractions.tap(items[1].$.checkbox);
assertDeepEquals([false, true, false, false],
element.historyData_.map(i => i.selected));
- assertDeepEquals(
- ['historyData_.1'],
- Array.from(element.selectedPaths).sort());
+ assertDeepEquals([1], Array.from(element.selectedItems).sort());
// Shift-select to the last item.
shiftClick(items[3].$.checkbox);
assertDeepEquals([false, true, true, true],
element.historyData_.map(i => i.selected));
- assertDeepEquals(
- ['historyData_.1', 'historyData_.2', 'historyData_.3'],
- Array.from(element.selectedPaths).sort());
+ assertDeepEquals([1, 2, 3], Array.from(element.selectedItems).sort());
// Shift-select back to the first item.
shiftClick(items[0].$.checkbox);
assertDeepEquals([true, true, true, true],
element.historyData_.map(i => i.selected));
- assertDeepEquals(
- [
- 'historyData_.0', 'historyData_.1', 'historyData_.2',
- 'historyData_.3'
- ],
- Array.from(element.selectedPaths).sort());
+ assertDeepEquals([0, 1, 2, 3], Array.from(element.selectedItems).sort());
// Shift-deselect to the third item.
shiftClick(items[2].$.checkbox);
assertDeepEquals([false, false, false, true],
element.historyData_.map(i => i.selected));
- assertDeepEquals(
- ['historyData_.3'],
- Array.from(element.selectedPaths).sort());
+ assertDeepEquals([3], Array.from(element.selectedItems).sort());
// Select the second item.
MockInteractions.tap(items[1].$.checkbox);
assertDeepEquals([false, true, false, true],
element.historyData_.map(i => i.selected));
- assertDeepEquals(
- ['historyData_.1', 'historyData_.3'],
- Array.from(element.selectedPaths).sort());
+ assertDeepEquals([1, 3], Array.from(element.selectedItems).sort());
// Shift-deselect to the last item.
shiftClick(items[3].$.checkbox);
assertDeepEquals([false, false, false, false],
element.historyData_.map(i => i.selected));
- assertDeepEquals(
- [],
- Array.from(element.selectedPaths).sort());
+ assertDeepEquals([], Array.from(element.selectedItems).sort());
// Shift-select back to the third item.
shiftClick(items[2].$.checkbox);
assertDeepEquals([false, false, true, true],
element.historyData_.map(i => i.selected));
- assertDeepEquals(
- ['historyData_.2', 'historyData_.3'],
- Array.from(element.selectedPaths).sort());
+ assertDeepEquals([2, 3], Array.from(element.selectedItems).sort());
// Remove selected items.
- element.removeItemsByPath(Array.from(element.selectedPaths));
+ element.removeItemsByIndex_(Array.from(element.selectedItems));
assertDeepEquals(
['https://www.google.com', 'https://www.example.com'],
element.historyData_.map(i => i.title));
@@ -196,9 +179,7 @@ suite('<history-list>', function() {
app.historyResult(createHistoryInfo(), ADDITIONAL_RESULTS);
return PolymerTest.flushTasks().then(function() {
- element.removeItemsByPath([
- 'historyData_.2', 'historyData_.5', 'historyData_.7'
- ]);
+ element.removeItemsByIndex_([2, 5, 7]);
return PolymerTest.flushTasks();
}).then(function() {
« no previous file with comments | « chrome/test/data/webui/md_history/history_item_test.js ('k') | chrome/test/data/webui/md_history/history_metrics_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698