function confirmTwoImagesAreLoadedInThumbnailMode(appId) {
  // Wait until Gallery changes to thumbnail mode.
  return gallery.waitForElement(
      appId, '.gallery[mode="thumbnail"]').then(function() {
    // Confirm that two tiles are shown.
    return repeatUntil(function() {
      return gallery.callRemoteTestUtil('queryAllElements', appId,
          ['.thumbnail-view .thumbnail']).then(function(tiles) {
        if (tiles.length !== 2)
          return pending('The number of tiles is expected 2, but is %d',
              tiles.length);
        return tiles;
      });
    });
  });
}
/**
 * Confirms that two images are loaded in thumbnail mode. This method doesn't
 * care whether two images are loaded with error or not.
 *
 * @param {string} appId
 * @return {Promise} Promise to be fulfilled with on success.
 */
Confirms that two images are loaded in thumbnail mode. This method doesn't
care whether two images are loaded with error or not.

@param {string} appId
@return {Promise} Promise to be fulfilled with on success.
Confirms that two images are loaded in thumbnail mode . This method doesn ' t care whether two images are loaded with error or not . @param { string } appId @return { Promise } Promise to be fulfilled with on success .
function confirmTwoImagesAreLoadedInThumbnailMode(appId) {
  return gallery.waitForElement(
      appId, '.gallery[mode="thumbnail"]').then(function() {
    return repeatUntil(function() {
      return gallery.callRemoteTestUtil('queryAllElements', appId,
          ['.thumbnail-view .thumbnail']).then(function(tiles) {
        if (tiles.length !== 2)
          return pending('The number of tiles is expected 2, but is %d',
              tiles.length);
        return tiles;
      });
    });
  });
}
function confirmTwoImagesAreLoadedInThumbnailMode ( appId ) { return gallery . waitForElement ( appId , '.gallery[mode="thumbnail"]' ) . then ( function ( ) { return repeatUntil ( function ( ) { return gallery . callRemoteTestUtil ( 'queryAllElements' , appId , [ '.thumbnail-view .thumbnail' ] ) . then ( function ( tiles ) { if ( tiles . length !== 2 ) return pending ( 'The number of tiles is expected 2, but is %d' , tiles . length ) ; return tiles ; } ) ; } ) ; } ) ; }
Confirms that two images are loaded in thumbnail mode.
Confirms that two images are loaded in thumbnail mode .
// Wait until Gallery changes to thumbnail mode. // Confirm that two tiles are shown.