Index: pkg/analysis_server/test/integration/execution/delete_context_test.dart |
diff --git a/pkg/analysis_server/test/integration/execution/map_uri_test.dart b/pkg/analysis_server/test/integration/execution/delete_context_test.dart |
similarity index 60% |
copy from pkg/analysis_server/test/integration/execution/map_uri_test.dart |
copy to pkg/analysis_server/test/integration/execution/delete_context_test.dart |
index c865bd781a496b7f2d12b145f9e1b66c6f1b82c1..2f16dc19619c3246bab667f21bdaa7815b51a1eb 100644 |
--- a/pkg/analysis_server/test/integration/execution/map_uri_test.dart |
+++ b/pkg/analysis_server/test/integration/execution/delete_context_test.dart |
@@ -10,40 +10,37 @@ import '../integration_tests.dart'; |
main() { |
defineReflectiveSuite(() { |
- defineReflectiveTests(MapUriTest); |
- defineReflectiveTests(MapUriTest_Driver); |
+ defineReflectiveTests(DeleteContextTest); |
}); |
} |
-class AbstractMapUriTest extends AbstractAnalysisServerIntegrationTest { |
- test_mapUri() async { |
+@reflectiveTest |
+class DeleteContextTest extends AbstractAnalysisServerIntegrationTest { |
+ test_delete() async { |
String pathname = sourcePath('lib/main.dart'); |
writeFile(pathname, '// dummy'); |
writeFile(sourcePath('.packages'), 'foo:lib/'); |
standardAnalysisSetup(); |
String contextId = |
- (await sendExecutionCreateContext(sourceDirectory.path))?.id; |
+ (await sendExecutionCreateContext(sourceDirectory.path)).id; |
- { |
- ExecutionMapUriResult result = |
- await sendExecutionMapUri(contextId, uri: 'package:foo/main.dart'); |
- expect(result.file, pathname); |
- } |
+ ExecutionMapUriResult result = |
+ await sendExecutionMapUri(contextId, uri: 'package:foo/main.dart'); |
+ expect(result.file, pathname); |
- { |
- ExecutionMapUriResult result = |
- await sendExecutionMapUri(contextId, file: pathname); |
- expect(result.uri, 'package:foo/main.dart'); |
+ expect(await sendExecutionDeleteContext(contextId), isNull); |
+ |
+ // After the delete, expect this to fail. |
+ try { |
+ result = |
+ await sendExecutionMapUri(contextId, uri: 'package:foo/main.dart'); |
+ fail('expected exception after context delete'); |
+ } on ServerErrorMessage catch (message) { |
+ expect(message.error['code'], 'INVALID_PARAMETER'); |
} |
} |
-} |
- |
-@reflectiveTest |
-class MapUriTest extends AbstractMapUriTest {} |
-@reflectiveTest |
-class MapUriTest_Driver extends AbstractMapUriTest { |
@override |
bool get enableNewAnalysisDriver => true; |
} |