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

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

Issue 1975153003: Enable NativeActivity based Android tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/NativeUnitTestNativeActivity.java
diff --git a/testing/android/native_test/java/src/org/chromium/native_test/NativeUnitTestNativeActivity.java b/testing/android/native_test/java/src/org/chromium/native_test/NativeUnitTestNativeActivity.java
new file mode 100644
index 0000000000000000000000000000000000000000..d0dfd485ba14c88bc8dd879f97872d674329220b
--- /dev/null
+++ b/testing/android/native_test/java/src/org/chromium/native_test/NativeUnitTestNativeActivity.java
@@ -0,0 +1,32 @@
+// 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.app.NativeActivity;
+import android.os.Bundle;
+
+/**
+ * A {@link android.app.NativeActivity} for running native unit tests.
+ * (i.e., not browser tests)
+ */
+public class NativeUnitTestNativeActivity extends NativeActivity {
+ private NativeUnitTest mTest = new NativeUnitTest();
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ mTest.preCreate(this);
+ super.onCreate(savedInstanceState);
+ mTest.postCreate(this);
+ }
+
+ @Override
+ public void onStart() {
+ super.onStart();
+ // Force running in sub thread,
+ // since NativeActivity processes Looper messages in native code,
+ // which makes invoking the test runner Handler problematic.
+ mTest.postStart(this, true);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698