function testResizeEvents() {
  var webview = new WebView();
  webview.src = 'about:blank';
  webview.style.width = '600px';
  webview.style.height = '400px';

  var loadstopListener = function(e) {
    webview.removeEventListener('loadstop', loadstopListener);

    // Observer to look for window.resize event inside <webview>.
    webview.onconsolemessage = function(e) {
      if (e.message === 'ONRESIZE: 500X400') {
        embedder.test.succeed();
      }
    };

    webview.executeScript(
        {
           code: 'window.onresize=function(){' +
                 '  console.log("ONRESIZE: " + window.innerWidth + "X" +' +
                 '              window.innerHeight);' +
                 '}'
        }, function(results) {
          if (!results || !results.length) {
            embedder.test.fail();
            return;
          }
          console.log('Resizing <webview> width from 600px to 500px.');
          webview.style.width = '500px';
        });
  };

  webview.addEventListener('loadstop', loadstopListener);
  document.body.appendChild(webview);
}
// correct order, when resizing occurs.
correct order, when resizing occurs.
correct order when resizing occurs .
function testResizeEvents() {
  var webview = new WebView();
  webview.src = 'about:blank';
  webview.style.width = '600px';
  webview.style.height = '400px';
  var loadstopListener = function(e) {
    webview.removeEventListener('loadstop', loadstopListener);
    webview.onconsolemessage = function(e) {
      if (e.message === 'ONRESIZE: 500X400') {
        embedder.test.succeed();
      }
    };
    webview.executeScript(
        {
           code: 'window.onresize=function(){' +
                 '  console.log("ONRESIZE: " + window.innerWidth + "X" +' +
                 '              window.innerHeight);' +
                 '}'
        }, function(results) {
          if (!results || !results.length) {
            embedder.test.fail();
            return;
          }
          console.log('Resizing <webview> width from 600px to 500px.');
          webview.style.width = '500px';
        });
  };
  webview.addEventListener('loadstop', loadstopListener);
  document.body.appendChild(webview);
}
function testResizeEvents ( ) { var webview = new WebView ( ) ; webview . src = 'about:blank' ; webview . style . width = '600px' ; webview . style . height = '400px' ; var loadstopListener = function ( e ) { webview . removeEventListener ( 'loadstop' , loadstopListener ) ; webview . onconsolemessage = function ( e ) { if ( e . message === 'ONRESIZE: 500X400' ) { embedder . test . succeed ( ) ; } } ; webview . executeScript ( { code : 'window.onresize=function(){' + '  console.log("ONRESIZE: " + window.innerWidth + "X" +' + '              window.innerHeight);' + '}' } , function ( results ) { if ( ! results || ! results . length ) { embedder . test . fail ( ) ; return ; } console . log ( 'Resizing <webview> width from 600px to 500px.' ) ; webview . style . width = '500px' ; } ) ; } ; webview . addEventListener ( 'loadstop' , loadstopListener ) ; document . body . appendChild ( webview ) ; }
correct order, when resizing occurs.
correct order when resizing occurs .
// Observer to look for window.resize event inside <webview>.