Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / android_webview / test / shell / src / org / chromium / android_webview / shell / AwShellApplication.java
1 // Copyright 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.os.Debug;
8 import android.util.Log;
9
10 import org.chromium.android_webview.AwBrowserProcess;
11 import org.chromium.base.BaseSwitches;
12 import org.chromium.base.CommandLine;
13 import org.chromium.base.ResourceExtractor;
14 import org.chromium.base.TraceEvent;
15 import org.chromium.content.app.ContentApplication;
16
17 /**
18  * The android_webview shell Application subclass.
19  */
20 public class AwShellApplication extends ContentApplication {
21
22     private static final String TAG = "AwShellApplication";
23     /** The minimum set of .pak files the test runner needs. */
24     private static final String[] MANDATORY_PAKS = { "icudtl.dat",
25                                                      "natives_blob.bin",
26                                                      "snapshot_blob.bin" };
27
28     @Override
29     public void onCreate() {
30         super.onCreate();
31
32         AwShellResourceProvider.registerResources(this);
33
34         CommandLine.initFromFile("/data/local/tmp/android-webview-command-line");
35
36         if (CommandLine.getInstance().hasSwitch(BaseSwitches.WAIT_FOR_JAVA_DEBUGGER)) {
37             Log.e(TAG, "Waiting for Java debugger to connect...");
38             Debug.waitForDebugger();
39             Log.e(TAG, "Java debugger connected. Resuming execution.");
40         }
41
42         ResourceExtractor.setMandatoryPaksToExtract(MANDATORY_PAKS);
43         ResourceExtractor.setExtractImplicitLocaleForTesting(false);
44         AwBrowserProcess.loadLibrary();
45
46         if (CommandLine.getInstance().hasSwitch(AwShellSwitches.ENABLE_ATRACE)) {
47             Log.e(TAG, "Enabling Android trace.");
48             TraceEvent.setATraceEnabled(true);
49         }
50     }
51
52     @Override
53     public void initCommandLine() {
54         throw new UnsupportedOperationException();
55     }
56 }