summaryrefslogtreecommitdiff
path: root/runtime/common_runtime_test.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2016-11-01 09:11:45 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2016-11-01 09:11:46 +0000
commitbda454e9a09018cde1ea2ee10f0fdd5bf2ad756b (patch)
tree58f1e3aaa737365b4994323b6c46897f78d4b14f /runtime/common_runtime_test.cc
parentb2aaf1d63f94852960796603d6872c11eafb789f (diff)
parentd01f60cbed4ba360b84f1310d2e0d422d6a16534 (diff)
Merge "Add a VerifierDeps::Dump method."
Diffstat (limited to 'runtime/common_runtime_test.cc')
-rw-r--r--runtime/common_runtime_test.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/runtime/common_runtime_test.cc b/runtime/common_runtime_test.cc
index 5409fcbf2f..d929812d57 100644
--- a/runtime/common_runtime_test.cc
+++ b/runtime/common_runtime_test.cc
@@ -572,6 +572,29 @@ const DexFile* CommonRuntimeTestImpl::GetFirstDexFile(jobject jclass_loader) {
return ret;
}
+jobject CommonRuntimeTestImpl::LoadMultiDex(const char* first_dex_name,
+ const char* second_dex_name) {
+ std::vector<std::unique_ptr<const DexFile>> first_dex_files = OpenTestDexFiles(first_dex_name);
+ std::vector<std::unique_ptr<const DexFile>> second_dex_files = OpenTestDexFiles(second_dex_name);
+ std::vector<const DexFile*> class_path;
+ CHECK_NE(0U, first_dex_files.size());
+ CHECK_NE(0U, second_dex_files.size());
+ for (auto& dex_file : first_dex_files) {
+ class_path.push_back(dex_file.get());
+ loaded_dex_files_.push_back(std::move(dex_file));
+ }
+ for (auto& dex_file : second_dex_files) {
+ class_path.push_back(dex_file.get());
+ loaded_dex_files_.push_back(std::move(dex_file));
+ }
+
+ Thread* self = Thread::Current();
+ jobject class_loader = Runtime::Current()->GetClassLinker()->CreatePathClassLoader(self,
+ class_path);
+ self->SetClassLoaderOverride(class_loader);
+ return class_loader;
+}
+
jobject CommonRuntimeTestImpl::LoadDex(const char* dex_name) {
std::vector<std::unique_ptr<const DexFile>> dex_files = OpenTestDexFiles(dex_name);
std::vector<const DexFile*> class_path;