function audioRepeatAllModeMultipleFile(path) {
  var appId;
  var audioAppId;

  var expectedFilesBefore =
      TestEntryInfo.getExpectedRows(path == RootPath.DRIVE ?
          BASIC_DRIVE_ENTRY_SET : BASIC_LOCAL_ENTRY_SET);
  var expectedFilesAfter =
      expectedFilesBefore.concat([ENTRIES.newlyAdded.getExpectedRow()]);

  StepsRunner.run([
    function() {
      setupAndWaitUntilReady(null, path, this.next);
    },
    // Select the song.
    function(results) {
      appId = results.windowId;

      // Add an additional audio file.
      addEntries(['local', 'drive'], [ENTRIES.newlyAdded], this.next);
    },
    function(result) {
      chrome.test.assertTrue(result);
      remoteCall.waitForFiles(appId, expectedFilesAfter).then(this.next);
    },
    function(/* no result */) {
      remoteCall.callRemoteTestUtil(
          'openFile', appId, ['newly added file.ogg'], this.next);
    },
    // Wait for the audio player window.
    function(result) {
      chrome.test.assertTrue(result);
      audioPlayerApp.waitForWindow('audio_player.html').then(this.next);
    },
    // Wait for the changes of the player status.
    function(inAppId) {
      audioAppId = inAppId;
      audioPlayerApp.waitForElement(audioAppId, 'audio-player[playing]').
          then(this.next);
    },
    // Get the source file name.
    function(element) {
      chrome.test.assertEq(
          'filesystem:chrome-extension://' + AUDIO_PLAYER_APP_ID + '/' +
              'external' + path + '/newly%20added%20file.ogg',
          element.attributes.currenttrackurl);

      audioPlayerApp.callRemoteTestUtil(
          'fakeMouseClick',
          audioAppId,
          ['audio-player /deep/ repeat-button .no-repeat'],
          this.next);
    },
    function(result) {
      chrome.test.assertTrue(result, 'Failed to click the repeat button');

      // Wait for next song.
      var query = 'audio-player' +
                  '[playing]' +
                  '[currenttrackurl$="Beautiful%20Song.ogg"]';
      audioPlayerApp.waitForElement(audioAppId, query).then(this.next);
    },
    // Get the source file name.
    function(element) {
      chrome.test.assertEq(
          'filesystem:chrome-extension://' + AUDIO_PLAYER_APP_ID + '/' +
              'external' + path + '/Beautiful%20Song.ogg',
          element.attributes.currenttrackurl);

      // Close window
      audioPlayerApp.closeWindowAndWait(audioAppId).then(this.next);
    },
    // Wait for the audio player.
    function(result) {
      chrome.test.assertTrue(result);
      checkIfNoErrorsOccured(this.next);
    }
  ]);
}
/**
 * Tests if the audio player play the next file after the current file.
 *
 * @param {string} path Directory path to be tested.
 */
