@@ -121,61 +121,47 @@ void runTests({
121121
122122 final libraryUri = 'org-dartlang-app:///example/scopes/main.dart' ;
123123
124- String libraryName (CompilationMode compilationMode) =>
125- compilationMode == CompilationMode .frontendServer
126- ? 'example/scopes/main.dart'
127- : 'example/scopes/main' ;
128-
129- /// Retrieves a reference to a library variable or method by evaluating
130- /// the specified [variableName] and invoking the provided [methodName] .
131- /// The target library must define both [variableName] and [methodName] .
132- Future <RemoteObject > fetchLibraryReference (
133- String variableName,
134- String methodName,
135- ) =>
136- inspector.getLibraryReference (
137- libraryUri,
138- libraryName (compilationMode),
139- variableName,
140- methodName,
141- );
142-
143124 String newInterceptorsExpression (String type) =>
144125 'new (require("dart_sdk")._interceptors.$type ).new()' ;
145126
146127 final newDartError = 'new (require("dart_sdk").dart).DartError' ;
147128
148129 /// A reference to the the variable `libraryPublicFinal` , an instance of
149130 /// `MyTestClass` .
150- Future <RemoteObject > getLibraryPublicFinalRef () => fetchLibraryReference (
151- 'libraryPublicFinal' ,
131+ Future <RemoteObject > getLibraryPublicFinalRef () => inspector. invoke (
132+ libraryUri ,
152133 'getLibraryPublicFinal' ,
153134 );
154135
155136 /// A reference to the the variable `libraryPublic` , a List of Strings.
156- Future <RemoteObject > getLibraryPublicRef () => fetchLibraryReference (
157- 'libraryPublic' ,
137+ Future <RemoteObject > getLibraryPublicRef () => inspector. invoke (
138+ libraryUri ,
158139 'getLibraryPublic' ,
159140 );
160141
161142 /// A reference to the variable `map` .
162- Future <RemoteObject > getMapRef () => fetchLibraryReference (
163- 'map' ,
143+ Future <RemoteObject > getMapRef () => inspector. invoke (
144+ libraryUri ,
164145 'getMap' ,
165146 );
166147
167148 /// A reference to the variable `identityMap` .
168- Future <RemoteObject > getIdentityMapRef () => fetchLibraryReference (
169- 'identityMap' ,
149+ Future <RemoteObject > getIdentityMapRef () => inspector. invoke (
150+ libraryUri ,
170151 'getIdentityMap' ,
171152 );
172153
173154 /// A reference to the variable `stream` .
174- Future <RemoteObject > getStreamRef () => fetchLibraryReference (
175- 'stream' ,
155+ Future <RemoteObject > getStreamRef () => inspector. invoke (
156+ libraryUri ,
176157 'getStream' ,
177158 );
178159
160+ final unsupportedTestMsg =
161+ 'This test is not supported with the DDC Library '
162+ "Bundle Format because the dartDevEmbedder doesn't let you access compiled "
163+ 'constructors at runtime.' ;
164+
179165 group ('instanceRef' , () {
180166 setUp (() => setCurrentLogWriter (debug: debug));
181167
@@ -292,7 +278,7 @@ void runTests({
292278 },
293279 skip: provider.ddcModuleFormat == ModuleFormat .ddc &&
294280 canaryFeatures == true
295- ? 'This test is not supported with the DDC Library Bundle Format.'
281+ ? unsupportedTestMsg
296282 : null ,
297283 );
298284
@@ -310,7 +296,7 @@ void runTests({
310296 },
311297 skip: provider.ddcModuleFormat == ModuleFormat .ddc &&
312298 canaryFeatures == true
313- ? 'This test is not supported with the DDC Library Bundle Format.'
299+ ? unsupportedTestMsg
314300 : null ,
315301 );
316302
@@ -328,7 +314,7 @@ void runTests({
328314 },
329315 skip: provider.ddcModuleFormat == ModuleFormat .ddc &&
330316 canaryFeatures == true
331- ? 'This test is not supported with the DDC Library Bundle Format.'
317+ ? unsupportedTestMsg
332318 : null ,
333319 );
334320
@@ -346,7 +332,7 @@ void runTests({
346332 },
347333 skip: provider.ddcModuleFormat == ModuleFormat .ddc &&
348334 canaryFeatures == true
349- ? 'This test is not supported with the DDC Library Bundle Format.'
335+ ? unsupportedTestMsg
350336 : null ,
351337 );
352338 });
@@ -472,7 +458,7 @@ void runTests({
472458 },
473459 skip: provider.ddcModuleFormat == ModuleFormat .ddc &&
474460 canaryFeatures == true
475- ? 'This test is not supported with the DDC Library Bundle Format.'
461+ ? unsupportedTestMsg
476462 : null ,
477463 );
478464
@@ -490,7 +476,7 @@ void runTests({
490476 },
491477 skip: provider.ddcModuleFormat == ModuleFormat .ddc &&
492478 canaryFeatures == true
493- ? 'This test is not supported with the DDC Library Bundle Format.'
479+ ? unsupportedTestMsg
494480 : null ,
495481 );
496482
@@ -508,7 +494,7 @@ void runTests({
508494 },
509495 skip: provider.ddcModuleFormat == ModuleFormat .ddc &&
510496 canaryFeatures == true
511- ? 'This test is not supported with the DDC Library Bundle Format.'
497+ ? unsupportedTestMsg
512498 : null ,
513499 );
514500
@@ -526,7 +512,7 @@ void runTests({
526512 },
527513 skip: provider.ddcModuleFormat == ModuleFormat .ddc &&
528514 canaryFeatures == true
529- ? 'This test is not supported with the DDC Library Bundle Format.'
515+ ? unsupportedTestMsg
530516 : null ,
531517 );
532518 });
0 commit comments