OLD | NEW |
(Empty) | |
| 1 package org.chromium.android_webview.test; |
| 2 |
| 3 import android.app.Application; |
| 4 |
| 5 import org.chromium.base.PathUtils; |
| 6 import org.chromium.content.app.LibraryLoader; |
| 7 import org.chromium.content.browser.ResourceExtractor; |
| 8 import org.chromium.content.common.CommandLine; |
| 9 |
| 10 import android.util.Log; |
| 11 |
| 12 public class AndroidWebViewTestRunnerApplication extends Application { |
| 13 |
| 14 /** |
| 15 * The name of the library to load. |
| 16 */ |
| 17 private static final String NATIVE_LIBRARY = "webview"; |
| 18 |
| 19 /** The minimum set of .pak files Chrome needs. */ |
| 20 private static final String[] CHROME_MANDATORY_PAKS = { |
| 21 "chrome.pak", "chrome_100_percent.pak", "en-US.pak", "resources.pak", |
| 22 }; |
| 23 |
| 24 private static final String PRIVATE_DATA_DIRECTORY_SUFFIX = "webview"; |
| 25 |
| 26 @Override |
| 27 public void onCreate() { |
| 28 super.onCreate(); |
| 29 initializeApplicationParameters(); |
| 30 } |
| 31 |
| 32 /** Handles initializing the common application parameters. */ |
| 33 private static void initializeApplicationParameters() { |
| 34 CommandLine.initFromFile("/data/local/tmp/chrome-command-line"); |
| 35 PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX); |
| 36 // We don't need to extract any paks because for WebView, they are |
| 37 // in the system image. |
| 38 ResourceExtractor.setMandatoryPaksToExtract(CHROME_MANDATORY_PAKS); |
| 39 LibraryLoader.setLibraryToLoad(NATIVE_LIBRARY); |
| 40 LibraryLoader.loadAndInitSync(); |
| 41 } |
| 42 } |
OLD | NEW |