function testNewWindowTwoListeners() {
  var webview = document.createElement('webview');
  var error = false;
  webview.addEventListener('newwindow', function(e) {
    e.preventDefault();
    var newwebview = document.createElement('webview');
    document.body.appendChild(newwebview);
    try {
      e.window.attach(newwebview);
    } catch (err) {
      embedder.test.fail();
    }
  });
  webview.addEventListener('newwindow', function(e) {
    e.preventDefault();
    try {
      e.window.discard();
    } catch (err) {
      embedder.test.succeed();
    }
  });
  webview.setAttribute('src', embedder.windowOpenGuestURL);
  document.body.appendChild(webview);
}
// subsequent calls throw an exception.
subsequent calls throw an exception.
subsequent calls throw an exception .
function testNewWindowTwoListeners() {
  var webview = document.createElement('webview');
  var error = false;
  webview.addEventListener('newwindow', function(e) {
    e.preventDefault();
    var newwebview = document.createElement('webview');
    document.body.appendChild(newwebview);
    try {
      e.window.attach(newwebview);
    } catch (err) {
      embedder.test.fail();
    }
  });
  webview.addEventListener('newwindow', function(e) {
    e.preventDefault();
    try {
      e.window.discard();
    } catch (err) {
      embedder.test.succeed();
    }
  });
  webview.setAttribute('src', embedder.windowOpenGuestURL);
  document.body.appendChild(webview);
}
function testNewWindowTwoListeners ( ) { var webview = document . createElement ( 'webview' ) ; var error = false ; webview . addEventListener ( 'newwindow' , function ( e ) { e . preventDefault ( ) ; var newwebview = document . createElement ( 'webview' ) ; document . body . appendChild ( newwebview ) ; try { e . window . attach ( newwebview ) ; } catch ( err ) { embedder . test . fail ( ) ; } } ) ; webview . addEventListener ( 'newwindow' , function ( e ) { e . preventDefault ( ) ; try { e . window . discard ( ) ; } catch ( err ) { embedder . test . succeed ( ) ; } } ) ; webview . setAttribute ( 'src' , embedder . windowOpenGuestURL ) ; document . body . appendChild ( webview ) ; }
subsequent calls throw an exception.
subsequent calls throw an exception .