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

Unified Diff: net/base/run_all_unittests.cc

Issue 10668047: Register JNI methods before running unittests on android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disabling some tests which errorneously passed before Created 8 years, 6 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
« no previous file with comments | « build/android/gtest_filter/net_unittests_disabled ('k') | testing/android/native_test_launcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/run_all_unittests.cc
diff --git a/net/base/run_all_unittests.cc b/net/base/run_all_unittests.cc
index a7b82e9b63f41e60f3bbe3ba9643e6d102e37da2..a139a8fc8468d2f2b44c14b71ff100c2b42bf694 100644
--- a/net/base/run_all_unittests.cc
+++ b/net/base/run_all_unittests.cc
@@ -10,12 +10,24 @@
#include "net/socket/ssl_server_socket.h"
#include "net/spdy/spdy_session.h"
+#if defined(OS_ANDROID)
+#include "base/android/jni_android.h"
+#include "net/android/net_jni_registrar.h"
+#endif
+
using net::internal::ClientSocketPoolBaseHelper;
using net::SpdySession;
int main(int argc, char** argv) {
// Record histograms, so we can get histograms data in tests.
base::StatisticsRecorder recorder;
+
+#if defined(OS_ANDROID)
+ // Register JNI bindings for android. Doing it early as the test suite setup
+ // may initiate a call to Java.
+ net::android::RegisterJni(base::android::AttachCurrentThread());
+#endif
+
NetTestSuite test_suite(argc, argv);
ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false);
« no previous file with comments | « build/android/gtest_filter/net_unittests_disabled ('k') | testing/android/native_test_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698