Remove '&' class loader context.

This is now an unsupported context.

Test: class_loader_context
Bug: 132357300
Change-Id: I21bc6e3529944a57379845e90c7f49759db30d40
diff --git a/runtime/class_loader_context_test.cc b/runtime/class_loader_context_test.cc
index ec51dee..bf51ae3 100644
--- a/runtime/class_loader_context_test.cc
+++ b/runtime/class_loader_context_test.cc
@@ -208,7 +208,6 @@
     ASSERT_TRUE(context != nullptr);
     ASSERT_EQ(context->dex_files_state_, ClassLoaderContext::ContextDexFilesState::kDexFilesOpened);
     ASSERT_FALSE(context->owns_the_dex_files_);
-    ASSERT_FALSE(context->special_shared_library_);
   }
 
   void VerifyClassLoaderDexFiles(ScopedObjectAccess& soa,
@@ -390,10 +389,10 @@
   VerifyClassLoaderPCL(context.get(), 0, "");
 }
 
-TEST_F(ClassLoaderContextTest, ParseValidSharedLibraryContext) {
+TEST_F(ClassLoaderContextTest, ParseInvalidSharedLibraryContext) {
+  // '&' used to be a special context.
   std::unique_ptr<ClassLoaderContext> context = ClassLoaderContext::Create("&");
-  // An shared library context should have no class loader in the chain.
-  VerifyContextSize(context.get(), 0);
+  ASSERT_TRUE(context == nullptr);
 }
 
 TEST_F(ClassLoaderContextTest, ParseValidContextPCL) {
@@ -486,12 +485,6 @@
   VerifySharedLibrariesSize(context.get(), 0, 0);
 }
 
-TEST_F(ClassLoaderContextTest, ParseValidContextSpecialSymbol) {
-  std::unique_ptr<ClassLoaderContext> context =
-    ClassLoaderContext::Create(OatFile::kSpecialSharedLibrary);
-  VerifyContextSize(context.get(), 0);
-}
-
 TEST_F(ClassLoaderContextTest, ParseInvalidValidContexts) {
   ASSERT_TRUE(nullptr == ClassLoaderContext::Create("ABC[a.dex]"));
   ASSERT_TRUE(nullptr == ClassLoaderContext::Create("PCL"));
@@ -675,34 +668,6 @@
       soa.Decode<mirror::Class>(WellKnownClasses::java_lang_BootClassLoader));
 }
 
-TEST_F(ClassLoaderContextTest, CreateClassLoaderWithSharedLibraryContext) {
-  std::unique_ptr<ClassLoaderContext> context = ClassLoaderContext::Create("&");
-
-  ASSERT_TRUE(context->OpenDexFiles());
-
-  std::vector<std::unique_ptr<const DexFile>> compilation_sources = OpenTestDexFiles("MultiDex");
-
-  std::vector<const DexFile*> compilation_sources_raw =
-      MakeNonOwningPointerVector(compilation_sources);
-  jobject jclass_loader = context->CreateClassLoader(compilation_sources_raw);
-  ASSERT_TRUE(jclass_loader != nullptr);
-
-  ScopedObjectAccess soa(Thread::Current());
-
-  StackHandleScope<1> hs(soa.Self());
-  Handle<mirror::ClassLoader> class_loader = hs.NewHandle(
-      soa.Decode<mirror::ClassLoader>(jclass_loader));
-
-  // A shared library context should create a single PathClassLoader with only the compilation
-  // sources.
-  VerifyClassLoaderDexFiles(soa,
-      class_loader,
-      WellKnownClasses::dalvik_system_PathClassLoader,
-      compilation_sources_raw);
-  ASSERT_TRUE(class_loader->GetParent()->GetClass() ==
-  soa.Decode<mirror::Class>(WellKnownClasses::java_lang_BootClassLoader));
-}
-
 TEST_F(ClassLoaderContextTest, CreateClassLoaderWithComplexChain) {
   // Setup the context.
   std::vector<std::unique_ptr<const DexFile>> classpath_dex_a = OpenTestDexFiles("ForClassLoaderA");
@@ -1470,16 +1435,6 @@
   VerifyClassLoaderPCLFromTestDex(context.get(), 3, "ForClassLoaderA");
 }
 
-TEST_F(ClassLoaderContextTest, VerifyClassLoaderContextFirstElement) {
-  std::string context_spec = "PCL[]";
-  std::unique_ptr<ClassLoaderContext> context = ParseContextWithChecksums(context_spec);
-  ASSERT_TRUE(context != nullptr);
-  PretendContextOpenedDexFilesForChecksums(context.get());
-  // Ensure that the special shared library marks as verified for the first thing in the class path.
-  ASSERT_EQ(context->VerifyClassLoaderContextMatch(OatFile::kSpecialSharedLibrary),
-            ClassLoaderContext::VerificationResult::kVerifies);
-}
-
 TEST_F(ClassLoaderContextTest, VerifyClassLoaderContextMatch) {
   std::string context_spec = "PCL[a.dex*123:b.dex*456];DLC[c.dex*890]";
   std::unique_ptr<ClassLoaderContext> context = ParseContextWithChecksums(context_spec);
@@ -1539,17 +1494,6 @@
             ClassLoaderContext::VerificationResult::kVerifies);
 }
 
-TEST_F(ClassLoaderContextTest, VerifyClassLoaderContextMatchSpecial) {
-  std::string context_spec = "&";
-  std::unique_ptr<ClassLoaderContext> context = ParseContextWithChecksums(context_spec);
-  // Pretend that we successfully open the dex files to pass the DCHECKS.
-  // (as it's much easier to test all the corner cases without relying on actual dex files).
-  PretendContextOpenedDexFiles(context.get());
-
-  ASSERT_EQ(context->VerifyClassLoaderContextMatch(context_spec),
-            ClassLoaderContext::VerificationResult::kForcedToSkipChecks);
-}
-
 TEST_F(ClassLoaderContextTest, VerifyClassLoaderContextMatchWithSL) {
   std::string context_spec =
       "PCL[a.dex*123:b.dex*456]{PCL[d.dex*321];PCL[e.dex*654]#PCL[f.dex*098:g.dex*999]}"