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

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

Issue 2733123003: [MD Bookmarks] Make folder nodes extend their whole width. (Closed)
Patch Set: closure Created 3 years, 9 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/browser/resources/md_bookmarks/sidebar.html ('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
index 8b54645fd0fc020039ca8617306a7a48849a72d4..b43113f3ada27f1b262f1b3bf78e422053623b4e 100644
--- a/chrome/test/data/webui/md_bookmarks/sidebar_test.js
+++ b/chrome/test/data/webui/md_bookmarks/sidebar_test.js
@@ -31,7 +31,8 @@ suite('<bookmarks-sidebar>', function() {
});
test('selecting and deselecting folders dispatches action', function() {
- var rootFolders = sidebar.$['folder-tree'].children;
+ var rootFolders =
+ sidebar.$['folder-tree'].querySelectorAll('bookmarks-folder-node');
var firstGen = rootFolders[0].$['descendants'].querySelectorAll(
'bookmarks-folder-node');
var secondGen =
@@ -49,4 +50,26 @@ suite('<bookmarks-sidebar>', function() {
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'));
+ });
+ })
});
« no previous file with comments | « chrome/browser/resources/md_bookmarks/sidebar.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698