@@ -88,6 +88,20 @@ protected void testInternal(
8888 }
8989 }
9090
91+ @ Override
92+ protected void testExternChanges (String extern , String input , String expectedExtern ,
93+ DiagnosticType ... warnings ) {
94+ if (this .mode .runsOTI ()) {
95+ testExternChangesOTI (extern , input , expectedExtern , warnings );
96+ }
97+ if (this .mode .runsNTI ()) {
98+ testExternChangesNTI (extern , input , expectedExtern , warnings );
99+ }
100+ if (this .mode .runsNeither ()) {
101+ super .testExternChanges (extern , input , expectedExtern , warnings );
102+ }
103+ }
104+
91105 // Note: may be overridden to allow different externs if necessary.
92106 void checkMinimalExterns (Iterable <SourceFile > externs ) {
93107 try {
@@ -134,6 +148,26 @@ private void testNTI(
134148 this .mode = saved ;
135149 }
136150
151+ private void testExternChangesOTI (String extern , String input , String expectedExtern ,
152+ DiagnosticType ... warnings ) {
153+ TypeInferenceMode saved = this .mode ;
154+ this .mode = TypeInferenceMode .OTI_ONLY ;
155+ enableTypeCheck ();
156+ super .testExternChanges (extern , input , expectedExtern , warnings );
157+ disableTypeCheck ();
158+ this .mode = saved ;
159+ }
160+
161+ private void testExternChangesNTI (String extern , String input , String expectedExtern ,
162+ DiagnosticType ... warnings ) {
163+ TypeInferenceMode saved = this .mode ;
164+ this .mode = TypeInferenceMode .NTI_ONLY ;
165+ enableNewTypeInference ();
166+ super .testExternChanges (extern , input , expectedExtern , warnings );
167+ disableNewTypeInference ();
168+ this .mode = saved ;
169+ }
170+
137171 void testWarningOtiNti (
138172 String js , DiagnosticType otiWarning , DiagnosticType ntiWarning ) {
139173 TypeInferenceMode saved = this .mode ;
0 commit comments