Fix OOP <webview> resize and autosize.
commita92068219280fb0f892500f11525ffc0e4a00eee
authorlazyboy <lazyboy@chromium.org>
Wed, 16 Sep 2015 20:07:20 +0000 (16 13:07 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 16 Sep 2015 20:08:20 +0000 (16 20:08 +0000)
treebffd89e7dbed36cef08da636c4b392eb5f448bd0
parent77bb41db74b022fb53f3aa0296fe610a1294acb3
Fix OOP <webview> resize and autosize.

This CL removes the dependency of updating guest's size based
  on compositor frame: BPG::UpdateGuestSizeIfNecessary(). This
  info is not readily available in --site-per-process since we
  do not have a RWHVGuest. Instead, this CL uses
  WebContentsObserver::ResizeDueToAutoResize to resize guest when
  autosize is turned on.

This CL also changes the test to look at actual guest window
  resizing in one test: testResizeEvents().

I've seen two tests seeing window.onresize with original guest
  size (300x300) some times, I've added an exception for this
  initial size, which should help deflake these tests. These tests
  are:
testResizeWebviewResizesContent()
testResizeWebviewWithDisplayNoneResizesContent()

There's a dependent blink patch for this CL:
https://chromiumcodereview.appspot.com/1309343002/

TBR=jam@chromium.org testing/buildbot/chromium.fyi.json
BUG=517291
Test=With --site-per-process, run a <webview> in a chrome app.
1) Notice resizing a <webview> works, e.g.
  document.querySelector('webview').style.width = '1000px';
2) Notice that turning on autosize also works, e.g.
  var w = document.querySelector('webview');
  w.minheight = '400', w.maxheight = '800';
  w.minwidth = '500', w.maxheight = '600';
  w.setAttribute('autosize', true);

Review URL: https://codereview.chromium.org/1262553003

Cr-Commit-Position: refs/heads/master@{#349205}
chrome/test/data/extensions/platform_apps/web_view/shim/main.js
components/guest_view/browser/guest_view_base.cc
components/guest_view/browser/guest_view_base.h
content/browser/browser_plugin/browser_plugin_guest.cc
content/browser/browser_plugin/browser_plugin_guest.h
content/browser/frame_host/render_widget_host_view_guest.cc
content/browser/frame_host/render_widget_host_view_guest_unittest.cc
content/public/browser/guest_host.h
testing/buildbot/chromium.fyi.json