chrome/test/webapps/graph_analysis.py
def build_action_node_graph(root_node: ActionNode,
                            tests: List[CoverageTest]) -> None:
    """
    Builds a graph of ActionNodes on the given `root_node`. The graph is
    generated by iterating the `tests`, starting at the `root_node` for each
    test, and adding ActionNodes to the graph for each state-change action
    (following the graph for every state-change action). State-check actions are
    added to the previous state-change action ActionNode.
    """
    assert root_node is not None
    assert isinstance(root_node, ActionNode)
    assert isinstance(tests, list)
    for test in tests:
        assert isinstance(test, CoverageTest)
        parent = root_node
        for action in test.actions:
            assert isinstance(action, Action)
            assert action.type is not ActionType.PARAMETERIZED
            if action.is_state_check():
                parent.add_state_check_action(action)
            else:
                node = None
                if action.name in parent.children:
                    node = parent.children[action.name]
                else:
                    node = ActionNode(action)
                    parent.add_child(node)
                parent = node

    Builds a graph of ActionNodes on the given `root_node`. The graph is
    generated by iterating the `tests`, starting at the `root_node` for each
    test, and adding ActionNodes to the graph for each state-change action
    (following the graph for every state-change action). State-check actions are
    added to the previous state-change action ActionNode.
    
Builds a graph of ActionNodes on the given `root_node`. The graph is
generated by iterating the `tests`, starting at the `root_node` for each
test, and adding ActionNodes to the graph for each state-change action
(following the graph for every state-change action). State-check actions are
added to the previous state-change action ActionNode.
Builds a graph of ActionNodes on the given ` root_node ` . The graph is generated by iterating the ` tests ` starting at the ` root_node ` for each test and adding ActionNodes to the graph for each state - change action ( following the graph for every state - change action ) . State - check actions are added to the previous state - change action ActionNode .
def build_action_node_graph(root_node: ActionNode,
                            tests: List[CoverageTest]) -> None:
    assert root_node is not None
    assert isinstance(root_node, ActionNode)
    assert isinstance(tests, list)
    for test in tests:
        assert isinstance(test, CoverageTest)
        parent = root_node
        for action in test.actions:
            assert isinstance(action, Action)
            assert action.type is not ActionType.PARAMETERIZED
            if action.is_state_check():
                parent.add_state_check_action(action)
            else:
                node = None
                if action.name in parent.children:
                    node = parent.children[action.name]
                else:
                    node = ActionNode(action)
                    parent.add_child(node)
                parent = node
def build_action_node_graph ( root_node : ActionNode , tests : List [ CoverageTest ] ) -> None : assert root_node is not None assert isinstance ( root_node , ActionNode ) assert isinstance ( tests , list ) for test in tests : assert isinstance ( test , CoverageTest ) parent = root_node for action in test . actions : assert isinstance ( action , Action ) assert action . type is not ActionType . PARAMETERIZED if action . is_state_check ( ) : parent . add_state_check_action ( action ) else : node = None if action . name in parent . children : node = parent . children [ action . name ] else : node = ActionNode ( action ) parent . add_child ( node ) parent = node
Builds a graph of ActionNodes on the given `root_node`.
Builds a graph of ActionNodes on the given ` root_node ` .
"""
    Builds a graph of ActionNodes on the given `root_node`. The graph is
    generated by iterating the `tests`, starting at the `root_node` for each
    test, and adding ActionNodes to the graph for each state-change action
    (following the graph for every state-change action). State-check actions are
    added to the previous state-change action ActionNode.
    """
root_node
ActionNode
tests
List[CoverageTest]