function testRenameNewDirectory(path, initialEntrySet, pathInBreadcrumb) {
  var expectedRows = TestEntryInfo.getExpectedRows(initialEntrySet);

  return new Promise(function(resolve) {
    setupAndWaitUntilReady(null, path, resolve);
  }).then(function(results) {
    var windowId = results.windowId;
    return remoteCall.waitForFiles(windowId, expectedRows).then(function() {
      return remoteCall.fakeKeyDown(
          windowId, '#list-container', 'e', 'U+0045', true, false, false);
    }).then(function() {
      // Wait for rename text field.
      return remoteCall.waitForElement(windowId, 'input.rename');
    }).then(function() {
      // Type new file name.
      return remoteCall.callRemoteTestUtil(
          'inputText', windowId, ['input.rename', 'foo']);
    }).then(function() {
      // Press Enter.
      return remoteCall.fakeKeyDown(
          windowId, 'input.rename', 'Enter', 'Enter', false, false, false);
    }).then(function() {
      // Press Enter again to try to get into the new directory.
      return remoteCall.fakeKeyDown(
          windowId, '#list-container', 'Enter', 'Enter', false, false, false);
    }).then(function() {
      // Confirm that it doesn't move the directory since it's in renaming
      // process.
      return remoteCall.waitUntilCurrentDirectoryIsChanged(windowId,
          pathInBreadcrumb);
    }).then(function() {
      // Wait until rename is completed.
      return remoteCall.waitForElementLost(windowId, 'li[renaming]');
    }).then(function() {
      // Press Enter again.
      return remoteCall.fakeKeyDown(windowId, '#list-container', 'Enter',
          'Enter', false, false, false);
    }).then(function() {
      // Confirm that it moves to renamed directory.
      return remoteCall.waitUntilCurrentDirectoryIsChanged(windowId,
          pathInBreadcrumb + '/foo');
    });
  });
}
/**
 * Test for renaming a new directory.
 * @param {string} path Initial path.
 * @param {Array<TestEntryInfo>} initialEntrySet Initial set of entries.
 * @param {string} pathInBreadcrumb Initial path which is shown in breadcrumb.
 * @return {Promise} Promise to be fulfilled on success.
 */
Test for renaming a new directory.
@param {string} path Initial path.
@param {Array} initialEntrySet Initial set of entries.
@param {string} pathInBreadcrumb Initial path which is shown in breadcrumb.
@return {Promise} Promise to be fulfilled on success.
Test for renaming a new directory . @param { string } path Initial path . @param { Array } initialEntrySet Initial set of entries . @param { string } pathInBreadcrumb Initial path which is shown in breadcrumb . @return { Promise } Promise to be fulfilled on success .
function testRenameNewDirectory(path, initialEntrySet, pathInBreadcrumb) {
  var expectedRows = TestEntryInfo.getExpectedRows(initialEntrySet);
  return new Promise(function(resolve) {
    setupAndWaitUntilReady(null, path, resolve);
  }).then(function(results) {
    var windowId = results.windowId;
    return remoteCall.waitForFiles(windowId, expectedRows).then(function() {
      return remoteCall.fakeKeyDown(
          windowId, '#list-container', 'e', 'U+0045', true, false, false);
    }).then(function() {
      return remoteCall.waitForElement(windowId, 'input.rename');
    }).then(function() {
      return remoteCall.callRemoteTestUtil(
          'inputText', windowId, ['input.rename', 'foo']);
    }).then(function() {
      return remoteCall.fakeKeyDown(
          windowId, 'input.rename', 'Enter', 'Enter', false, false, false);
    }).then(function() {
      return remoteCall.fakeKeyDown(
          windowId, '#list-container', 'Enter', 'Enter', false, false, false);
    }).then(function() {
      return remoteCall.waitUntilCurrentDirectoryIsChanged(windowId,
          pathInBreadcrumb);
    }).then(function() {
      return remoteCall.waitForElementLost(windowId, 'li[renaming]');
    }).then(function() {
      return remoteCall.fakeKeyDown(windowId, '#list-container', 'Enter',
          'Enter', false, false, false);
    }).then(function() {
      return remoteCall.waitUntilCurrentDirectoryIsChanged(windowId,
          pathInBreadcrumb + '/foo');
    });
  });
}
function testRenameNewDirectory ( path , initialEntrySet , pathInBreadcrumb ) { var expectedRows = TestEntryInfo . getExpectedRows ( initialEntrySet ) ; return new Promise ( function ( resolve ) { setupAndWaitUntilReady ( null , path , resolve ) ; } ) . then ( function ( results ) { var windowId = results . windowId ; return remoteCall . waitForFiles ( windowId , expectedRows ) . then ( function ( ) { return remoteCall . fakeKeyDown ( windowId , '#list-container' , 'e' , 'U+0045' , true , false , false ) ; } ) . then ( function ( ) { return remoteCall . waitForElement ( windowId , 'input.rename' ) ; } ) . then ( function ( ) { return remoteCall . callRemoteTestUtil ( 'inputText' , windowId , [ 'input.rename' , 'foo' ] ) ; } ) . then ( function ( ) { return remoteCall . fakeKeyDown ( windowId , 'input.rename' , 'Enter' , 'Enter' , false , false , false ) ; } ) . then ( function ( ) { return remoteCall . fakeKeyDown ( windowId , '#list-container' , 'Enter' , 'Enter' , false , false , false ) ; } ) . then ( function ( ) { return remoteCall . waitUntilCurrentDirectoryIsChanged ( windowId , pathInBreadcrumb ) ; } ) . then ( function ( ) { return remoteCall . waitForElementLost ( windowId , 'li[renaming]' ) ; } ) . then ( function ( ) { return remoteCall . fakeKeyDown ( windowId , '#list-container' , 'Enter' , 'Enter' , false , false , false ) ; } ) . then ( function ( ) { return remoteCall . waitUntilCurrentDirectoryIsChanged ( windowId , pathInBreadcrumb + '/foo' ) ; } ) ; } ) ; }
Test for renaming a new directory.
Test for renaming a new directory .
// Wait for rename text field. // Type new file name. // Press Enter. // Press Enter again to try to get into the new directory. // Confirm that it doesn't move the directory since it's in renaming // process. // Wait until rename is completed. // Press Enter again. // Confirm that it moves to renamed directory.