Chromium Code Reviews| Index: test/isolate_test.dart |
| diff --git a/test/isolate_test.dart b/test/isolate_test.dart |
| index b08bdd9158db4d4326739dbc8fc1e97da022cfe2..c5b64da0e1a2eb7c0e01a39074d1dee26ac04444 100644 |
| --- a/test/isolate_test.dart |
| +++ b/test/isolate_test.dart |
| @@ -375,6 +375,26 @@ void main() { |
| expect(breakpoint.number, equals(1)); |
| }); |
| }); |
| + |
| + group("invokeExtension", () { |
| + test("enforces ext. prefix", () async { |
| + var client = await runAndConnect(); |
| + var isolate = await (await client.getVM()).isolates.first.loadRunnable(); |
| + expect(() => isolate.invokeExtension('noprefix'), throwsArgumentError); |
| + }); |
| + |
| + test("forwards to scope", () async { |
| + var client = await runAndConnect(main: r""" |
| + registerExtension('ext.ping', (_, __) async { |
| + return new ServiceExtensionResponse.result('{"type": "pong"}'); |
| + }); |
| + """); |
| + |
| + var isolate = await (await client.getVM()).isolates.first.loadRunnable(); |
| + Map response = await isolate.invokeExtension('ext.ping'); |
| + expect(response, {'type': 'pong'}); |
|
nweiz
2016/02/10 21:28:28
Oh jeez, does the protocol automatically JSON-dese
yjbanov
2016/02/10 22:06:07
Yep
|
| + }); |
|
nweiz
2016/02/10 21:28:28
Test passing in arguments as well.
yjbanov
2016/02/10 22:06:07
Done.
|
| + }); |
| } |
| /// Starts a client with two unpaused empty isolates. |