    dialog.removeEventListener('iron-overlay-opened', onFirstOpen);
            dialog.addEventListener('iron-overlay-closed', onFirstClose);
            // Set the focus on dismiss button
            MockInteractions.focus(Polymer.dom(dialog).querySelector('[dialog-dismiss]'));
            // Close the dialog
            dialog.close();
          }

          function onFirstClose() {
            dialog.removeEventListener('iron-overlay-closed', onFirstClose);
            dialog.addEventListener('iron-over