Tests if the audio player play the next file after the current file.
@param {string} path Directory path to be tested.
Tests if the audio player play the next file after the current file . @param { string } path Directory path to be tested .
function audioRepeatAllModeMultipleFile(path) {
  var appId;
  var audioAppId;
  var expectedFilesBefore =
      TestEntryInfo.getExpectedRows(path == RootPath.DRIVE ?
          BASIC_DRIVE_ENTRY_SET : BASIC_LOCAL_ENTRY_SET);
  var expectedFilesAfter =
      expectedFilesBefore.concat([ENTRIES.newlyAdded.getExpectedRow()]);
  StepsRunner.run([
    function() {
      setupAndWaitUntilReady(null, path, this.next);
    },
    function(results) {
      appId = results.windowId;
      addEntries(['local', 'drive'], [ENTRIES.newlyAdded], this.next);
    },
    function(result) {
      chrome.test.assertTrue(result);
      remoteCall.waitForFiles(appId, expectedFilesAfter).then(this.next);
    },
    function() {
      remoteCall.callRemoteTestUtil(
          'openFile', appId, ['newly added file.ogg'], this.next);
    },
    function(result) {
      chrome.test.assertTrue(result);
      audioPlayerApp.waitForWindow('audio_player.html').then(this.next);
    },
    function(inAppId) {
      audioAppId = inAppId;
      audioPlayerApp.waitForElement(audioAppId, 'audio-player[playing]').
          then(this.next);
    },
    function(element) {
      chrome.test.assertEq(
          'filesystem:chrome-extension://' + AUDIO_PLAYER_APP_ID + '/' +
              'external' + path + '/newly%20added%20file.ogg',
          element.attributes.currenttrackurl);
      audioPlayerApp.callRemoteTestUtil(
          'fakeMouseClick',
          audioAppId,
          ['audio-player /deep/ repeat-button .no-repeat'],
          this.next);
    },
    function(result) {
      chrome.test.assertTrue(result, 'Failed to click the repeat button');
      var query = 'audio-player' +
                  '[playing]' +
                  '[currenttrackurl$="Beautiful%20Song.ogg"]';
      audioPlayerApp.waitForElement(audioAppId, query).then(this.next);
    },
    function(element) {
      chrome.test.assertEq(
          'filesystem:chrome-extension://' + AUDIO_PLAYER_APP_ID + '/' +
              'external' + path + '/Beautiful%20Song.ogg',
          element.attributes.currenttrackurl);
      audioPlayerApp.closeWindowAndWait(audioAppId).then(this.next);
    },
    function(result) {
      chrome.test.assertTrue(result);
      checkIfNoErrorsOccured(this.next);
    }
  ]);
}
function audioRepeatAllModeMultipleFile ( path ) { var appId ; var audioAppId ; var expectedFilesBefore = TestEntryInfo . getExpectedRows ( path == RootPath . DRIVE ? BASIC_DRIVE_ENTRY_SET : BASIC_LOCAL_ENTRY_SET ) ; var expectedFilesAfter = expectedFilesBefore . concat ( [ ENTRIES . newlyAdded . getExpectedRow ( ) ] ) ; StepsRunner . run ( [ function ( ) { setupAndWaitUntilReady ( null , path , this . next ) ; } , function ( results ) { appId = results . windowId ; addEntries ( [ 'local' , 'drive' ] , [ ENTRIES . newlyAdded ] , this . next ) ; } , function ( result ) { chrome . test . assertTrue ( result ) ; remoteCall . waitForFiles ( appId , expectedFilesAfter ) . then ( this . next ) ; } , function ( ) { remoteCall . callRemoteTestUtil ( 'openFile' , appId , [ 'newly added file.ogg' ] , this . next ) ; } , function ( result ) { chrome . test . assertTrue ( result ) ; audioPlayerApp . waitForWindow ( 'audio_player.html' ) . then ( this . next ) ; } , function ( inAppId ) { audioAppId = inAppId ; audioPlayerApp . waitForElement ( audioAppId , 'audio-player[playing]' ) . then ( this . next ) ; } , function ( element ) { chrome . test . assertEq ( 'filesystem:chrome-extension://' + AUDIO_PLAYER_APP_ID + '/' + 'external' + path + '/newly%20added%20file.ogg' , element . attributes . currenttrackurl ) ; audioPlayerApp . callRemoteTestUtil ( 'fakeMouseClick' , audioAppId , [ 'audio-player /deep/ repeat-button .no-repeat' ] , this . next ) ; } , function ( result ) { chrome . test . assertTrue ( result , 'Failed to click the repeat button' ) ; var query = 'audio-player' + '[playing]' + '[currenttrackurl$="Beautiful%20Song.ogg"]' ; audioPlayerApp . waitForElement ( audioAppId , query ) . then ( this . next ) ; } , function ( element ) { chrome . test . assertEq ( 'filesystem:chrome-extension://' + AUDIO_PLAYER_APP_ID + '/' + 'external' + path + '/Beautiful%20Song.ogg' , element . attributes . currenttrackurl ) ; audioPlayerApp . closeWindowAndWait ( audioAppId ) . then ( this . next ) ; } , function ( result ) { chrome . test . assertTrue ( result ) ; checkIfNoErrorsOccured ( this . next ) ; } ] ) ; }
Tests if the audio player play the next file after the current file.
Tests if the audio player play the next file after the current file .
// Select the song. // Add an additional audio file. /* no result */ // Wait for the audio player window. // Wait for the changes of the player status. // Get the source file name. // Wait for next song. // Get the source file name. // Close window // Wait for the audio player.