function openSingleImage(testVolumeName, volumeType) {
  var launchedPromise = launch(testVolumeName, volumeType, [ENTRIES.desktop]);
  return launchedPromise.then(function(args) {
    var WIDTH = 880;
    var HEIGHT = 602; /* Inner height 570px + native header 32px. */
    var appId = args.appId;
    var resizedWindowPromise = gallery.callRemoteTestUtil(
        'resizeWindow', appId, [WIDTH, HEIGHT]
    ).then(function() {
      return repeatUntil(function() {
        return gallery.callRemoteTestUtil('getWindows', null, []
        ).then(function(windows) {
          var bounds = windows[appId];
          if (!bounds)
            return pending('Window is not ready yet.');

          if (bounds.outerWidth !== WIDTH || bounds.outerHeight !== HEIGHT) {
            return pending(
                'Window bounds is expected %d x %d, but is %d x %d',
                WIDTH, HEIGHT,
                bounds.outerWidth,
                bounds.outerHeight);
          }
          return true;
        });
      });
    });

    return resizedWindowPromise.then(function() {
      var rootElementPromise =
          gallery.waitForElement(appId, '.gallery[mode="slide"]');
      var fullImagePromsie = gallery.waitForElement(
          appId, '.gallery .image-container > .image');
      return Promise.all([rootElementPromise, fullImagePromsie]).
          then(function(args) {
            chrome.test.assertEq(760, args[1].renderedWidth);
            chrome.test.assertEq(570, args[1].renderedHeight);
            chrome.test.assertEq(800, args[1].imageWidth);
            chrome.test.assertEq(600, args[1].imageHeight);
          });
    });
  });
}
/**
 * Runs a test to open a single image.
 *
 * @param {string} testVolumeName Test volume name passed to the addEntries
 *     function. Either 'drive' or 'local'.
 * @param {VolumeManagerCommon.VolumeType} volumeType Volume type.
 * @return {Promise} Promise to be fulfilled with on success.
 */
Runs a test to open a single image.
@param {string} testVolumeName Test volume name passed to the addEntries
function. Either 'drive' or 'local'.
Runs a test to open a single image . @param { string } testVolumeName Test volume name passed to the addEntries function . Either ' drive ' or ' local ' .
function openSingleImage(testVolumeName, volumeType) {
  var launchedPromise = launch(testVolumeName, volumeType, [ENTRIES.desktop]);
  return launchedPromise.then(function(args) {
    var WIDTH = 880;
    var HEIGHT = 602; 
    var appId = args.appId;
    var resizedWindowPromise = gallery.callRemoteTestUtil(
        'resizeWindow', appId, [WIDTH, HEIGHT]
    ).then(function() {
      return repeatUntil(function() {
        return gallery.callRemoteTestUtil('getWindows', null, []
        ).then(function(windows) {
          var bounds = windows[appId];
          if (!bounds)
            return pending('Window is not ready yet.');
          if (bounds.outerWidth !== WIDTH || bounds.outerHeight !== HEIGHT) {
            return pending(
                'Window bounds is expected %d x %d, but is %d x %d',
                WIDTH, HEIGHT,
                bounds.outerWidth,
                bounds.outerHeight);
          }
          return true;
        });
      });
    });
    return resizedWindowPromise.then(function() {
      var rootElementPromise =
          gallery.waitForElement(appId, '.gallery[mode="slide"]');
      var fullImagePromsie = gallery.waitForElement(
          appId, '.gallery .image-container > .image');
      return Promise.all([rootElementPromise, fullImagePromsie]).
          then(function(args) {
            chrome.test.assertEq(760, args[1].renderedWidth);
            chrome.test.assertEq(570, args[1].renderedHeight);
            chrome.test.assertEq(800, args[1].imageWidth);
            chrome.test.assertEq(600, args[1].imageHeight);
          });
    });
  });
}
function openSingleImage ( testVolumeName , volumeType ) { var launchedPromise = launch ( testVolumeName , volumeType , [ ENTRIES . desktop ] ) ; return launchedPromise . then ( function ( args ) { var WIDTH = 880 ; var HEIGHT = 602 ; var appId = args . appId ; var resizedWindowPromise = gallery . callRemoteTestUtil ( 'resizeWindow' , appId , [ WIDTH , HEIGHT ] ) . then ( function ( ) { return repeatUntil ( function ( ) { return gallery . callRemoteTestUtil ( 'getWindows' , null , [ ] ) . then ( function ( windows ) { var bounds = windows [ appId ] ; if ( ! bounds ) return pending ( 'Window is not ready yet.' ) ; if ( bounds . outerWidth !== WIDTH || bounds . outerHeight !== HEIGHT ) { return pending ( 'Window bounds is expected %d x %d, but is %d x %d' , WIDTH , HEIGHT , bounds . outerWidth , bounds . outerHeight ) ; } return true ; } ) ; } ) ; } ) ; return resizedWindowPromise . then ( function ( ) { var rootElementPromise = gallery . waitForElement ( appId , '.gallery[mode="slide"]' ) ; var fullImagePromsie = gallery . waitForElement ( appId , '.gallery .image-container > .image' ) ; return Promise . all ( [ rootElementPromise , fullImagePromsie ] ) . then ( function ( args ) { chrome . test . assertEq ( 760 , args [ 1 ] . renderedWidth ) ; chrome . test . assertEq ( 570 , args [ 1 ] . renderedHeight ) ; chrome . test . assertEq ( 800 , args [ 1 ] . imageWidth ) ; chrome . test . assertEq ( 600 , args [ 1 ] . imageHeight ) ; } ) ; } ) ; } ) ; }
Runs a test to open a single image.
Runs a test to open a single image .
/* Inner height 570px + native header 32px. */