Ensure that tree updates from ARC++ always trigger re-computation of unignored state
In ARC++, we send the entire tree from inside the Android container out to Chrome. As a result, each time the AXTreeSerializer is asked to serialize, we rely upon it to compute the incremental tree update starting at the event target. This can exercise the serializer in various ways not seen on other platforms. In order to ensure we always serve a fresh tree to Chrome OS extensions, that listen on the other end of AXTreeSourceArc, set |node_id_to_clear| on each AXTreeUpdate sent to the extension. This has the advantage of forcing re-computation of unignored child count and index in parent which have been buggy given corner cases of tree update permutations. This change also makes a few cleanups/improvements: - PopulateAXRole gets moved into ArcAccessibilityDataInfoWrapper::Serialize. This was done to ensure tests that only call Serialize get the *entire* serialized AXNodeData. Previously, we were omitting role population due to the special casing of the root node. - removed logic surrounding assigning root node role from AXTreeSourceArc. This was done previously because the tree may or may not contain ancestor windows from ARC++ (i.e. AccessibilityWindowDataInfoWrappers were not being used). We can now safely assume we have windows in the tree. This change also relaxes the role assignment on the root *Node* (not window). We now compute its role as normal as any other node, but still assign it as modal. This is to cover strange cases in in tests where we have just one node in the node tree (one window with a child node). That node might be a staticText, but we were assigning it arbitrarily as a genericContainer. (see test change). Bug: b:142544528 Test: unit_tests --gtest_filter=AXTreeSourceArc*.* Change-Id: I9c14d9c7fdc10cfffd9ce734921276fd503eac33 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1856830 Commit-Queue: David Tseng <dtseng@chromium.org> Reviewed-by:Sara Kato <sarakato@chromium.org> Cr-Commit-Position: refs/heads/master@{#706060}
Showing
Please register or sign in to comment