Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Unified Diff: pkg/analysis_server/test/integration/execution/delete_context_test.dart

Issue 2691763002: Add integration tests for the execution domain. (Closed)
Patch Set: call -> request in dartdocs Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}

Powered by Google App Engine
This is Rietveld 408576698