Skip to content

Commit 1010d40

Browse files
committed
Fix test and code metrics
1 parent f5587a4 commit 1010d40

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

dwds/lib/src/debugging/inspector.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ class AppInspector implements AppInspectorInterface {
115115
await DartUri.initialize();
116116
DartUri.recordAbsoluteUris(libraries.map((lib) => lib.uri).nonNulls);
117117
DartUri.recordAbsoluteUris(scripts.map((script) => script.uri).nonNulls);
118+
await getExtensionRpcs();
118119
}
119120

120121
static IsolateRef _toIsolateRef(Isolate isolate) => IsolateRef(
@@ -787,7 +788,7 @@ class AppInspector implements AppInspectorInterface {
787788
s,
788789
);
789790
}
790-
isolate.extensionRPCs = List<String>.from(extensionRpcs);
791+
isolate.extensionRPCs = List<String>.of(extensionRpcs);
791792
return extensionRpcs;
792793
}
793794

dwds/lib/src/services/chrome_proxy_service.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ class ChromeProxyService implements VmServiceInterface {
509509
v is String ? v : jsonEncode(v),
510510
),
511511
);
512-
if ((await inspector.getExtensionRpcs()).contains(method) != true) {
512+
if (!(await inspector.getExtensionRpcs()).contains(method)) {
513513
throw RPCError(
514514
method,
515515
RPCErrorKind.kMethodNotFound.code,

dwds/test/common/chrome_proxy_service_common.dart

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,20 @@ void runTests({
298298
),
299299
},
300300
);
301+
302+
test('not found', () async {
303+
final serviceMethod = 'ext.test.missingServiceExtension';
304+
expect(
305+
service.callServiceExtension(serviceMethod),
306+
throwsA(
307+
predicate(
308+
(dynamic error) =>
309+
error is RPCError &&
310+
error.code == RPCErrorKind.kMethodNotFound.code,
311+
),
312+
),
313+
);
314+
});
301315
});
302316

303317
group('VMTimeline', () {

0 commit comments

Comments
 (0)