Use CommonRuntimeTest::boot_class_path_ in DexMethodIteratorTest

In addition, remove some other unnecessary dependencies.

Change-Id: I5ec97b54c3c064ea98feb70dbfd226118ec98290
diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk
index 0259fb4..f9cbec5 100644
--- a/build/Android.gtest.mk
+++ b/build/Android.gtest.mk
@@ -61,10 +61,9 @@
 # The elf writer test has dependencies on core.oat.
 ART_GTEST_elf_writer_test_HOST_DEPS := $(HOST_CORE_IMAGE_default_no-pic_64) $(HOST_CORE_IMAGE_default_no-pic_32)
 ART_GTEST_elf_writer_test_TARGET_DEPS := $(TARGET_CORE_IMAGE_default_no-pic_64) $(TARGET_CORE_IMAGE_default_no-pic_32)
-ART_GTEST_jni_internal_test_TARGET_DEPS := $(TARGET_CORE_DEX_FILES)
-ART_GTEST_proxy_test_TARGET_DEPS := $(TARGET_CORE_DEX_FILES)
+
+# TODO: document why this is needed.
 ART_GTEST_proxy_test_HOST_DEPS := $(HOST_CORE_IMAGE_default_no-pic_64) $(HOST_CORE_IMAGE_default_no-pic_32)
-ART_GTEST_dex_method_iterator_test_TARGET_DEPS := $(TARGET_CORE_DEX_FILES)
 
 # The path for which all the source files are relative, not actually the current directory.
 LOCAL_PATH := art
diff --git a/runtime/dex_method_iterator_test.cc b/runtime/dex_method_iterator_test.cc
index c6f333f..2681ad0 100644
--- a/runtime/dex_method_iterator_test.cc
+++ b/runtime/dex_method_iterator_test.cc
@@ -18,6 +18,7 @@
 
 #include "base/stl_util.h"
 #include "common_runtime_test.h"
+#include "oat_file.h"
 #include "scoped_thread_state_change.h"
 #include "thread-inl.h"
 
@@ -29,9 +30,9 @@
 TEST_F(DexMethodIteratorTest, Basic) {
   ScopedObjectAccess soa(Thread::Current());
   std::vector<const DexFile*> dex_files;
-  const char* jars[] = { "core-libart", "conscrypt", "okhttp", "core-junit", "bouncycastle" };
-  for (size_t i = 0; i < 5; ++i) {
-    dex_files.push_back(LoadExpectSingleDexFile(GetDexFileName(jars[i]).c_str()));
+  CHECK_NE(boot_class_path_.size(), 0U);
+  for (size_t i = 0; i < boot_class_path_.size(); ++i) {
+    dex_files.push_back(boot_class_path_[i]);
   }
   DexMethodIterator it(dex_files);
   while (it.HasNext()) {
@@ -43,7 +44,6 @@
     }
     it.Next();
   }
-  STLDeleteElements(&dex_files);
 }
 
 }  // namespace art