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

Unified Diff: content/shell/android/browsertests_apk/content_browser_tests_android.cc

Issue 12213021: Android content_browsertests: Allow processing java tasks in nested mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 10 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: content/shell/android/browsertests_apk/content_browser_tests_android.cc
diff --git a/content/shell/android/browsertests_apk/content_browser_tests_android.cc b/content/shell/android/browsertests_apk/content_browser_tests_android.cc
index 48b73e9fc2e971cdbc02f241d2d95a1b24eda8b2..165f8042b9aee525c52d0d31103012c421f75e21 100644
--- a/content/shell/android/browsertests_apk/content_browser_tests_android.cc
+++ b/content/shell/android/browsertests_apk/content_browser_tests_android.cc
@@ -20,7 +20,10 @@
#include "base/stringprintf.h"
#include "base/strings/string_tokenizer.h"
#include "content/public/app/android_library_loader_hooks.h"
+#include "content/public/app/content_main.h"
#include "content/shell/android/shell_jni_registrar.h"
+#include "content/shell/shell_main_delegate.h"
+#include "content/test/browser_test_message_pump_android.h"
#include "jni/ContentBrowserTestsActivity_jni.h"
#include "testing/android/native_test_util.h"
@@ -42,6 +45,8 @@ static const char kCommandLineFilePath[] =
} // namespace
+namespace content {
+
static void RunTests(JNIEnv* env,
jobject obj,
jstring jfiles_dir,
@@ -77,6 +82,7 @@ static void RunTests(JNIEnv* env,
ScopedMainEntryLogger scoped_main_entry_logger;
main(argc, &argv[0]);
}
+} // namespace content
// This is called by the VM when the shared library is first loaded.
JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
@@ -89,8 +95,12 @@ JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
if (!content::android::RegisterShellJni(env))
return -1;
- if (!RegisterNativesImpl(env))
+ if (!content::BrowserTestMessagePumpAndroid::RegisterJni(env))
+ return -1;
+
+ if (!content::RegisterNativesImpl(env))
return -1;
+ content::SetContentMainDelegate(new content::ShellMainDelegate());
return JNI_VERSION_1_4;
}

Powered by Google App Engine
This is Rietveld 408576698