cf7261903b9ac6c187dba1717a8f62d1ef7b4c42
[platform/framework/web/crosswalk.git] / src / content / shell / android / linker_test_apk / src / org / chromium / chromium_linker_test_apk / ChromiumLinkerTestApplication.java
1 // Copyright 2014 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.chromium_linker_test_apk;
6
7 import android.app.Application;
8
9 import org.chromium.base.PathUtils;
10 import org.chromium.base.ResourceExtractor;
11
12 /**
13  * Application for testing the Chromium Linker
14  */
15 public class ChromiumLinkerTestApplication extends Application {
16
17     /**
18      * icudtl.dat provides ICU (i18n library) with all the data for its
19      * operation. We use to link it statically to our binary, but not any more
20      * so that we have to install it along with other mandatory pak files.
21      * See src/third_party/icu/README.chromium.
22      *
23      *  V8's initial snapshot used to be statically linked to the binary, but
24      *  now it's loaded from external files. Therefore we need to install such
25      *  snapshots (natives_blob.bin and snapshot.bin) along with pak files.
26      */
27     private static final String[] MANDATORY_PAK_FILES = new String[] {
28         "content_shell.pak",
29         "icudtl.dat",
30         "natives_blob.bin",
31         "snapshot_blob.bin"
32     };
33     private static final String PRIVATE_DATA_DIRECTORY_SUFFIX = "chromium_linker_test";
34
35     @Override
36     public void onCreate() {
37         super.onCreate();
38         initializeApplicationParameters();
39     }
40
41     public static void initializeApplicationParameters() {
42         ResourceExtractor.setMandatoryPaksToExtract(MANDATORY_PAK_FILES);
43         PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX);
44     }
45
46 }