Index: components/cronet/android/test/cronet_test_util.h |
diff --git a/components/cronet/android/test/cronet_test_util.h b/components/cronet/android/test/cronet_test_util.h |
index 5952edba2f703e69ea7d727e1221ecaeb6e47844..713d951adbd529109f5010bb0d2a8acac96fa6c7 100644 |
--- a/components/cronet/android/test/cronet_test_util.h |
+++ b/components/cronet/android/test/cronet_test_util.h |
@@ -6,10 +6,40 @@ |
#define COMPONENTS_CRONET_ANDROID_TEST_CRONET_TEST_UTIL_H_ |
#include <jni.h> |
+#include "base/android/jni_android.h" |
+#include "base/memory/ref_counted.h" |
+#include "base/single_thread_task_runner.h" |
+ |
+namespace net { |
+class URLRequest; |
+class URLRequestContext; |
+} // namespace net |
namespace cronet { |
-bool RegisterCronetTestUtil(JNIEnv* env); |
+// Various test utility functions for testing Cronet. |
+class TestUtil { |
+ public: |
+ // CronetURLRequestContextAdapter manipulation: |
+ |
+ // Returns SingleThreadTaskRunner for the network thread of the context |
+ // adapter. |
+ static scoped_refptr<base::SingleThreadTaskRunner> getTaskRunner( |
xunjieli
2016/10/25 17:51:38
nit: CamelCase here and below.
pauljensen
2016/10/26 17:55:18
Done.
|
+ jlong jcontext_adapter); |
+ // Returns underlying URLRequestContext. |
+ static net::URLRequestContext* getURLRequestContext(jlong jcontext_adapter); |
+ // Run |task| after URLRequestContext is initialized. |
+ static void runAfterContextInit(jlong jcontext_adapter, |
+ const base::Closure& task); |
+ |
+ // CronetURLRequestAdapter manipulation: |
+ |
+ // Returns underlying URLRequest. |
+ static net::URLRequest* getURLRequest(jlong jrequest_adapter); |
+ |
+ // Register JNI. |
+ static bool Register(JNIEnv* env); |
+}; |
} // namespace cronet |