function unloadOpenFileDialog(dialog, element = '.button-panel button.ok') {
  return remoteCall.waitForElement(dialog, element).then(() => {
    return remoteCall.callRemoteTestUtil('unload', dialog, [])
        .then(function getDialogErrorCount() {
          return remoteCall.callRemoteTestUtil('getErrorCount', dialog, []);
        })
        .then(function expectNoDialogErrors(errorCount) {
          chrome.test.assertEq(0, errorCount);
        });
  });
}
/**
 * Sends an unload event to an open file dialog (after it is drawn) causing
 * the dialog to shut-down and close.
 *
 * @param {!string} dialog ID of the file dialog window.
 * @param {string} element Element to query for drawing.
 * @return {!Promise} Promise to be fulfilled on success.
 */
Sends an unload event to an open file dialog (after it is drawn) causing
the dialog to shut-down and close.

@param {!string} dialog ID of the file dialog window.
@param {string} element Element to query for drawing.
@return {!Promise} Promise to be fulfilled on success.
Sends an unload event to an open file dialog ( after it is drawn ) causing the dialog to shut - down and close . @param { !string } dialog ID of the file dialog window . @param { string } element Element to query for drawing . @return { !Promise } Promise to be fulfilled on success .
function unloadOpenFileDialog(dialog, element = '.button-panel button.ok') {
  return remoteCall.waitForElement(dialog, element).then(() => {
    return remoteCall.callRemoteTestUtil('unload', dialog, [])
        .then(function getDialogErrorCount() {
          return remoteCall.callRemoteTestUtil('getErrorCount', dialog, []);
        })
        .then(function expectNoDialogErrors(errorCount) {
          chrome.test.assertEq(0, errorCount);
        });
  });
}
function unloadOpenFileDialog ( dialog , element = '.button-panel button.ok' ) { return remoteCall . waitForElement ( dialog , element ) . then ( ( ) => { return remoteCall . callRemoteTestUtil ( 'unload' , dialog , [ ] ) . then ( function getDialogErrorCount ( ) { return remoteCall . callRemoteTestUtil ( 'getErrorCount' , dialog , [ ] ) ; } ) . then ( function expectNoDialogErrors ( errorCount ) { chrome . test . assertEq ( 0 , errorCount ) ; } ) ; } ) ; }
Sends an unload event to an open file dialog (after it is drawn) causing
 the dialog to shut-down and close.
Sends an unload event to an open file dialog ( after it is drawn ) causing the dialog to shut - down and close .