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

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

Issue 2820153003: [MD Bookmarks] Add keyboard navigation to sidebar. (Closed)
Patch Set: 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
Index: chrome/test/data/webui/md_bookmarks/test_util.js
diff --git a/chrome/test/data/webui/md_bookmarks/test_util.js b/chrome/test/data/webui/md_bookmarks/test_util.js
index 090758749019d447ceb5c8d237dabe997b2fdeac..f1318eb760fca901094fcbc5c03c53c405a4284a 100644
--- a/chrome/test/data/webui/md_bookmarks/test_util.js
+++ b/chrome/test/data/webui/md_bookmarks/test_util.js
@@ -114,3 +114,22 @@ function customClick(element, config) {
element.dispatchEvent(new MouseEvent('mouseup', props));
element.dispatchEvent(new MouseEvent('click', props));
}
+
+/**
+ * Returns a folder node beneath |rootNode| which matches |id|.
+ * @param {BookmarksFolderNodeElement} rootNode
+ * @param {string} id
+ * @return {BookmarksFolderNodeElement}
+ */
+function findFolderNode(rootNode, id) {
+ var nodes = [rootNode];
+ var node;
+ while (nodes.length) {
+ node = nodes.pop();
+ if (node.itemId == id)
+ return node;
+
+ node.root.querySelectorAll('bookmarks-folder-node')
+ .forEach((x) => {nodes.unshift(x)});
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698