Reduce core image to 6 modules.

This was
    Revert^2 "Reduce core image to core-{oj,libart,simple}."
but we're now keeping three additional modules, namely
conscrypt, okhttp and bouncycastle. And we fix the boot
class path used by vogar with the companion change
    https://android-review.googlesource.com/840810 .

This reverts commit 00fe35e4021e9a8679eca3ffaede48fd89b56258.

Change-Id: I6137edd91c03c17be50de200267eb9adc971e8fb
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: Pixel 3 XL boots.
Test: m test-art-target-gtest
Test: testrunner.py --target --optimizing
Test: art/tools/run-libcore-tests.sh --mode=device --variant=X64
Bug: 119868597
diff --git a/libartbase/base/common_art_test.cc b/libartbase/base/common_art_test.cc
index 5a0b425..278203d 100644
--- a/libartbase/base/common_art_test.cc
+++ b/libartbase/base/common_art_test.cc
@@ -24,6 +24,7 @@
 #include "nativehelper/scoped_local_ref.h"
 
 #include "android-base/stringprintf.h"
+#include "android-base/strings.h"
 #include "android-base/unique_fd.h"
 #include <unicode/uvernum.h>
 
@@ -328,9 +329,48 @@
 }
 
 std::vector<std::string> CommonArtTestImpl::GetLibCoreDexFileNames() {
-  return std::vector<std::string>({GetDexFileName("core-oj", IsHost()),
-                                   GetDexFileName("core-libart", IsHost()),
-                                   GetDexFileName("core-simple", IsHost())});
+  // Note: This must match the TEST_CORE_JARS in Android.common_path.mk
+  // because that's what we use for compiling the core.art image.
+  static const char* const kLibcoreModules[] = {
+      "core-oj",
+      "core-libart",
+      "core-simple",
+      "conscrypt",
+      "okhttp",
+      "bouncycastle",
+  };
+
+  std::vector<std::string> result;
+  result.reserve(arraysize(kLibcoreModules));
+  for (const char* module : kLibcoreModules) {
+    result.push_back(GetDexFileName(module, IsHost()));
+  }
+  return result;
+}
+
+std::vector<std::string> CommonArtTestImpl::GetLibCoreDexLocations() {
+  std::vector<std::string> result = GetLibCoreDexFileNames();
+  if (IsHost()) {
+    // Strip the ANDROID_BUILD_TOP directory including the directory separator '/'.
+    const char* host_dir = getenv("ANDROID_BUILD_TOP");
+    CHECK(host_dir != nullptr);
+    std::string prefix = host_dir;
+    CHECK(!prefix.empty());
+    if (prefix.back() != '/') {
+      prefix += '/';
+    }
+    for (std::string& location : result) {
+      CHECK_GT(location.size(), prefix.size());
+      CHECK_EQ(location.compare(0u, prefix.size(), prefix), 0);
+      location.erase(0u, prefix.size());
+    }
+  }
+  return result;
+}
+
+std::string CommonArtTestImpl::GetClassPathOption(const char* option,
+                                                  const std::vector<std::string>& class_path) {
+  return option + android::base::Join(class_path, ':');
 }
 
 std::string CommonArtTestImpl::GetTestAndroidRoot() {