url_utils.cc 739 B

123456789101112131415161718192021222324
  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. #include "base/test/android/url_utils.h"
  5. #include "base/android/jni_string.h"
  6. #include "base/android/scoped_java_ref.h"
  7. #include "base/test/test_support_jni_headers/UrlUtils_jni.h"
  8. namespace base {
  9. namespace android {
  10. FilePath GetIsolatedTestRoot() {
  11. JNIEnv* env = base::android::AttachCurrentThread();
  12. ScopedJavaLocalRef<jstring> jtest_data_dir =
  13. Java_UrlUtils_getIsolatedTestRoot(env);
  14. base::FilePath test_data_dir(
  15. base::android::ConvertJavaStringToUTF8(env, jtest_data_dir));
  16. return test_data_dir;
  17. }
  18. } // namespace android
  19. } // namespace base