Chromium Code Reviews| 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 61% |
| 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..ced4ebe9c12ef6d16a7bb3e630c6c10d60500e39 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,35 @@ 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 = |
| + expect(await sendExecutionDeleteContext(contextId), isNull); |
| + |
| + // After the delete, expect this to fail. |
| + try { |
| + 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'); |
| - } |
| + fail('expected exception after context delete'); |
| + } catch (ignore) {} |
|
Paul Berry
2017/02/12 14:39:04
This won't work because the way the fail() method
devoncarew
2017/02/12 17:52:34
Ah, good catch! I'll add a class as above.
|
| } |
| -} |
| -@reflectiveTest |
| -class MapUriTest extends AbstractMapUriTest {} |
| - |
| -@reflectiveTest |
| -class MapUriTest_Driver extends AbstractMapUriTest { |
| @override |
| bool get enableNewAnalysisDriver => true; |
| } |