Commit 067146f2 authored by peter@chromium.org's avatar peter@chromium.org

Don't enable asynchronous browser startup when running layout tests.

Layout tests are unable to get the browser context when this mode, introduced
in r215042, has been enabled, and crash somewhere deep down the stack.

BUG=267522

Review URL: https://chromiumcodereview.appspot.com/21878002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215955 0039d316-1c4b-4281-b951-d872f2087c98
parent 3ce45a16
......@@ -73,6 +73,9 @@ public abstract class CommandLine {
// Native switch - content_switches::kEnableSpeechRecognition
public static final String ENABLE_SPEECH_RECOGNITION = "enable-speech-recognition";
// Native switch - shell_switches::kDumpRenderTree
public static final String DUMP_RENDER_TREE = "dump-render-tree";
// Public abstract interface, implemented in derived classes.
// All these methods reflect their native-side counterparts.
/**
......
......@@ -93,19 +93,21 @@ public class ContentShellActivity extends ChromiumActivity {
mShellManager.setStartupUrl(Shell.sanitizeUrl(startupUrl));
}
BrowserStartupConfig.setAsync(new BrowserStartupConfig.StartupCallback() {
@Override
public void run(int startupResult) {
if (startupResult > 0) {
// TODO: Show error message.
Log.e(TAG, "ContentView initialization failed.");
finish();
} else {
finishInitialization();
if (!CommandLine.getInstance().hasSwitch(CommandLine.DUMP_RENDER_TREE)) {
BrowserStartupConfig.setAsync(new BrowserStartupConfig.StartupCallback() {
@Override
public void run(int startupResult) {
if (startupResult > 0) {
// TODO: Show error message.
Log.e(TAG, "ContentView initialization failed.");
finish();
} else {
finishInitialization();
}
}
}
});
});
}
if (!AndroidBrowserProcess.init(this, AndroidBrowserProcess.MAX_RENDERERS_LIMIT)) {
String shellUrl = ShellManager.DEFAULT_SHELL_URL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment