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

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

      remoteCall.callRemoteTestUtil(
          'openFile', appId, ['Beautiful Song.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 + '/Beautiful%20Song.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 selector = 'audio-player[playing][playcount="1"]';
      audioPlayerApp.waitForElement(audioAppId, selector).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 audioRepeatAllModeSingleFile(path) {
  var appId;
  var audioAppId;
  StepsRunner.run([
    function() {
      setupAndWaitUntilReady(null, path, this.next);
    },
    function(results) {
      appId = results.windowId;
      remoteCall.callRemoteTestUtil(
          'openFile', appId, ['Beautiful Song.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 + '/Beautiful%20Song.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 selector = 'audio-player[playing][playcount="1"]';
      audioPlayerApp.waitForElement(audioAppId, selector).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 audioRepeatAllModeSingleFile ( path ) { var appId ; var audioAppId ; StepsRunner . run ( [ function ( ) { setupAndWaitUntilReady ( null , path , this . next ) ; } , function ( results ) { appId = results . windowId ; remoteCall . callRemoteTestUtil ( 'openFile' , appId , [ 'Beautiful Song.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 + '/Beautiful%20Song.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 selector = 'audio-player[playing][playcount="1"]' ; audioPlayerApp . waitForElement ( audioAppId , selector ) . 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. // Wait for the audio player window. // Wait for the changes of the player status. // Get the source file name. // Get the source file name. // Close window // Wait for the audio player.