diff options
| -rw-r--r-- | libartpalette/apex/palette_test.cc | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/libartpalette/apex/palette_test.cc b/libartpalette/apex/palette_test.cc index c2b7304d8d..9273e51cf1 100644 --- a/libartpalette/apex/palette_test.cc +++ b/libartpalette/apex/palette_test.cc @@ -28,7 +28,6 @@ #include "android/api-level.h" #endif -#include "base/common_art_test.h" #include "gtest/gtest.h" namespace { @@ -97,27 +96,23 @@ TEST_F(PaletteClientTest, Ashmem) { #endif } -class PaletteClientJniTest : public art::CommonArtTest {}; - -TEST_F(PaletteClientJniTest, JniInvocation) { +TEST_F(PaletteClientTest, JniInvocation) { +#ifndef ART_TARGET_ANDROID + // On host we need to set up a boot classpath and pass it in here. Let's not + // bother since this test is only for native API coverage on target. + GTEST_SKIP() << "Will only spin up a VM on Android"; +#else bool enabled; EXPECT_EQ(PALETTE_STATUS_OK, PaletteShouldReportJniInvocations(&enabled)); - std::string boot_class_path_string = - GetClassPathOption("-Xbootclasspath:", GetLibCoreDexFileNames()); - std::string boot_class_path_locations_string = - GetClassPathOption("-Xbootclasspath-locations:", GetLibCoreDexLocations()); - + JavaVMInitArgs vm_args; JavaVMOption options[] = { - {.optionString = boot_class_path_string.c_str(), .extraInfo = nullptr}, - {.optionString = boot_class_path_locations_string.c_str(), .extraInfo = nullptr}, - }; - JavaVMInitArgs vm_args = { - .version = JNI_VERSION_1_6, - .nOptions = std::size(options), - .options = options, - .ignoreUnrecognized = JNI_TRUE, + {.optionString = "-verbose:jni", .extraInfo = nullptr}, }; + vm_args.version = JNI_VERSION_1_6; + vm_args.nOptions = std::size(options); + vm_args.options = options; + vm_args.ignoreUnrecognized = JNI_TRUE; JavaVM* jvm = nullptr; JNIEnv* env = nullptr; @@ -128,6 +123,7 @@ TEST_F(PaletteClientJniTest, JniInvocation) { PaletteNotifyEndJniInvocation(env); EXPECT_EQ(JNI_OK, jvm->DestroyJavaVM()); +#endif } TEST_F(PaletteClientTest, SetTaskProfiles) { |