From 1717a493a4a0c1c3b69ecfcb58838627b4c75878 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Fri, 30 Nov 2018 01:02:50 +0000 Subject: Revert "Support shared libraries in CreateContextFromClassLoader." This reverts commit a66d69e884b6f9f41a8da31e6d27b498984c7fa3. bug: 120036590 bug: 120031686 Reason for revert: Fails libcore Change-Id: I6bec17b1e6c0d767c10b44572ca5f8d73c5fc37e --- runtime/class_loader_context_test.cc | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'runtime/class_loader_context_test.cc') 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> libraries = hs.NewHandle( - mirror::ObjectArray::Alloc( - soa.Self(), - GetClassRoot>(), - 1)); - libraries->Set(0, soa.Decode(class_loader_a)); - - jobject class_loader_b = LoadDexInPathClassLoader( - "ForClassLoaderB", nullptr, soa.AddLocalReference(libraries.Get())); - - std::unique_ptr context = CreateContextForClassLoader(class_loader_b); - ASSERT_TRUE(context != nullptr); - std::vector> 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 -- cgit v1.2.3-59-g8ed1b