function expandDirectoryTreeForInternal_(windowId, components, index) {
  if (index >= components.length - 1)
    return Promise.resolve();

  if (index === 0) {
    return expandDownloadVolumeInDirectoryTree(windowId).then(function() {
      return expandDirectoryTreeForInternal_(windowId, components, index + 1);
    });
  }

  var path = `/${components.slice(1, index + 1).join('/')}`;
  return expandTreeItemInDirectoryTree(
      windowId, `[full-path-for-testing="${path}"]`).then(function() {
    return expandDirectoryTreeForInternal_(windowId, components, index + 1);
  });
}
/**
 * Internal function for expanding directory tree for specified path.
 */
Internal function for expanding directory tree for specified path.
Internal function for expanding directory tree for specified path .
function expandDirectoryTreeForInternal_(windowId, components, index) {
  if (index >= components.length - 1)
    return Promise.resolve();
  if (index === 0) {
    return expandDownloadVolumeInDirectoryTree(windowId).then(function() {
      return expandDirectoryTreeForInternal_(windowId, components, index + 1);
    });
  }
  var path = `/${components.slice(1, index + 1).join('/')}`;
  return expandTreeItemInDirectoryTree(
      windowId, `[full-path-for-testing="${path}"]`).then(function() {
    return expandDirectoryTreeForInternal_(windowId, components, index + 1);
  });
}
function expandDirectoryTreeForInternal_ ( windowId , components , index ) { if ( index >= components . length - 1 ) return Promise . resolve ( ) ; if ( index === 0 ) { return expandDownloadVolumeInDirectoryTree ( windowId ) . then ( function ( ) { return expandDirectoryTreeForInternal_ ( windowId , components , index + 1 ) ; } ) ; } var path = ` ${ components . slice ( 1 , index + 1 ) . join ( '/' ) } ` ; return expandTreeItemInDirectoryTree ( windowId , ` ${ path } ` ) . then ( function ( ) { return expandDirectoryTreeForInternal_ ( windowId , components , index + 1 ) ; } ) ; }
Internal function for expanding directory tree for specified path.
Internal function for expanding directory tree for specified path .