1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. |
4 | |
5 | package org.chromium.android_webview.shell; |
6 | |
7 | import android.app.Application; |
8 | import android.content.Context; |
9 | import android.os.Debug; |
10 | import android.util.Log; |
11 | |
12 | import org.chromium.android_webview.AwBrowserProcess; |
13 | import org.chromium.content.browser.ResourceExtractor; |
14 | import org.chromium.content.common.CommandLine; |
15 | |
16 | public class AwShellApplication extends Application { |
17 | |
18 | private static final String TAG = "AwShellApplication"; |
19 | /** The minimum set of .pak files the test runner needs. */ |
20 | private static final String[] MANDATORY_PAKS = { |
21 | "webviewchromium.pak", "en-US.pak" |
22 | }; |
23 | |
24 | @Override |
25 | public void onCreate() { |
26 | super.onCreate(); |
27 | |
28 | AwShellResourceProvider.registerResources(this); |
29 | |
30 | CommandLine.initFromFile("/data/local/tmp/android-webview-command-line"); |
31 | |
32 | if (CommandLine.getInstance().hasSwitch(CommandLine.WAIT_FOR_JAVA_DEBUGGER)) { |
33 | Log.e(TAG, "Waiting for Java debugger to connect..."); |
34 | Debug.waitForDebugger(); |
35 | Log.e(TAG, "Java debugger connected. Resuming execution."); |
36 | } |
37 | |
38 | ResourceExtractor.setMandatoryPaksToExtract(MANDATORY_PAKS); |
39 | ResourceExtractor.setExtractImplicitLocaleForTesting(false); |
40 | AwBrowserProcess.loadLibrary(); |
41 | AwBrowserProcess.start(this); |
42 | } |
43 | } |