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

Unified Diff: testing/android/native_test/java/src/org/chromium/native_test/NativeUnitTestActivity.java

Issue 1126543009: [Android] Refactor the native test wrappers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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: testing/android/native_test/java/src/org/chromium/native_test/NativeUnitTestActivity.java
diff --git a/testing/android/native_test/java/src/org/chromium/native_test/NativeUnitTestActivity.java b/testing/android/native_test/java/src/org/chromium/native_test/NativeUnitTestActivity.java
new file mode 100644
index 0000000000000000000000000000000000000000..e987169c14a690be66b04ac22e03ffad7ebc6122
--- /dev/null
+++ b/testing/android/native_test/java/src/org/chromium/native_test/NativeUnitTestActivity.java
@@ -0,0 +1,37 @@
+// Copyright 2015 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.native_test;
+
+import android.os.Bundle;
+
+import org.chromium.base.PathUtils;
+import org.chromium.base.PowerMonitor;
+import org.chromium.base.ResourceExtractor;
+
+/**
+ * An {@link android.app.Activity} for running native unit tests.
+ * (i.e., not browser tests)
+ */
+public class NativeUnitTestActivity extends NativeTestActivity {
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ // Needed by path_utils_unittest.cc
+ PathUtils.setPrivateDataDirectorySuffix("chrome", getApplicationContext());
+
+ ResourceExtractor resourceExtractor = ResourceExtractor.get(getApplicationContext());
+ resourceExtractor.setExtractAllPaksAndV8SnapshotForTesting();
+ resourceExtractor.startExtractingResources();
+ resourceExtractor.waitForCompletion();
+
+ // Needed by system_monitor_unittest.cc
+ PowerMonitor.createForTests(this);
+
+ loadLibraries();
+ }
+
+}

Powered by Google App Engine
This is Rietveld 408576698