third_party/blink/tools/blinkpy/common/checkout/baseline_optimizer.py
def _walk_immediate_predecessors_of_virtual_root(
            self, test_name, extension, baseline_name, worker_func):
        """Maps a function onto each immediate predecessor of the virtual root.

        For each immediate predecessor, we call
            worker_func(virtual_baseline, non_virtual_fallback)
        where the two arguments are the absolute paths to the virtual platform
        baseline and the non-virtual fallback respectively.
        """
        actual_test_name = self._virtual_base(test_name)
        assert actual_test_name, '%s is not a virtual test.' % test_name

        for directory in self._directories_immediately_preceding_root():
            port = self._port_from_baseline_dir(directory)
            virtual_baseline = self._join_directory(directory, baseline_name)
            # return_default=False mandates expected_filename() to return None
            # instead of a non-existing generic path when nothing is found.
            non_virtual_fallback = port.expected_filename(
                actual_test_name, extension, return_default=False)
            if not non_virtual_fallback:
                # Unable to find a non-virtual fallback baseline, skipping.
                continue
            worker_func(virtual_baseline, non_virtual_fallback)
Maps a function onto each immediate predecessor of the virtual root.

        For each immediate predecessor, we call
            worker_func(virtual_baseline, non_virtual_fallback)
        where the two arguments are the absolute paths to the virtual platform
        baseline and the non-virtual fallback respectively.
        
Maps a function onto each immediate predecessor of the virtual root.
For each immediate predecessor, we call
worker_func(virtual_baseline, non_virtual_fallback)
where the two arguments are the absolute paths to the virtual platform
baseline and the non-virtual fallback respectively.
Maps a function onto each immediate predecessor of the virtual root . For each immediate predecessor we call worker_func ( virtual_baseline non_virtual_fallback ) where the two arguments are the absolute paths to the virtual platform baseline and the non - virtual fallback respectively .
def _walk_immediate_predecessors_of_virtual_root(
            self, test_name, extension, baseline_name, worker_func):
        actual_test_name = self._virtual_base(test_name)
        assert actual_test_name, '%s is not a virtual test.' % test_name
        for directory in self._directories_immediately_preceding_root():
            port = self._port_from_baseline_dir(directory)
            virtual_baseline = self._join_directory(directory, baseline_name)
            non_virtual_fallback = port.expected_filename(
                actual_test_name, extension, return_default=False)
            if not non_virtual_fallback:
                continue
            worker_func(virtual_baseline, non_virtual_fallback)
def _walk_immediate_predecessors_of_virtual_root ( self , test_name , extension , baseline_name , worker_func ) : actual_test_name = self . _virtual_base ( test_name ) assert actual_test_name , '%s is not a virtual test.' % test_name for directory in self . _directories_immediately_preceding_root ( ) : port = self . _port_from_baseline_dir ( directory ) virtual_baseline = self . _join_directory ( directory , baseline_name ) non_virtual_fallback = port . expected_filename ( actual_test_name , extension , return_default = False ) if not non_virtual_fallback : continue worker_func ( virtual_baseline , non_virtual_fallback )
Maps a function onto each immediate predecessor of the virtual root.
Maps a function onto each immediate predecessor of the virtual root .
"""Maps a function onto each immediate predecessor of the virtual root.

        For each immediate predecessor, we call
            worker_func(virtual_baseline, non_virtual_fallback)
        where the two arguments are the absolute paths to the virtual platform
        baseline and the non-virtual fallback respectively.
        """ # return_default=False mandates expected_filename() to return None # instead of a non-existing generic path when nothing is found. # Unable to find a non-virtual fallback baseline, skipping.
self
test_name
extension
baseline_name
worker_func