• Dominic Mazzoni's avatar
    Add generated tree test to ensure ignored nodes are handled properly. · b587a5ed
    Dominic Mazzoni authored
    First, extends TreeGenerator so that it can not only generate every
    "shape" of tree, but it can then populate that tree with every
    permutation of ignored nodes.
    
    Then, write a new test that tries every possible tree up to a certain
    size and tries every possible source and destination permutation of
    ignored nodes. We call this the "fat" tree. Update the source tree into
    the destination tree and capture the events fired.
    
    Next, build the equivalent "skinny" trees - the same trees but with
    the ignored nodes removed. Now convert the source skinny tree into the
    destination skinny tree.
    
    Assert that the generated events fired are the same in the fat tree as
    the skinny tree. In other words, ignored nodes really are ignored and
    don't affect things. (The only exception is the ignored_changed
    attribute.)
    
    Finally, check every unignored node in the fat tree and make sure that its
    unignored parent, children, siblings, and index in parent are all
    consistent with the equivalent values in the skinny tree.
    
    This test uncovered bugs, which were fixed in http://crrev.com/c/2125235
    before this patch was uploaded for review.
    
    Bug: 1065144
    Change-Id: I82f9b3487485f1024ee066b82c23ab0cd7b60e38
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2139082Reviewed-by: default avatarAdam Ettenberger <Adam.Ettenberger@microsoft.com>
    Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#757989}
    b587a5ed
ax_generated_tree_unittest.cc 16.4 KB