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

Side by Side Diff: components/cronet/android/test/mock_url_request_job_test.cc

Issue 558333007: Setup initial mock url request job tests for Cronet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added jni binding for AddUrlInterceptors() Created 6 years, 3 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 unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698