@@ -121,61 +121,47 @@ void runTests({
121
121
122
122
final libraryUri = 'org-dartlang-app:///example/scopes/main.dart' ;
123
123
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
-
143
124
String newInterceptorsExpression (String type) =>
144
125
'new (require("dart_sdk")._interceptors.$type ).new()' ;
145
126
146
127
final newDartError = 'new (require("dart_sdk").dart).DartError' ;
147
128
148
129
/// A reference to the the variable `libraryPublicFinal` , an instance of
149
130
/// `MyTestClass` .
150
- Future <RemoteObject > getLibraryPublicFinalRef () => fetchLibraryReference (
151
- 'libraryPublicFinal' ,
131
+ Future <RemoteObject > getLibraryPublicFinalRef () => inspector. invoke (
132
+ libraryUri ,
152
133
'getLibraryPublicFinal' ,
153
134
);
154
135
155
136
/// 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 ,
158
139
'getLibraryPublic' ,
159
140
);
160
141
161
142
/// A reference to the variable `map` .
162
- Future <RemoteObject > getMapRef () => fetchLibraryReference (
163
- 'map' ,
143
+ Future <RemoteObject > getMapRef () => inspector. invoke (
144
+ libraryUri ,
164
145
'getMap' ,
165
146
);
166
147
167
148
/// A reference to the variable `identityMap` .
168
- Future <RemoteObject > getIdentityMapRef () => fetchLibraryReference (
169
- 'identityMap' ,
149
+ Future <RemoteObject > getIdentityMapRef () => inspector. invoke (
150
+ libraryUri ,
170
151
'getIdentityMap' ,
171
152
);
172
153
173
154
/// A reference to the variable `stream` .
174
- Future <RemoteObject > getStreamRef () => fetchLibraryReference (
175
- 'stream' ,
155
+ Future <RemoteObject > getStreamRef () => inspector. invoke (
156
+ libraryUri ,
176
157
'getStream' ,
177
158
);
178
159
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
+
179
165
group ('instanceRef' , () {
180
166
setUp (() => setCurrentLogWriter (debug: debug));
181
167
@@ -292,7 +278,7 @@ void runTests({
292
278
},
293
279
skip: provider.ddcModuleFormat == ModuleFormat .ddc &&
294
280
canaryFeatures == true
295
- ? 'This test is not supported with the DDC Library Bundle Format.'
281
+ ? unsupportedTestMsg
296
282
: null ,
297
283
);
298
284
@@ -310,7 +296,7 @@ void runTests({
310
296
},
311
297
skip: provider.ddcModuleFormat == ModuleFormat .ddc &&
312
298
canaryFeatures == true
313
- ? 'This test is not supported with the DDC Library Bundle Format.'
299
+ ? unsupportedTestMsg
314
300
: null ,
315
301
);
316
302
@@ -328,7 +314,7 @@ void runTests({
328
314
},
329
315
skip: provider.ddcModuleFormat == ModuleFormat .ddc &&
330
316
canaryFeatures == true
331
- ? 'This test is not supported with the DDC Library Bundle Format.'
317
+ ? unsupportedTestMsg
332
318
: null ,
333
319
);
334
320
@@ -346,7 +332,7 @@ void runTests({
346
332
},
347
333
skip: provider.ddcModuleFormat == ModuleFormat .ddc &&
348
334
canaryFeatures == true
349
- ? 'This test is not supported with the DDC Library Bundle Format.'
335
+ ? unsupportedTestMsg
350
336
: null ,
351
337
);
352
338
});
@@ -472,7 +458,7 @@ void runTests({
472
458
},
473
459
skip: provider.ddcModuleFormat == ModuleFormat .ddc &&
474
460
canaryFeatures == true
475
- ? 'This test is not supported with the DDC Library Bundle Format.'
461
+ ? unsupportedTestMsg
476
462
: null ,
477
463
);
478
464
@@ -490,7 +476,7 @@ void runTests({
490
476
},
491
477
skip: provider.ddcModuleFormat == ModuleFormat .ddc &&
492
478
canaryFeatures == true
493
- ? 'This test is not supported with the DDC Library Bundle Format.'
479
+ ? unsupportedTestMsg
494
480
: null ,
495
481
);
496
482
@@ -508,7 +494,7 @@ void runTests({
508
494
},
509
495
skip: provider.ddcModuleFormat == ModuleFormat .ddc &&
510
496
canaryFeatures == true
511
- ? 'This test is not supported with the DDC Library Bundle Format.'
497
+ ? unsupportedTestMsg
512
498
: null ,
513
499
);
514
500
@@ -526,7 +512,7 @@ void runTests({
526
512
},
527
513
skip: provider.ddcModuleFormat == ModuleFormat .ddc &&
528
514
canaryFeatures == true
529
- ? 'This test is not supported with the DDC Library Bundle Format.'
515
+ ? unsupportedTestMsg
530
516
: null ,
531
517
);
532
518
});
0 commit comments