function waitAndAcceptDialog(windowId) {
  return remoteCall.waitForElement(windowId, '.cr-dialog-ok').
      then(remoteCall.callRemoteTestUtil.bind(remoteCall,
                                              'fakeMouseClick',
                                              windowId,
                                              ['.cr-dialog-ok'],
                                              null)).
      then(function(result) {
        chrome.test.assertTrue(result);
        return remoteCall.waitForElementLost(windowId, '.cr-dialog-container');
      });
}
/**
 * Waits until a dialog with an OK button is shown and accepts it.
 *
 * @param {string} windowId Target window ID.
 * @return {Promise} Promise to be fulfilled after clicking the OK button in the
 *     dialog.
 */
Waits until a dialog with an OK button is shown and accepts it.
@param {string} windowId Target window ID.
@return {Promise} Promise to be fulfilled after clicking the OK button in the
dialog.
Waits until a dialog with an OK button is shown and accepts it . @param { string } windowId Target window ID . @return { Promise } Promise to be fulfilled after clicking the OK button in the dialog .
function waitAndAcceptDialog(windowId) {
  return remoteCall.waitForElement(windowId, '.cr-dialog-ok').
      then(remoteCall.callRemoteTestUtil.bind(remoteCall,
                                              'fakeMouseClick',
                                              windowId,
                                              ['.cr-dialog-ok'],
                                              null)).
      then(function(result) {
        chrome.test.assertTrue(result);
        return remoteCall.waitForElementLost(windowId, '.cr-dialog-container');
      });
}
function waitAndAcceptDialog ( windowId ) { return remoteCall . waitForElement ( windowId , '.cr-dialog-ok' ) . then ( remoteCall . callRemoteTestUtil . bind ( remoteCall , 'fakeMouseClick' , windowId , [ '.cr-dialog-ok' ] , null ) ) . then ( function ( result ) { chrome . test . assertTrue ( result ) ; return remoteCall . waitForElementLost ( windowId , '.cr-dialog-container' ) ; } ) ; }
Waits until a dialog with an OK button is shown and accepts it.
Waits until a dialog with an OK button is shown and accepts it .