• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2017 The Chromium Authors
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 "base/test/android/url_utils.h"
6 
7 #include "base/android/jni_string.h"
8 #include "base/android/scoped_java_ref.h"
9 
10 // Must come after all headers that specialize FromJniType() / ToJniType().
11 #include "base/test/test_support_jni_headers/UrlUtils_jni.h"
12 
13 namespace base {
14 namespace android {
15 
GetIsolatedTestRoot()16 FilePath GetIsolatedTestRoot() {
17   JNIEnv* env = jni_zero::AttachCurrentThread();
18   ScopedJavaLocalRef<jstring> jtest_data_dir =
19       Java_UrlUtils_getIsolatedTestRoot(env);
20   base::FilePath test_data_dir(
21       base::android::ConvertJavaStringToUTF8(env, jtest_data_dir));
22   return test_data_dir;
23 }
24 
25 }  // namespace android
26 }  // namespace base
27