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

  var step = 1;
  var sizeChangeHandler = function(e) {
    switch (step) {
      case 1:
        // This is the sizechanged event for autosize.

        // Remove attributes.
        webview.removeAttribute('minwidth');
        webview.removeAttribute('maxwidth');
        webview.removeAttribute('minheight');
        webview.removeAttribute('maxheight');
        webview.removeAttribute('autosize');

        // We'd get one more sizechanged event after we turn off
        // autosize.
        webview.style.width = '500px';
        webview.style.height = '500px';
        break;
      case 2:
        embedder.test.succeed();
        break;
    }

    ++step;
  };

  webview.addEventListener('loadstop', function(e) {
    webview.minwidth = 300;
    webview.maxwidth = 700;
    webview.minheight = 600;
    webview.maxheight = 400;
    webview.autosize = true;
  });

  webview.addEventListener('sizechanged', sizeChangeHandler);

  webview.style.width = '640px';
  webview.style.height = '480px';
  webview.setAttribute('src', 'data:text/html,webview check autosize');
  document.body.appendChild(webview);
}
// without crashing the plugin, or throwing errors.
without crashing the plugin, or throwing errors.
without crashing the plugin or throwing errors .
function testAutosizeRemoveAttributes() {
  var webview = document.createElement('webview');
  var step = 1;
  var sizeChangeHandler = function(e) {
    switch (step) {
      case 1:
        webview.removeAttribute('minwidth');
        webview.removeAttribute('maxwidth');
        webview.removeAttribute('minheight');
        webview.removeAttribute('maxheight');
        webview.removeAttribute('autosize');
        webview.style.width = '500px';
        webview.style.height = '500px';
        break;
      case 2:
        embedder.test.succeed();
        break;
    }
    ++step;
  };
  webview.addEventListener('loadstop', function(e) {
    webview.minwidth = 300;
    webview.maxwidth = 700;
    webview.minheight = 600;
    webview.maxheight = 400;
    webview.autosize = true;
  });
  webview.addEventListener('sizechanged', sizeChangeHandler);
  webview.style.width = '640px';
  webview.style.height = '480px';
  webview.setAttribute('src', 'data:text/html,webview check autosize');
  document.body.appendChild(webview);
}
function testAutosizeRemoveAttributes ( ) { var webview = document . createElement ( 'webview' ) ; var step = 1 ; var sizeChangeHandler = function ( e ) { switch ( step ) { case 1 : webview . removeAttribute ( 'minwidth' ) ; webview . removeAttribute ( 'maxwidth' ) ; webview . removeAttribute ( 'minheight' ) ; webview . removeAttribute ( 'maxheight' ) ; webview . removeAttribute ( 'autosize' ) ; webview . style . width = '500px' ; webview . style . height = '500px' ; break ; case 2 : embedder . test . succeed ( ) ; break ; } ++ step ; } ; webview . addEventListener ( 'loadstop' , function ( e ) { webview . minwidth = 300 ; webview . maxwidth = 700 ; webview . minheight = 600 ; webview . maxheight = 400 ; webview . autosize = true ; } ) ; webview . addEventListener ( 'sizechanged' , sizeChangeHandler ) ; webview . style . width = '640px' ; webview . style . height = '480px' ; webview . setAttribute ( 'src' , 'data:text/html,webview check autosize' ) ; document . body . appendChild ( webview ) ; }
without crashing the plugin, or throwing errors.
without crashing the plugin or throwing errors .
// This is the sizechanged event for autosize. // Remove attributes. // We'd get one more sizechanged event after we turn off // autosize.