summaryrefslogtreecommitdiff
path: root/runtime/class_loader_context_test.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2018-11-30 01:02:50 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2018-11-30 01:02:50 +0000
commit1717a493a4a0c1c3b69ecfcb58838627b4c75878 (patch)
tree84f28de48b55ea9942d3ffc49b13c0ec1c1435b7 /runtime/class_loader_context_test.cc
parenta66d69e884b6f9f41a8da31e6d27b498984c7fa3 (diff)
Revert "Support shared libraries in CreateContextFromClassLoader."
This reverts commit a66d69e884b6f9f41a8da31e6d27b498984c7fa3. bug: 120036590 bug: 120031686 Reason for revert: Fails libcore Change-Id: I6bec17b1e6c0d767c10b44572ca5f8d73c5fc37e
Diffstat (limited to 'runtime/class_loader_context_test.cc')
-rw-r--r--runtime/class_loader_context_test.cc28
1 files changed, 0 insertions, 28 deletions
diff --git a/runtime/class_loader_context_test.cc b/runtime/class_loader_context_test.cc
index 3c5f1ef95d..0756982b65 100644
--- a/runtime/class_loader_context_test.cc
+++ b/runtime/class_loader_context_test.cc
@@ -23,7 +23,6 @@
#include "base/dchecked_vector.h"
#include "base/stl_util.h"
#include "class_linker.h"
-#include "class_root.h"
#include "common_runtime_test.h"
#include "dex/dex_file.h"
#include "handle_scope-inl.h"
@@ -31,7 +30,6 @@
#include "mirror/class.h"
#include "mirror/class_loader.h"
#include "mirror/object-inl.h"
-#include "mirror/object_array-alloc-inl.h"
#include "oat_file_assistant.h"
#include "runtime.h"
#include "scoped_thread_state_change-inl.h"
@@ -1232,30 +1230,4 @@ TEST_F(ClassLoaderContextTest, VerifyClassLoaderContextMatchAfterEncodingMultide
ClassLoaderContext::VerificationResult::kVerifies);
}
-TEST_F(ClassLoaderContextTest, CreateContextForClassLoaderWithSharedLibraries) {
- jobject class_loader_a = LoadDexInPathClassLoader("ForClassLoaderA", nullptr);
-
- ScopedObjectAccess soa(Thread::Current());
- StackHandleScope<1> hs(soa.Self());
- Handle<mirror::ObjectArray<mirror::ClassLoader>> libraries = hs.NewHandle(
- mirror::ObjectArray<mirror::ClassLoader>::Alloc(
- soa.Self(),
- GetClassRoot<mirror::ObjectArray<mirror::ClassLoader>>(),
- 1));
- libraries->Set(0, soa.Decode<mirror::ClassLoader>(class_loader_a));
-
- jobject class_loader_b = LoadDexInPathClassLoader(
- "ForClassLoaderB", nullptr, soa.AddLocalReference<jobject>(libraries.Get()));
-
- std::unique_ptr<ClassLoaderContext> context = CreateContextForClassLoader(class_loader_b);
- ASSERT_TRUE(context != nullptr);
- std::vector<std::unique_ptr<const DexFile>> dex_files = OpenTestDexFiles("ForClassLoaderB");
- VerifyClassLoaderPCL(context.get(), 0, dex_files[0]->GetLocation());
- dex_files = OpenTestDexFiles("ForClassLoaderA");
- VerifyClassLoaderSharedLibraryPCL(context.get(), 0, 0, dex_files[0]->GetLocation());
-
- ASSERT_EQ(context->VerifyClassLoaderContextMatch(context->EncodeContextForOatFile("")),
- ClassLoaderContext::VerificationResult::kVerifies);
-}
-
} // namespace art