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

Unified Diff: chrome/browser/resources/chromeos/switch_access/automation_predicate.js

Issue 2866123002: Added unit tests for tree_walker and automation_predicate. (Closed)
Patch Set: Combined getSampleTree functions into one Created 3 years, 7 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/browser/resources/chromeos/switch_access/automation_predicate.js
diff --git a/chrome/browser/resources/chromeos/switch_access/automation_predicate.js b/chrome/browser/resources/chromeos/switch_access/automation_predicate.js
index 5f9ee90634e8c0cbec8562541f264d55dbf0725e..d706c3e19c281284abc3f15434de6741836ed26f 100644
--- a/chrome/browser/resources/chromeos/switch_access/automation_predicate.js
+++ b/chrome/browser/resources/chromeos/switch_access/automation_predicate.js
@@ -47,7 +47,8 @@ AutomationPredicate.isGroup = function(node, scope) {
return false;
let interestingBranches = 0;
- for (let child of node.children) {
+ let children = node.children || [];
+ for (let child of children) {
if (AutomationPredicate.isInterestingSubtree(child))
interestingBranches += 1;
if (interestingBranches > 1)

Powered by Google App Engine
This is Rietveld 408576698