Consolidate all NNBD enables in resynthesize_common.dart.

I elected not to provide an `sdkVersion` argument to FeatureSet for
these tests, on the grounds that if any new features are added to the
SDK before NNBD, we want to make sure that those features are
compatible with the NNBD summary behavior.

Change-Id: I62e383e903b5756dcbb8cb498e71c4e739731d3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101070
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
diff --git a/pkg/analyzer/test/src/summary/resynthesize_common.dart b/pkg/analyzer/test/src/summary/resynthesize_common.dart
index 17febed..2ebb6b3 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_common.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_common.dart
@@ -204,6 +204,9 @@
 /// applied to a class implementing [ResynthesizeTestStrategy], along with the
 /// mixin [ResynthesizeTestHelpers].
 mixin ResynthesizeTestCases implements ResynthesizeTestHelpers {
+  FeatureSet get enableNnbd =>
+      FeatureSet.forTesting(additionalFeatures: [Feature.non_nullable]);
+
   test_class_abstract() async {
     var library = await checkLibrary('abstract class C {}');
     checkElementText(library, r'''
@@ -1001,8 +1004,7 @@
   }
 
   test_class_field_const_late() async {
-    featureSet = FeatureSet.forTesting(
-        sdkVersion: '2.2.2', additionalFeatures: [Feature.non_nullable]);
+    featureSet = enableNnbd;
     var library =
         await checkLibrary('class C { static late const int i = 0; }');
     checkElementText(library, r'''
@@ -1022,8 +1024,7 @@
   }
 
   test_class_field_implicit_type_late() async {
-    featureSet = FeatureSet.forTesting(
-        sdkVersion: '2.2.2', additionalFeatures: [Feature.non_nullable]);
+    featureSet = enableNnbd;
     var library = await checkLibrary('class C { late var x; }');
     checkElementText(library, r'''
 class C {
@@ -1042,8 +1043,7 @@
   }
 
   test_class_field_static_late() async {
-    featureSet = FeatureSet.forTesting(
-        sdkVersion: '2.2.2', additionalFeatures: [Feature.non_nullable]);
+    featureSet = enableNnbd;
     var library = await checkLibrary('class C { static late int i; }');
     checkElementText(library, r'''
 class C {
@@ -1063,8 +1063,7 @@
   }
 
   test_class_fields_late() async {
-    featureSet = FeatureSet.forTesting(
-        sdkVersion: '2.2.2', additionalFeatures: [Feature.non_nullable]);
+    featureSet = enableNnbd;
     var library = await checkLibrary('class C { int i; late int j; }');
     checkElementText(library, r'''
 class C {
@@ -9934,8 +9933,7 @@
   }
 
   test_variable_const_late() async {
-    featureSet = FeatureSet.forTesting(
-        sdkVersion: '2.2.2', additionalFeatures: [Feature.non_nullable]);
+    featureSet = enableNnbd;
     var library = await checkLibrary('late const int i = 0;');
     checkElementText(library, r'''
 late const int i = 0;
@@ -9965,8 +9963,7 @@
   }
 
   test_variable_final_late() async {
-    featureSet = FeatureSet.forTesting(
-        sdkVersion: '2.2.2', additionalFeatures: [Feature.non_nullable]);
+    featureSet = enableNnbd;
     var library = await checkLibrary('late final int x = 0;');
     checkElementText(library, r'''
 late final int x;
@@ -10077,8 +10074,7 @@
   }
 
   test_variable_late() async {
-    featureSet = FeatureSet.forTesting(
-        sdkVersion: '2.2.2', additionalFeatures: [Feature.non_nullable]);
+    featureSet = enableNnbd;
     var library = await checkLibrary('late int x = 0;');
     checkElementText(library, r'''
 late int x;