Revert "Construct BCP arguments to the VM using CommonArtTest code." am: e08696f240
Original change: https://android-review.googlesource.com/c/platform/art/+/2883706
Change-Id: I417b5dee1f3fe7434e59317f7d4a1db50f038f57
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/libartpalette/apex/palette_test.cc b/libartpalette/apex/palette_test.cc
index c2b7304..9273e51 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 @@
#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},
+ {.optionString = "-verbose:jni", .extraInfo = nullptr},
};
- JavaVMInitArgs vm_args = {
- .version = JNI_VERSION_1_6,
- .nOptions = std::size(options),
- .options = options,
- .ignoreUnrecognized = JNI_TRUE,
- };
+ 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 @@
PaletteNotifyEndJniInvocation(env);
EXPECT_EQ(JNI_OK, jvm->DestroyJavaVM());
+#endif
}
TEST_F(PaletteClientTest, SetTaskProfiles) {