Relanding https://codereview.chromium.org/564553002/ with fixes for the unit test...
commitc3c0d91ae658c660f01705cd691b783e7f10d3f4
authorananta <ananta@chromium.org>
Tue, 16 Sep 2014 21:49:00 +0000 (16 14:49 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 16 Sep 2014 21:49:28 +0000 (16 21:49 +0000)
tree1237b78abdeff653cefb151bc38921997c4366ad
parente496755ec82723d58556da15f31e9a240befd98e
Relanding  https://codereview.chromium.org/564553002/ with fixes for the unit test failures which required addition of some more plumbing in the form of dummy IO and file blocking threads. The IO thread is needed to ensure that the RenderWidgetHelper instances get freed corectly.

When we switch tabs in chrome, the tab being switched away from gets hidden/shown/hidden.

This occurs in the NativeViewHostAura::NativeViewDetaching code path where we first remove the
clipping window which is the intermediate parent of the web contents view. The clipping window
is hidden which causes the RWHVA::Hide function to get called which initiates the hiding sequence.
Then the web contents view is reparented to the main view which is still visible. Now the RWHVA::Show
function is called which initiates the show sequence. Eventually the main view is hidden, which then
initiates the hide sequence.

Addressed this with the following changes.
1. WebView::AttachWebContents and WebView::DetachWebContents
   now show and hide the webcontents native view. The
   WebContents is shown and hidden as before in
   WebContentsNativeViewAura::OnWindowVisibilityChanged.

2. Removed the WebContentsNativeViewAura::OnWindowParentChanged function.
   This function was present to show and hide the webcontents if the window was visible.
   This should not be needed with the change in #1 above.

3. Added a new file webview_unittest.cc. This contains the unittest WebViewUnitTest.TestWebViewAttachDetachWebContents
   This is run as part of unit_tests.exe.

BUG=412989
R=sky

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

Cr-Commit-Position: refs/heads/master@{#295151}
chrome/chrome_tests_unit.gypi
content/browser/web_contents/web_contents_view_aura.cc
content/browser/web_contents/web_contents_view_aura.h
ui/views/controls/webview/DEPS
ui/views/controls/webview/webview.cc
ui/views/controls/webview/webview.gyp
ui/views/controls/webview/webview_unittest.cc [new file with mode: 0644]