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

Unified Diff: pkg/analysis_server/test/domain_execution_test.dart

Issue 2937323003: Remove ability to disable new analysis driver (Closed)
Patch Set: Created 3 years, 6 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
« no previous file with comments | « pkg/analysis_server/test/domain_analysis_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/domain_execution_test.dart
diff --git a/pkg/analysis_server/test/domain_execution_test.dart b/pkg/analysis_server/test/domain_execution_test.dart
index 6c58a7355196f0f5d9148af98eb0f4ee62f29653..5ad98b0647d37e29536929560f8cc4d5b1e70df4 100644
--- a/pkg/analysis_server/test/domain_execution_test.dart
+++ b/pkg/analysis_server/test/domain_execution_test.dart
@@ -5,13 +5,10 @@
import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
import 'package:analysis_server/src/analysis_server.dart';
-import 'package:analysis_server/src/constants.dart';
import 'package:analysis_server/src/domain_execution.dart';
import 'package:analysis_server/src/plugin/server_plugin.dart';
-import 'package:analyzer/file_system/file_system.dart';
import 'package:analyzer/file_system/memory_file_system.dart';
import 'package:analyzer/instrumentation/instrumentation.dart';
-import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/sdk.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/generated/source_io.dart';
@@ -84,115 +81,88 @@ main() {
});
});
- group('mapUri', () {
- String contextId;
-
- void createExecutionContextIdForFile(String path) {
- Request request = new ExecutionCreateContextParams(path).toRequest('0');
- Response response = handler.handleRequest(request);
- expect(response, isResponseSuccess('0'));
- ExecutionCreateContextResult result =
- new ExecutionCreateContextResult.fromResponse(response);
- contextId = result.id;
- }
-
- setUp(() {
- Folder folder = provider.newFile('/a/b.dart', '').parent;
- server.folderMap.putIfAbsent(folder, () {
- SourceFactory factory =
- new SourceFactory([new ResourceUriResolver(provider)]);
- AnalysisContext context =
- AnalysisEngine.instance.createAnalysisContext();
- context.sourceFactory = factory;
- return context;
- });
- createExecutionContextIdForFile('/a/b.dart');
- });
-
- tearDown(() {
- Request request =
- new ExecutionDeleteContextParams(contextId).toRequest('1');
- Response response = handler.handleRequest(request);
- expect(response, isResponseSuccess('1'));
- });
-
- group('file to URI', () {
- test('does not exist', () {
- Request request =
- new ExecutionMapUriParams(contextId, file: '/a/c.dart')
- .toRequest('2');
- Response response = handler.handleRequest(request);
- expect(response, isResponseFailure('2'));
- });
-
- test('directory', () {
- provider.newFolder('/a/d');
- Request request =
- new ExecutionMapUriParams(contextId, file: '/a/d').toRequest('2');
- Response response = handler.handleRequest(request);
- expect(response, isResponseFailure('2'));
- });
- });
-
- group('URI to file', () {
- test('invalid', () {
- Request request =
- new ExecutionMapUriParams(contextId, uri: 'foo:///a/b.dart')
- .toRequest('2');
- Response response = handler.handleRequest(request);
- expect(response, isResponseFailure('2'));
- });
- });
-
- test('invalid context id', () {
- Request request =
- new ExecutionMapUriParams('xxx', uri: '').toRequest('4');
- Response response = handler.handleRequest(request);
- expect(response, isResponseFailure('4'));
- });
-
- test('both file and uri', () {
- Request request =
- new ExecutionMapUriParams('xxx', file: '', uri: '').toRequest('5');
- Response response = handler.handleRequest(request);
- expect(response, isResponseFailure('5'));
- });
-
- test('neither file nor uri', () {
- Request request = new ExecutionMapUriParams('xxx').toRequest('6');
- Response response = handler.handleRequest(request);
- expect(response, isResponseFailure('6'));
- });
- });
-
- group('setSubscriptions', () {
- test('failure - invalid service name', () {
- expect(handler.onFileAnalyzed, isNull);
-
- Request request = new Request('0', EXECUTION_SET_SUBSCRIPTIONS, {
- SUBSCRIPTIONS: ['noSuchService']
- });
- Response response = handler.handleRequest(request);
- expect(response, isResponseFailure('0'));
- expect(handler.onFileAnalyzed, isNull);
- });
-
- test('success - setting and clearing', () {
- expect(handler.onFileAnalyzed, isNull);
-
- Request request =
- new ExecutionSetSubscriptionsParams([ExecutionService.LAUNCH_DATA])
- .toRequest('0');
- Response response = handler.handleRequest(request);
- expect(response, isResponseSuccess('0'));
- expect(handler.onFileAnalyzed, isNotNull);
-
- request = new ExecutionSetSubscriptionsParams([]).toRequest('0');
- response = handler.handleRequest(request);
- expect(response, isResponseSuccess('0'));
- expect(handler.onFileAnalyzed, isNull);
- });
- });
+ // TODO(brianwilkerson) Re-enable these tests if we re-enable the
+ // execution.mapUri request.
+// group('mapUri', () {
+// String contextId;
+//
+// void createExecutionContextIdForFile(String path) {
+// Request request = new ExecutionCreateContextParams(path).toRequest('0');
+// Response response = handler.handleRequest(request);
+// expect(response, isResponseSuccess('0'));
+// ExecutionCreateContextResult result =
+// new ExecutionCreateContextResult.fromResponse(response);
+// contextId = result.id;
+// }
+//
+// setUp(() {
+// Folder folder = provider.newFile('/a/b.dart', '').parent;
+// server.folderMap.putIfAbsent(folder, () {
+// SourceFactory factory =
+// new SourceFactory([new ResourceUriResolver(provider)]);
+// AnalysisContext context =
+// AnalysisEngine.instance.createAnalysisContext();
+// context.sourceFactory = factory;
+// return context;
+// });
+// createExecutionContextIdForFile('/a/b.dart');
+// });
+//
+// tearDown(() {
+// Request request =
+// new ExecutionDeleteContextParams(contextId).toRequest('1');
+// Response response = handler.handleRequest(request);
+// expect(response, isResponseSuccess('1'));
+// });
+//
+// group('file to URI', () {
+// test('does not exist', () {
+// Request request =
+// new ExecutionMapUriParams(contextId, file: '/a/c.dart')
+// .toRequest('2');
+// Response response = handler.handleRequest(request);
+// expect(response, isResponseFailure('2'));
+// });
+//
+// test('directory', () {
+// provider.newFolder('/a/d');
+// Request request =
+// new ExecutionMapUriParams(contextId, file: '/a/d').toRequest('2');
+// Response response = handler.handleRequest(request);
+// expect(response, isResponseFailure('2'));
+// });
+// });
+//
+// group('URI to file', () {
+// test('invalid', () {
+// Request request =
+// new ExecutionMapUriParams(contextId, uri: 'foo:///a/b.dart')
+// .toRequest('2');
+// Response response = handler.handleRequest(request);
+// expect(response, isResponseFailure('2'));
+// });
+// });
+//
+// test('invalid context id', () {
+// Request request =
+// new ExecutionMapUriParams('xxx', uri: '').toRequest('4');
+// Response response = handler.handleRequest(request);
+// expect(response, isResponseFailure('4'));
+// });
+//
+// test('both file and uri', () {
+// Request request =
+// new ExecutionMapUriParams('xxx', file: '', uri: '').toRequest('5');
+// Response response = handler.handleRequest(request);
+// expect(response, isResponseFailure('5'));
+// });
+//
+// test('neither file nor uri', () {
+// Request request = new ExecutionMapUriParams('xxx').toRequest('6');
+// Response response = handler.handleRequest(request);
+// expect(response, isResponseFailure('6'));
+// });
+// });
});
}
« no previous file with comments | « pkg/analysis_server/test/domain_analysis_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698