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

Side by Side Diff: chrome/test/data/webui/md_bookmarks/store_test.js

Issue 2675503002: [MD Bookmarks] Remove Multiple Selected Items. (Closed)
Patch Set: add test 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/md_bookmarks/store.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 suite('<bookmarks-store>', function() { 5 suite('<bookmarks-store>', function() {
6 var store; 6 var store;
7 var TEST_TREE; 7 var TEST_TREE;
8 8
9 function replaceStore() { 9 function replaceStore() {
10 store = document.createElement('bookmarks-store'); 10 store = document.createElement('bookmarks-store');
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 store.fire('select-item', {item: store.displayedList[0]}); 496 store.fire('select-item', {item: store.displayedList[0]});
497 store.fire( 497 store.fire(
498 'select-item', {item: store.displayedList[2], add: true, range: false}); 498 'select-item', {item: store.displayedList[2], add: true, range: false});
499 store.fire( 499 store.fire(
500 'select-item', {item: store.displayedList[4], add: true, range: true}); 500 'select-item', {item: store.displayedList[4], add: true, range: true});
501 assertDeepEquals( 501 assertDeepEquals(
502 [true, false, true, true, true], 502 [true, false, true, true, true],
503 store.displayedList.map(i => i.isSelectedItem)); 503 store.displayedList.map(i => i.isSelectedItem));
504 assertEquals(2, store.anchorIndex_); 504 assertEquals(2, store.anchorIndex_);
505 }); 505 });
506
507 test('deleting multiple selected items', function() {
508 var deleteCount = 0;
509 chrome.bookmarks.removeTree = function() {
510 deleteCount++;
511 };
512 chrome.bookmarks.remove = function() {
513 deleteCount++;
514 };
515
516 store.fire('select-item', {item: store.displayedList[0]});
517 store.fire(
518 'select-item', {item: store.displayedList[2], add: true, range: false});
519 store.fire('remove-item', store.displayedList[2]);
520 assertEquals(2, deleteCount);
521 });
506 }); 522 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_bookmarks/store.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698