function testAutosizeBeforeNavigation() {
  var webview = document.createElement('webview');

  webview.setAttribute('autosize', 'true');
  webview.setAttribute('minwidth', 200);
  webview.setAttribute('maxwidth', 210);
  webview.setAttribute('minheight', 100);
  webview.setAttribute('maxheight', 110);

  webview.addEventListener('sizechanged', function(e) {
    // The old size should be the default size of the webview, which at the time
    // of writing this comment is 300 x 300, but is not important to this test
    // and could change in the future, so it is not checked here.
    embedder.test.assertTrue(e.newWidth >= 200 && e.newWidth <= 210);
    embedder.test.assertTrue(e.newHeight >= 100 && e.newHeight <= 110);
    embedder.test.succeed();
  });

  webview.setAttribute('src', 'data:text/html,webview test sizechanged event');
  document.body.appendChild(webview);
}
// navigation then the guest starts auto-sized.
navigation then the guest starts auto-sized.
navigation then the guest starts auto - sized .
function testAutosizeBeforeNavigation() {
  var webview = document.createElement('webview');
  webview.setAttribute('autosize', 'true');
  webview.setAttribute('minwidth', 200);
  webview.setAttribute('maxwidth', 210);
  webview.setAttribute('minheight', 100);
  webview.setAttribute('maxheight', 110);
  webview.addEventListener('sizechanged', function(e) {
    embedder.test.assertTrue(e.newWidth >= 200 && e.newWidth <= 210);
    embedder.test.assertTrue(e.newHeight >= 100 && e.newHeight <= 110);
    embedder.test.succeed();
  });
  webview.setAttribute('src', 'data:text/html,webview test sizechanged event');
  document.body.appendChild(webview);
}
function testAutosizeBeforeNavigation ( ) { var webview = document . createElement ( 'webview' ) ; webview . setAttribute ( 'autosize' , 'true' ) ; webview . setAttribute ( 'minwidth' , 200 ) ; webview . setAttribute ( 'maxwidth' , 210 ) ; webview . setAttribute ( 'minheight' , 100 ) ; webview . setAttribute ( 'maxheight' , 110 ) ; webview . addEventListener ( 'sizechanged' , function ( e ) { embedder . test . assertTrue ( e . newWidth >= 200 && e . newWidth <= 210 ) ; embedder . test . assertTrue ( e . newHeight >= 100 && e . newHeight <= 110 ) ; embedder . test . succeed ( ) ; } ) ; webview . setAttribute ( 'src' , 'data:text/html,webview test sizechanged event' ) ; document . body . appendChild ( webview ) ; }
navigation then the guest starts auto-sized.
navigation then the guest starts auto - sized .
// The old size should be the default size of the webview, which at the time // of writing this comment is 300 x 300, but is not important to this test // and could change in the future, so it is not checked here.