Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2019)

Unified Diff: android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewTestRunnerApplication.java

Issue 10855171: Add a test runner for android_webview. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address feedback Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewTestRunnerApplication.java
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewTestRunnerApplication.java b/android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewTestRunnerApplication.java
new file mode 100644
index 0000000000000000000000000000000000000000..7fb1d4c9631c375a9bbf9cb6091b6da02ee649ff
--- /dev/null
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewTestRunnerApplication.java
@@ -0,0 +1,46 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.android_webview.test;
+
+import android.app.Application;
+
+import org.chromium.base.PathUtils;
+import org.chromium.content.app.LibraryLoader;
+import org.chromium.content.browser.ResourceExtractor;
+import org.chromium.content.common.CommandLine;
+
+import android.util.Log;
+
+public class AndroidWebViewTestRunnerApplication extends Application {
+
+ /**
+ * The name of the library to load.
+ */
+ private static final String NATIVE_LIBRARY = "webview";
+
+ /** The minimum set of .pak files Chrome needs. */
+ private static final String[] CHROME_MANDATORY_PAKS = {
+ "chrome.pak", "chrome_100_percent.pak", "en-US.pak", "resources.pak",
+ };
+
+ private static final String PRIVATE_DATA_DIRECTORY_SUFFIX = "webview";
+
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ initializeApplicationParameters();
+ }
+
+ /** Handles initializing the common application parameters. */
+ private static void initializeApplicationParameters() {
+ CommandLine.initFromFile("/data/local/tmp/chrome-command-line");
+ PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX);
+ // We don't need to extract any paks because for WebView, they are
+ // in the system image.
+ ResourceExtractor.setMandatoryPaksToExtract(CHROME_MANDATORY_PAKS);
+ LibraryLoader.setLibraryToLoad(NATIVE_LIBRARY);
+ LibraryLoader.loadAndInitSync();
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698