| Index: chrome/android/testshell/javatests/src/org/chromium/chrome/testshell/ChromiumTestShellUrlTest.java
|
| diff --git a/chrome/android/testshell/javatests/src/org/chromium/chrome/testshell/ChromiumTestShellUrlTest.java b/chrome/android/testshell/javatests/src/org/chromium/chrome/testshell/ChromiumTestShellUrlTest.java
|
| index 9f44ce9e6483146631ffe8658eda2f1df27ea74d..2a61f6b8972f91c6d5f6990f6ba2b39c777312dc 100644
|
| --- a/chrome/android/testshell/javatests/src/org/chromium/chrome/testshell/ChromiumTestShellUrlTest.java
|
| +++ b/chrome/android/testshell/javatests/src/org/chromium/chrome/testshell/ChromiumTestShellUrlTest.java
|
| @@ -7,6 +7,7 @@ package org.chromium.chrome.testshell;
|
| import android.test.suitebuilder.annotation.SmallTest;
|
|
|
| import org.chromium.base.test.util.Feature;
|
| +import org.chromium.content.browser.ContentViewRenderView;
|
|
|
| public class ChromiumTestShellUrlTest extends ChromiumTestShellTestBase {
|
| // URL used for base tests.
|
| @@ -21,4 +22,31 @@ public class ChromiumTestShellUrlTest extends ChromiumTestShellTestBase {
|
| // Make sure the activity was created as expected.
|
| assertNotNull(activity);
|
| }
|
| +
|
| + /**
|
| + * Tests that creating an extra ContentViewRenderView does not cause an assert because we would
|
| + * initialize the compositor twice http://crbug.com/162312
|
| + */
|
| + @SmallTest
|
| + @Feature({"Main"})
|
| + public void testCompositorInit() throws Exception {
|
| + // Start the ChromiumTestShell, this loads the native library and create an instance of
|
| + // ContentViewRenderView.
|
| + final ChromiumTestShellActivity activity = launchChromiumTestShellWithUrl(URL);
|
| + waitForActiveShellToBeDoneLoading();
|
| +
|
| + // Now create a new ContentViewRenderView, it should not assert.
|
| + try {
|
| + runTestOnUiThread(new Runnable() {
|
| + @Override
|
| + public void run() {
|
| + ContentViewRenderView contentViewRenderView =
|
| + new ContentViewRenderView(getInstrumentation().getTargetContext());
|
| + contentViewRenderView.setCurrentContentView(activity.getActiveContentView());
|
| + }
|
| + });
|
| + } catch (Throwable e) {
|
| + fail("Could not create a ContentViewRenderView: " + e);
|
| + }
|
| + }
|
| }
|
|
|