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

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

Issue 2044523003: Revert of 👔 Reland of Move side-loaded test data /sdcard -> /sdcard/gtestdata (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/quic_test_server.cc
diff --git a/components/cronet/android/test/quic_test_server.cc b/components/cronet/android/test/quic_test_server.cc
index 8808d55b56bf29c91e11acb04e4885c2a0709e62..4ad572d4baddff6596cf540972075e90b3f5853a 100644
--- a/components/cronet/android/test/quic_test_server.cc
+++ b/components/cronet/android/test/quic_test_server.cc
@@ -10,7 +10,6 @@
#include "base/bind.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
-#include "base/test/test_support_android.h"
#include "base/threading/thread.h"
#include "components/cronet/android/test/cronet_test_util.h"
#include "jni/QuicTestServer_jni.h"
@@ -30,8 +29,7 @@
base::Thread* g_quic_server_thread = nullptr;
net::QuicSimpleServer* g_quic_server = nullptr;
-void StartOnServerThread(const base::FilePath& test_files_root,
- const base::FilePath& test_data_dir) {
+void StartOnServerThread(const base::FilePath& test_files_root) {
DCHECK(g_quic_server_thread->task_runner()->BelongsToCurrentThread());
DCHECK(!g_quic_server);
@@ -43,7 +41,9 @@
net::QuicConfig config;
// Set up server certs.
- base::FilePath directory = test_data_dir.Append("net/data/ssl/certificates");
+ base::FilePath directory;
+ CHECK(base::android::GetExternalStorageDirectory(&directory));
+ directory = directory.Append("net/data/ssl/certificates");
// TODO(xunjieli): Use scoped_ptr when crbug.com/545474 is fixed.
net::ProofSourceChromium* proof_source = new net::ProofSourceChromium();
CHECK(proof_source->Initialize(
@@ -73,13 +73,8 @@
// the device.
void StartQuicTestServer(JNIEnv* env,
const JavaParamRef<jclass>& /*jcaller*/,
- const JavaParamRef<jstring>& jtest_files_root,
- const JavaParamRef<jstring>& jtest_data_dir) {
+ const JavaParamRef<jstring>& jtest_files_root) {
DCHECK(!g_quic_server_thread);
- base::FilePath test_data_dir(
- base::android::ConvertJavaStringToUTF8(env, jtest_data_dir));
- base::InitAndroidTestPaths(test_data_dir);
-
g_quic_server_thread = new base::Thread("quic server thread");
base::Thread::Options thread_options;
thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
@@ -88,8 +83,7 @@
base::FilePath test_files_root(
base::android::ConvertJavaStringToUTF8(env, jtest_files_root));
g_quic_server_thread->task_runner()->PostTask(
- FROM_HERE,
- base::Bind(&StartOnServerThread, test_files_root, test_data_dir));
+ FROM_HERE, base::Bind(&StartOnServerThread, test_files_root));
}
void ShutdownQuicTestServer(JNIEnv* env,

Powered by Google App Engine
This is Rietveld 408576698