[element model] migrate `type_constraint_generation_test`

Change-Id: I371124dbf9e1b643f2d1d8777ac7685228ecb563
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403701
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
diff --git a/pkg/analyzer/analyzer_use_new_elements.txt b/pkg/analyzer/analyzer_use_new_elements.txt
index be775d3..d29932ec 100644
--- a/pkg/analyzer/analyzer_use_new_elements.txt
+++ b/pkg/analyzer/analyzer_use_new_elements.txt
@@ -146,7 +146,6 @@
 test/generated/non_error_resolver_test.dart
 test/generated/resolver_test_case.dart
 test/generated/type_system_test.dart
-test/id_tests/type_constraint_generation_test.dart
 test/src/dart/analysis/index_test.dart
 test/src/dart/analysis/result_printer.dart
 test/src/dart/analysis/results/get_element_declaration_test.dart
diff --git a/pkg/analyzer/test/id_tests/type_constraint_generation_test.dart b/pkg/analyzer/test/id_tests/type_constraint_generation_test.dart
index 7e888cb..aff9cef 100644
--- a/pkg/analyzer/test/id_tests/type_constraint_generation_test.dart
+++ b/pkg/analyzer/test/id_tests/type_constraint_generation_test.dart
@@ -41,8 +41,8 @@
       Map<Id, ActualData<List<GeneratedTypeConstraint>>> actualMap) {
     _TypeConstraintGenerationDataExtractor(
             testingData.uriToTypeConstraintGenerationData[
-                unit.declaredElement!.source.uri]!,
-            unit.declaredElement!.source.uri,
+                unit.declaredFragment?.source.uri]!,
+            unit.declaredFragment!.source.uri,
             actualMap)
         .run(unit);
   }