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

Unified 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: Rebased 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 side-by-side diff with in-line comments
Download patch
Index: components/cronet/android/test/mock_url_request_job_test.cc
diff --git a/components/cronet/android/test/mock_url_request_job_test.cc b/components/cronet/android/test/mock_url_request_job_test.cc
new file mode 100644
index 0000000000000000000000000000000000000000..00d70f1722baaa1e008eb89670ac76db004eb1a6
--- /dev/null
+++ b/components/cronet/android/test/mock_url_request_job_test.cc
@@ -0,0 +1,29 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mock_url_request_job_test.h"
+
+#include "base/android/jni_android.h"
+#include "base/files/file_path.h"
+#include "base/path_service.h"
+#include "base/threading/sequenced_worker_pool.h"
+#include "jni/MockUrlRequestJobTest_jni.h"
+#include "net/test/url_request/url_request_failed_job.h"
+#include "net/test/url_request/url_request_mock_http_job.h"
+
+namespace cronet {
+
+static void AddUrlInterceptors(JNIEnv* env, jobject jcaller) {
+ base::FilePath test_files_root;
+ PathService::Get(base::DIR_ANDROID_APP_DATA, &test_files_root);
+ net::URLRequestMockHTTPJob::AddUrlHandler(
+ test_files_root, new base::SequencedWorkerPool(1, "Worker"));
+ net::URLRequestFailedJob::AddUrlHandler();
+}
+
+bool RegisterMockUrlRequestJobTest(JNIEnv* env) {
+ return RegisterNativesImpl(env);
+}
+
+} // namespace cronet

Powered by Google App Engine
This is Rietveld 408576698