[VM] Fix vm/cc/DartAPI_TypeGetParameterizedTypes test

This test was looking up "int", "List" ... in a generated test library
instead of the "dart:core" library.

It seems like the old lookup has succeded because the C++ parser adds all
imports to the library object and the lookup mechanism uses the library scope,
which most likely falls back to the import scope.

Issue https://github.com/dart-lang/sdk/issues/33042

Change-Id: I37ea756fe53fe5dcbd8efe24053591816d5fc4af
Reviewed-on: https://dart-review.googlesource.com/57821
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
diff --git a/runtime/tests/vm/vm.status b/runtime/tests/vm/vm.status
index 230b5a2..6c3b027 100644
--- a/runtime/tests/vm/vm.status
+++ b/runtime/tests/vm/vm.status
@@ -56,7 +56,6 @@
 
 [ $compiler == dartk ]
 cc/DartAPI_New: Fail # Issue #33041
-cc/DartAPI_TypeGetParameterizedTypes: Crash # Issue 33042
 dart/appjit_cha_deopt_test: SkipSlow # Issue 33266
 dart/redirection_type_shuffling_test/00: RuntimeError
 dart/redirection_type_shuffling_test/none: RuntimeError
diff --git a/runtime/vm/dart_api_impl_test.cc b/runtime/vm/dart_api_impl_test.cc
index 52bd15c..5867cf5 100644
--- a/runtime/vm/dart_api_impl_test.cc
+++ b/runtime/vm/dart_api_impl_test.cc
@@ -3618,22 +3618,26 @@
       "Type getMyClass1_1Type() {\n"
       "  return new MyClass1<List<int>, List<double>>().runtimeType;\n"
       "}\n";
-  Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
-  bool instanceOf = false;
+
+  Dart_Handle corelib = Dart_LookupLibrary(NewString("dart:core"));
+  EXPECT_VALID(corelib);
 
   // First get type objects of some of the basic types used in the test.
-  Dart_Handle int_type = Dart_GetType(lib, NewString("int"), 0, NULL);
+  Dart_Handle int_type = Dart_GetType(corelib, NewString("int"), 0, NULL);
   EXPECT_VALID(int_type);
-  Dart_Handle double_type = Dart_GetType(lib, NewString("double"), 0, NULL);
+  Dart_Handle double_type = Dart_GetType(corelib, NewString("double"), 0, NULL);
   EXPECT_VALID(double_type);
-  Dart_Handle list_type = Dart_GetType(lib, NewString("List"), 0, NULL);
+  Dart_Handle list_type = Dart_GetType(corelib, NewString("List"), 0, NULL);
   EXPECT_VALID(list_type);
   Dart_Handle type_args = Dart_NewList(1);
   EXPECT_VALID(Dart_ListSetAt(type_args, 0, int_type));
   Dart_Handle list_int_type =
-      Dart_GetType(lib, NewString("List"), 1, &type_args);
+      Dart_GetType(corelib, NewString("List"), 1, &type_args);
   EXPECT_VALID(list_int_type);
 
+  Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
+  bool instanceOf = false;
+
   // Now instantiate MyClass0 and MyClass1 types with the same type arguments
   // used in the code above.
   type_args = Dart_NewList(2);