Delete unused downloads page asset.
[chromium-blink-merge.git] / net / test / embedded_test_server / android / embedded_test_server_android.h
blobfb03e37a252bd1580b42d2a5601a815c6664560f
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 #ifndef NET_TEST_EMBEDDED_TEST_SERVER_ANDROID_EMBEDDED_TEST_SERVER_ANDROID_H_
6 #define NET_TEST_EMBEDDED_TEST_SERVER_ANDROID_EMBEDDED_TEST_SERVER_ANDROID_H_
8 #include <jni.h>
10 #include "base/android/jni_weak_ref.h"
11 #include "base/android/scoped_java_ref.h"
12 #include "net/test/embedded_test_server/embedded_test_server.h"
13 #include "net/test/embedded_test_server/http_request.h"
14 #include "net/test/embedded_test_server/http_response.h"
16 namespace net {
17 namespace test_server {
19 // The C++ side of the Java EmbeddedTestServer.
20 class EmbeddedTestServerAndroid {
21 public:
22 EmbeddedTestServerAndroid(JNIEnv* env, jobject obj);
23 ~EmbeddedTestServerAndroid();
25 void Destroy(JNIEnv* env, jobject obj);
27 jboolean InitializeAndWaitUntilReady(JNIEnv* env, jobject jobj);
29 jboolean ShutdownAndWaitUntilComplete(JNIEnv* env, jobject jobj);
31 base::android::ScopedJavaLocalRef<jstring>
32 GetURL(JNIEnv* jenv, jobject jobj, jstring jrelative_url) const;
34 void ServeFilesFromDirectory(JNIEnv* env,
35 jobject jobj,
36 jstring jdirectory_path);
38 static bool RegisterEmbeddedTestServerAndroid(JNIEnv* env);
40 private:
41 JavaObjectWeakGlobalRef weak_java_server_;
43 EmbeddedTestServer test_server_;
45 DISALLOW_COPY_AND_ASSIGN(EmbeddedTestServerAndroid);
48 } // namespace test_server
49 } // namespace net
51 #endif // NET_TEST_EMBEDDED_TEST_SERVER_ANDROID_EMBEDDED_TEST_SERVER_ANDROID_H_