diff options
author | boliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-08 03:08:50 +0000 |
---|---|---|
committer | boliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-08 03:08:50 +0000 |
commit | f4d884436d740ef9eec7b5a6e9b027f5b2ce9d37 (patch) | |
tree | fa9e3f800101e8d369d2740ef57b21522961d088 /android_webview | |
parent | 9b0a21d68db929eff7d65cf85b7c768eb094af26 (diff) | |
download | chromium_src-f4d884436d740ef9eec7b5a6e9b027f5b2ce9d37.zip chromium_src-f4d884436d740ef9eec7b5a6e9b027f5b2ce9d37.tar.gz chromium_src-f4d884436d740ef9eec7b5a6e9b027f5b2ce9d37.tar.bz2 |
Fix hang in Android WebView release build tests
SurfaceTexture.detachFromGLContext is not present in ICS and the old
workaround of using a NullCompositor lead to the test creating
TextureImageTransportSurface in ImageTransportSurface::CreateSurface.
This path is wrong and not well tested in single-process mode and recently
lead to a deadlock hang in release build only tests (see bug).
Fixed by creating the real compositor but just avoid calling the missing
method in ICS. The Java method is loaded lazily so this does not cause
an error at run time.
BUG=167236,161864
Android only change. Ran through Android trybots.
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/11787031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175480 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview')
3 files changed, 6 insertions, 51 deletions
diff --git a/android_webview/browser/aw_browser_main_parts.cc b/android_webview/browser/aw_browser_main_parts.cc index c8af525..6fa4f90 100644 --- a/android_webview/browser/aw_browser_main_parts.cc +++ b/android_webview/browser/aw_browser_main_parts.cc @@ -37,11 +37,10 @@ void AwBrowserMainParts::PreEarlyInitialization() { net::NetworkChangeNotifier::SetFactory( new net::NetworkChangeNotifierFactoryAndroid()); content::Compositor::InitializeWithFlags( - UseCompositorDirectDraw() ? - content::Compositor::DIRECT_CONTEXT_ON_DRAW_THREAD : 0); + content::Compositor::DIRECT_CONTEXT_ON_DRAW_THREAD); // Android WebView does not use default MessageLoop. It has its own - // Android specific MessageLoop. ALso see MainMessageLoopRun. + // Android specific MessageLoop. Also see MainMessageLoopRun. DCHECK(!main_message_loop_.get()); main_message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); MessageLoopForUI::current()->Start(); diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewTestBase.java b/android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewTestBase.java index 408c2d3..89f477e 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewTestBase.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewTestBase.java @@ -36,8 +36,7 @@ import java.util.concurrent.TimeUnit; */ public class AndroidWebViewTestBase extends ActivityInstrumentationTestCase2<AndroidWebViewTestRunnerActivity> { - // TODO(boliu): Revert back to 15 seconds after crbug.com/167236 is fixed. - protected static int WAIT_TIMEOUT_SECONDS = 90; + protected static int WAIT_TIMEOUT_SECONDS = 15; private static final int CHECK_INTERVAL = 100; protected static final boolean NORMAL_VIEW = false; protected static final boolean INCOGNITO_VIEW = true; diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc index 778400e..2343b6a 100644 --- a/android_webview/native/aw_contents.cc +++ b/android_webview/native/aw_contents.cc @@ -105,44 +105,6 @@ class AwContentsUserData : public base::SupportsUserData::Data { AwContents* contents_; }; -// Work-around for http://crbug.com/161864. TODO(joth): Remove this class when -// that bug is closed. -class NullCompositor : public content::Compositor { - public: - NullCompositor() {} - virtual ~NullCompositor() {} - - // Compositor - virtual void SetRootLayer(scoped_refptr<cc::Layer> root) OVERRIDE {} - virtual void SetWindowBounds(const gfx::Size& size) OVERRIDE {} - virtual void SetVisible(bool visible) OVERRIDE {} - virtual void SetWindowSurface(ANativeWindow* window) OVERRIDE {} - virtual bool CompositeAndReadback(void *pixels, const gfx::Rect& rect) - OVERRIDE { - return false; - } - virtual void Composite() {} - virtual WebKit::WebGLId GenerateTexture(gfx::JavaBitmap& bitmap) OVERRIDE { - return 0; - } - virtual WebKit::WebGLId GenerateCompressedTexture(gfx::Size& size, - int data_size, - void* data) OVERRIDE { - return 0; - } - virtual void DeleteTexture(WebKit::WebGLId texture_id) OVERRIDE {} - virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id, - gfx::JavaBitmap& bitmap) OVERRIDE { - return false; - } - virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id, - const gfx::Rect& src_rect, - gfx::JavaBitmap& bitmap) OVERRIDE { - return false; - } - virtual void SetHasTransparentBackground(bool flag) OVERRIDE {} -}; - } // namespace // static @@ -173,14 +135,9 @@ AwContents::AwContents(JNIEnv* env, } void AwContents::ResetCompositor() { - if (UseCompositorDirectDraw()) { - compositor_.reset(content::Compositor::Create(this)); - if (scissor_clip_layer_.get()) - AttachLayerTree(); - } else { - LOG(WARNING) << "Running on unsupported device: using null Compositor"; - compositor_.reset(new NullCompositor); - } + compositor_.reset(content::Compositor::Create(this)); + if (scissor_clip_layer_.get()) + AttachLayerTree(); } void AwContents::SetWebContents(content::WebContents* web_contents) { |