function testDeduplicatePath(callback) {
  var fileSystem1 = createTestFileSystem('testVolume', {'/': DIRECTORY_SIZE});
  var fileSystem2 = createTestFileSystem('testVolume', {
    '/': DIRECTORY_SIZE,
    '/file.txt': 10
  });
  var fileSystem3 = createTestFileSystem('testVolume', {
    '/': DIRECTORY_SIZE,
    '/file.txt': 10,
    '/file (1).txt': 10,
    '/file (2).txt': 10,
    '/file (3).txt': 10,
    '/file (4).txt': 10,
    '/file (5).txt': 10,
    '/file (6).txt': 10,
    '/file (7).txt': 10,
    '/file (8).txt': 10,
    '/file (9).txt': 10,
  });

  var nonExistingPromise =
      fileOperationUtil.deduplicatePath(fileSystem1.root, 'file.txt').
      then(function(path) {
        assertEquals('file.txt', path);
      });
  var existingPathPromise =
      fileOperationUtil.deduplicatePath(fileSystem2.root, 'file.txt').
      then(function(path) {
        assertEquals('file (1).txt', path);
      });
  var moreExistingPathPromise =
      fileOperationUtil.deduplicatePath(fileSystem3.root, 'file.txt').
      then(function(path) {
        assertEquals('file (10).txt', path);
      });

  var testPromise = Promise.all([
    nonExistingPromise,
    existingPathPromise,
    moreExistingPathPromise,
  ]);
  reportPromise(testPromise, callback);
}
/**
 * Tests the fileOperationUtil.deduplicatePath
 * @param {function(boolean:hasError)} callback Callback to be passed true on
 *     error.
 */
Tests the fileOperationUtil.deduplicatePath
@param {function(boolean:hasError)} callback Callback to be passed true on
error.
Tests the fileOperationUtil . deduplicatePath @param { function ( boolean : hasError ) } callback Callback to be passed true on error .
function testDeduplicatePath(callback) {
  var fileSystem1 = createTestFileSystem('testVolume', {'/': DIRECTORY_SIZE});
  var fileSystem2 = createTestFileSystem('testVolume', {
    '/': DIRECTORY_SIZE,
    '/file.txt': 10
  });
  var fileSystem3 = createTestFileSystem('testVolume', {
    '/': DIRECTORY_SIZE,
    '/file.txt': 10,
    '/file (1).txt': 10,
    '/file (2).txt': 10,
    '/file (3).txt': 10,
    '/file (4).txt': 10,
    '/file (5).txt': 10,
    '/file (6).txt': 10,
    '/file (7).txt': 10,
    '/file (8).txt': 10,
    '/file (9).txt': 10,
  });
  var nonExistingPromise =
      fileOperationUtil.deduplicatePath(fileSystem1.root, 'file.txt').
      then(function(path) {
        assertEquals('file.txt', path);
      });
  var existingPathPromise =
      fileOperationUtil.deduplicatePath(fileSystem2.root, 'file.txt').
      then(function(path) {
        assertEquals('file (1).txt', path);
      });
  var moreExistingPathPromise =
      fileOperationUtil.deduplicatePath(fileSystem3.root, 'file.txt').
      then(function(path) {
        assertEquals('file (10).txt', path);
      });
  var testPromise = Promise.all([
    nonExistingPromise,
    existingPathPromise,
    moreExistingPathPromise,
  ]);
  reportPromise(testPromise, callback);
}
function testDeduplicatePath ( callback ) { var fileSystem1 = createTestFileSystem ( 'testVolume' , { '/' : DIRECTORY_SIZE } ) ; var fileSystem2 = createTestFileSystem ( 'testVolume' , { '/' : DIRECTORY_SIZE , '/file.txt' : 10 } ) ; var fileSystem3 = createTestFileSystem ( 'testVolume' , { '/' : DIRECTORY_SIZE , '/file.txt' : 10 , '/file (1).txt' : 10 , '/file (2).txt' : 10 , '/file (3).txt' : 10 , '/file (4).txt' : 10 , '/file (5).txt' : 10 , '/file (6).txt' : 10 , '/file (7).txt' : 10 , '/file (8).txt' : 10 , '/file (9).txt' : 10 , } ) ; var nonExistingPromise = fileOperationUtil . deduplicatePath ( fileSystem1 . root , 'file.txt' ) . then ( function ( path ) { assertEquals ( 'file.txt' , path ) ; } ) ; var existingPathPromise = fileOperationUtil . deduplicatePath ( fileSystem2 . root , 'file.txt' ) . then ( function ( path ) { assertEquals ( 'file (1).txt' , path ) ; } ) ; var moreExistingPathPromise = fileOperationUtil . deduplicatePath ( fileSystem3 . root , 'file.txt' ) . then ( function ( path ) { assertEquals ( 'file (10).txt' , path ) ; } ) ; var testPromise = Promise . all ( [ nonExistingPromise , existingPathPromise , moreExistingPathPromise , ] ) ; reportPromise ( testPromise , callback ) ; }
Tests the fileOperationUtil.deduplicatePath
 @param {function(boolean:hasError)} callback Callback to be passed true on
     error.
Tests the fileOperationUtil . deduplicatePath @param { function ( boolean : hasError ) } callback Callback to be passed true on error .