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

Unified Diff: components/cronet/android/test/native_test_server.cc

Issue 2043803003: 👔 Reland #2: Move side-loaded test data /sdcard -> /sdcard/gtestdata (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase atop https://codereview.chromium.org/2041723006 Created 4 years, 6 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/native_test_server.cc
diff --git a/components/cronet/android/test/native_test_server.cc b/components/cronet/android/test/native_test_server.cc
index d2b1abe3dcc253c71dfdd580c618596165628e99..60bd3a0070f05ece18867b1c09476d101c118382 100644
--- a/components/cronet/android/test/native_test_server.cc
+++ b/components/cronet/android/test/native_test_server.cc
@@ -18,6 +18,7 @@
#include "base/path_service.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
+#include "base/test/test_support_android.h"
#include "components/cronet/android/test/cronet_test_util.h"
#include "jni/NativeTestServer_jni.h"
#include "net/base/host_port_pair.h"
@@ -164,10 +165,16 @@ std::unique_ptr<net::test_server::HttpResponse> SdchRequestHandler(
jboolean StartNativeTestServer(JNIEnv* env,
const JavaParamRef<jclass>& jcaller,
- const JavaParamRef<jstring>& jtest_files_root) {
+ const JavaParamRef<jstring>& jtest_files_root,
+ const JavaParamRef<jstring>& jtest_data_dir) {
// Shouldn't happen.
if (g_test_server)
return false;
+
+ base::FilePath test_data_dir(
+ base::android::ConvertJavaStringToUTF8(env, jtest_data_dir));
+ base::InitAndroidTestPaths(test_data_dir);
+
g_test_server = new net::EmbeddedTestServer();
g_test_server->RegisterRequestHandler(
base::Bind(&NativeTestServerRequestHandler));

Powered by Google App Engine
This is Rietveld 408576698