summaryrefslogtreecommitdiffstats
path: root/android_webview/javatests
diff options
context:
space:
mode:
authormichaelbai@chromium.org <michaelbai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-15 21:43:18 +0000
committermichaelbai@chromium.org <michaelbai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-15 21:43:18 +0000
commit86ebc8f3731a84fea14e8688da4eb55aba87008a (patch)
tree2639dccb20377423690fa69468c1df9a0e6de31d /android_webview/javatests
parentf5411e2e50d20ad0c54336fd552a86f36f2b9e63 (diff)
downloadchromium_src-86ebc8f3731a84fea14e8688da4eb55aba87008a.zip
chromium_src-86ebc8f3731a84fea14e8688da4eb55aba87008a.tar.gz
chromium_src-86ebc8f3731a84fea14e8688da4eb55aba87008a.tar.bz2
Throw exception when initialization failed.
Previously the initialization return code was ignored, it will lead us crash later. We need a way to exit and maybe show error message if something wrong during initialization. Using exception might better than returning the result code since the initialization code could be called from constructor and initialization error is an exception at most of time. In activity, the exception is caught, then call finish() to exit. In tests, the exception is wrapped with Error and threw out. BUG=b/7705055 Review URL: https://chromiumcodereview.appspot.com/11567061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176975 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview/javatests')
-rw-r--r--android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewTestBase.java9
1 files changed, 7 insertions, 2 deletions
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 3c8af55..26295b6 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
@@ -22,6 +22,7 @@ import org.chromium.content.browser.test.util.CallbackHelper;
import org.chromium.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
+import org.chromium.content.common.ProcessInitException;
import org.chromium.ui.gfx.ActivityNativeWindow;
import java.util.concurrent.atomic.AtomicInteger;
@@ -51,8 +52,12 @@ public class AndroidWebViewTestBase
@Override
public void run() {
AwTestResourceProvider.registerResources(context);
- ContentViewCore.initChromiumBrowserProcess(
- context, ContentView.MAX_RENDERERS_SINGLE_PROCESS);
+ try {
+ ContentViewCore.initChromiumBrowserProcess(
+ context, ContentView.MAX_RENDERERS_SINGLE_PROCESS);
+ } catch (ProcessInitException e) {
+ throw new Error("Failed to initialize browser process", e);
+ }
}
});
}