xref: /aosp_15_r20/external/libchrome/base/test/android/url_utils.cc (revision 635a864187cb8b6c713ff48b7e790a6b21769273)
1 // Copyright 2017 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 "base/test/android/url_utils.h"
6 
7 #include "base/android/jni_string.h"
8 #include "base/android/scoped_java_ref.h"
9 #include "jni/UrlUtils_jni.h"
10 
11 namespace base {
12 namespace android {
13 
GetIsolatedTestRoot()14 FilePath GetIsolatedTestRoot() {
15   JNIEnv* env = base::android::AttachCurrentThread();
16   ScopedJavaLocalRef<jstring> jtest_data_dir =
17       Java_UrlUtils_getIsolatedTestRoot(env);
18   base::FilePath test_data_dir(
19       base::android::ConvertJavaStringToUTF8(env, jtest_data_dir));
20   return test_data_dir;
21 }
22 
23 }  // namespace android
24 }  // namespace base
25