• Dominic Mazzoni's avatar
    Fix bug in serializing accessibility trees with invalidation. · 2b632491
    Dominic Mazzoni authored
    In http://crrev.com/c/1152180, we introduced
    AXTreeSerializer::InvalidateSubtree. This replaced
    AXTreeSerializer::DeleteClientSubtree, which was problematic and led
    to subtle, hard-to-catch unserialization errors.
    
    This patch adds comprehensive tests for InvalidateSubtree by introducing it
    into the "generated tree" tests, which try every permutation of trees with
    up to a certain number of nodes and every possible change to those trees.
    Now those tests also try every possible way to invalidate a subtree before
    serializing.
    
    This uncovered one subtle bug: the code to detect reparenting also needed
    to check the 'invalid' flag and recursively check invalid children.
    
    Bug: 870661, 866293
    Change-Id: I45313b712e50db4fba16a5d55f72ecd440f04335
    Reviewed-on: https://chromium-review.googlesource.com/1180091Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
    Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#584643}
    2b632491
ax_tree_serializer_unittest.cc 13.3 KB