| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 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. | |
| 4 | |
| 5 #include "mock_url_request_job_test.h" | |
| 6 | |
| 7 #include "base/android/jni_android.h" | |
| 8 #include "base/files/file_path.h" | |
| 9 #include "base/path_service.h" | |
| 10 #include "base/threading/sequenced_worker_pool.h" | |
| 11 #include "jni/MockUrlRequestJobTest_jni.h" | |
| 12 #include "net/test/url_request/url_request_failed_job.h" | |
| 13 #include "net/test/url_request/url_request_mock_http_job.h" | |
| 14 | |
| 15 namespace cronet { | |
| 16 | |
| 17 static void AddUrlInterceptors(JNIEnv* env, jobject jcaller) { | |
| 18 base::FilePath test_files_root; | |
| 19 PathService::Get(base::DIR_ANDROID_APP_DATA, &test_files_root); | |
| 20 net::URLRequestMockHTTPJob::AddUrlHandler( | |
| 21 test_files_root, new base::SequencedWorkerPool(1, "Worker")); | |
| 22 net::URLRequestFailedJob::AddUrlHandler(); | |
| 23 } | |
| 24 | |
| 25 bool RegisterMockUrlRequestJobTest(JNIEnv* env) { | |
| 26 return RegisterNativesImpl(env); | |
| 27 } | |
| 28 | |
| 29 } // namespace cronet | |
| OLD | NEW |