Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / net / test / android / net_test_jni_onload.cc
blobac54b1fb1c1b6dbbea6a603f020a3b5e8945e422
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "net/test/android/net_test_jni_onload.h"
7 #include "base/android/base_jni_onload.h"
8 #include "base/bind.h"
9 #include "net/test/embedded_test_server/android/embedded_test_server_android.h"
11 namespace net {
12 namespace test {
14 namespace {
16 bool RegisterJNI(JNIEnv* env) {
17 return net::test_server::EmbeddedTestServerAndroid::
18 RegisterEmbeddedTestServerAndroid(env);
21 bool Init() {
22 return true;
25 } // namesapce
27 bool OnJNIOnLoadRegisterJNI(JavaVM* vm) {
28 std::vector<base::android::RegisterCallback> register_callbacks;
29 register_callbacks.push_back(base::Bind(&RegisterJNI));
30 return base::android::OnJNIOnLoadRegisterJNI(vm, register_callbacks);
33 bool OnJNIOnLoadInit() {
34 std::vector<base::android::InitCallback> init_callbacks;
35 init_callbacks.push_back(base::Bind(&Init));
36 return base::android::OnJNIOnLoadInit(init_callbacks);
39 } // namespace test
40 } // namespace net