function testMove(callback) {
  // Prepare entries and their resolver.
  var fileSystem = createTestFileSystem('testVolume', {
    '/': DIRECTORY_SIZE,
    '/directory': DIRECTORY_SIZE,
    '/test.txt': 10,
  });
  window.webkitResolveLocalFileSystemURL =
      resolveTestFileSystemURL.bind(null, fileSystem);

  volumeManager = new FakeVolumeManager();
  fileOperationManager = new FileOperationManager();

  // Observing manager's events.
  var eventsPromise = waitForEvents(fileOperationManager);

  // Verify the events.
  reportPromise(eventsPromise.then(function(events) {
    var firstEvent = events[0];
    assertEquals('BEGIN', firstEvent.reason);
    assertEquals(1, firstEvent.status.numRemainingItems);
    assertEquals(0, firstEvent.status.processedBytes);
    assertEquals(1, firstEvent.status.totalBytes);

    var lastEvent = events[events.length - 1];
    assertEquals('SUCCESS', lastEvent.reason);
    assertEquals(0, lastEvent.status.numRemainingItems);
    assertEquals(1, lastEvent.status.processedBytes);
    assertEquals(1, lastEvent.status.totalBytes);

    assertTrue(events.some(function(event) {
      return event.type === 'entries-changed' &&
          event.kind === util.EntryChangedKind.DELETED &&
          event.entries[0].fullPath === '/test.txt';
    }));

    assertTrue(events.some(function(event) {
      return event.type === 'entries-changed' &&
          event.kind === util.EntryChangedKind.CREATED &&
          event.entries[0].fullPath === '/directory/test.txt';
    }));

    assertFalse(events.some(function(event) {
      return event.type === 'delete';
    }));
  }), callback);

  fileOperationManager.paste(
      [fileSystem.entries['/test.txt']],
      fileSystem.entries['/directory'],
      true);
}
/**
 * Tests the fileOperationUtil.paste for move.
 * @param {function(boolean:hasError)} callback Callback to be passed true on
 *     error.
 */
Tests the fileOperationUtil.paste for move.
@param {function(boolean:hasError)} callback Callback to be passed true on
error.
Tests the fileOperationUtil . paste for move . @param { function ( boolean : hasError ) } callback Callback to be passed true on error .
function testMove(callback) {
  var fileSystem = createTestFileSystem('testVolume', {
    '/': DIRECTORY_SIZE,
    '/directory': DIRECTORY_SIZE,
    '/test.txt': 10,
  });
  window.webkitResolveLocalFileSystemURL =
      resolveTestFileSystemURL.bind(null, fileSystem);
  volumeManager = new FakeVolumeManager();
  fileOperationManager = new FileOperationManager();
  var eventsPromise = waitForEvents(fileOperationManager);
  reportPromise(eventsPromise.then(function(events) {
    var firstEvent = events[0];
    assertEquals('BEGIN', firstEvent.reason);
    assertEquals(1, firstEvent.status.numRemainingItems);
    assertEquals(0, firstEvent.status.processedBytes);
    assertEquals(1, firstEvent.status.totalBytes);
    var lastEvent = events[events.length - 1];
    assertEquals('SUCCESS', lastEvent.reason);
    assertEquals(0, lastEvent.status.numRemainingItems);
    assertEquals(1, lastEvent.status.processedBytes);
    assertEquals(1, lastEvent.status.totalBytes);
    assertTrue(events.some(function(event) {
      return event.type === 'entries-changed' &&
          event.kind === util.EntryChangedKind.DELETED &&
          event.entries[0].fullPath === '/test.txt';
    }));
    assertTrue(events.some(function(event) {
      return event.type === 'entries-changed' &&
          event.kind === util.EntryChangedKind.CREATED &&
          event.entries[0].fullPath === '/directory/test.txt';
    }));
    assertFalse(events.some(function(event) {
      return event.type === 'delete';
    }));
  }), callback);
  fileOperationManager.paste(
      [fileSystem.entries['/test.txt']],
      fileSystem.entries['/directory'],
      true);
}
function testMove ( callback ) { var fileSystem = createTestFileSystem ( 'testVolume' , { '/' : DIRECTORY_SIZE , '/directory' : DIRECTORY_SIZE , '/test.txt' : 10 , } ) ; window . webkitResolveLocalFileSystemURL = resolveTestFileSystemURL . bind ( null , fileSystem ) ; volumeManager = new FakeVolumeManager ( ) ; fileOperationManager = new FileOperationManager ( ) ; var eventsPromise = waitForEvents ( fileOperationManager ) ; reportPromise ( eventsPromise . then ( function ( events ) { var firstEvent = events [ 0 ] ; assertEquals ( 'BEGIN' , firstEvent . reason ) ; assertEquals ( 1 , firstEvent . status . numRemainingItems ) ; assertEquals ( 0 , firstEvent . status . processedBytes ) ; assertEquals ( 1 , firstEvent . status . totalBytes ) ; var lastEvent = events [ events . length - 1 ] ; assertEquals ( 'SUCCESS' , lastEvent . reason ) ; assertEquals ( 0 , lastEvent . status . numRemainingItems ) ; assertEquals ( 1 , lastEvent . status . processedBytes ) ; assertEquals ( 1 , lastEvent . status . totalBytes ) ; assertTrue ( events . some ( function ( event ) { return event . type === 'entries-changed' && event . kind === util . EntryChangedKind . DELETED && event . entries [ 0 ] . fullPath === '/test.txt' ; } ) ) ; assertTrue ( events . some ( function ( event ) { return event . type === 'entries-changed' && event . kind === util . EntryChangedKind . CREATED && event . entries [ 0 ] . fullPath === '/directory/test.txt' ; } ) ) ; assertFalse ( events . some ( function ( event ) { return event . type === 'delete' ; } ) ) ; } ) , callback ) ; fileOperationManager . paste ( [ fileSystem . entries [ '/test.txt' ] ] , fileSystem . entries [ '/directory' ] , true ) ; }
Tests the fileOperationUtil.paste for move.
Tests the fileOperationUtil . paste for move .
// Prepare entries and their resolver. // Observing manager's events. // Verify the events.