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

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

Issue 2823053003: [MD Bookmarks] Remove the bookmarks-sidebar element. (Closed)
Patch Set: rebase, address comments Created 3 years, 8 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/test/data/webui/md_bookmarks/md_bookmarks_browsertest.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/sidebar_test.js
diff --git a/chrome/test/data/webui/md_bookmarks/sidebar_test.js b/chrome/test/data/webui/md_bookmarks/sidebar_test.js
deleted file mode 100644
index 097ba79e27d48bbffc1bb574c509606f58de95be..0000000000000000000000000000000000000000
--- a/chrome/test/data/webui/md_bookmarks/sidebar_test.js
+++ /dev/null
@@ -1,94 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-suite('<bookmarks-sidebar>', function() {
- var sidebar;
- var store;
-
- setup(function() {
- store = new bookmarks.TestStore({
- nodes: testTree(
- createFolder(
- '1',
- [
- createFolder(
- '2',
- [
- createFolder('3', []),
- createFolder('4', []),
- ]),
- createItem('5'),
- ]),
- createFolder('7', [])),
- });
- bookmarks.Store.instance_ = store;
-
- sidebar = document.createElement('bookmarks-sidebar');
- replaceBody(sidebar);
- Polymer.dom.flush();
- });
-
- test('selecting and deselecting folders dispatches action', function() {
- var rootFolders =
- sidebar.$['folder-tree'].querySelectorAll('bookmarks-folder-node');
- var firstGen = rootFolders[0].$['descendants'].querySelectorAll(
- 'bookmarks-folder-node');
- var secondGen =
- firstGen[0].$['descendants'].querySelectorAll('bookmarks-folder-node');
-
- // Select nested folder.
- firedId = '';
- MockInteractions.tap(secondGen[0].$['folder-label']);
- assertEquals('select-folder', store.lastAction.name);
- assertEquals(secondGen[0].itemId, store.lastAction.id);
-
- // Select folder in a separate subtree.
- firedId = '';
- MockInteractions.tap(rootFolders[1].$['folder-label']);
- assertEquals('select-folder', store.lastAction.name);
- assertEquals(rootFolders[1].itemId, store.lastAction.id);
- });
-
- test('depth calculation', function() {
- var rootFolders =
- sidebar.$['folder-tree'].querySelectorAll('bookmarks-folder-node');
- var firstGen = rootFolders[0].$['descendants'].querySelectorAll(
- 'bookmarks-folder-node');
- var secondGen =
- firstGen[0].$['descendants'].querySelectorAll('bookmarks-folder-node');
-
- Array.prototype.forEach.call(rootFolders, function(f) {
- assertEquals(0, f.depth);
- assertEquals('0', f.style.getPropertyValue('--node-depth'));
- });
- Array.prototype.forEach.call(firstGen, function(f) {
- assertEquals(1, f.depth);
- assertEquals('1', f.style.getPropertyValue('--node-depth'));
- });
- Array.prototype.forEach.call(secondGen, function(f) {
- assertEquals(2, f.depth);
- assertEquals('2', f.style.getPropertyValue('--node-depth'));
- });
- });
-
- test('doesn\'t highlight selected folder while searching', function() {
- var rootFolders =
- sidebar.$['folder-tree'].querySelectorAll('bookmarks-folder-node');
-
- store.data.selectedFolder = '1';
- store.notifyObservers();
-
- assertEquals('1', rootFolders['0'].itemId);
- assertTrue(rootFolders['0'].isSelectedFolder_);
-
- store.data.search = {
- term: 'test',
- inProgress: false,
- results: ['3'],
- };
- store.notifyObservers();
-
- assertFalse(rootFolders['0'].isSelectedFolder_);
- });
-});
« no previous file with comments | « chrome/test/data/webui/md_bookmarks/md_bookmarks_browsertest.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698