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

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

Issue 1455163005: Implement AnalysisServer.getContainingContext() using ContextManager. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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/analysis_server_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 174e6c2de8d5506211c3d26a059e46f184aa4ae2..a142adbea7e558faed0134d2170abb68e4aa1e34 100644
--- a/pkg/analysis_server/test/domain_execution_test.dart
+++ b/pkg/analysis_server/test/domain_execution_test.dart
@@ -93,8 +93,8 @@ main() {
group('mapUri', () {
String contextId;
- void createExecutionContextIdForFile(String zzz) {
- Request request = new ExecutionCreateContextParams(zzz).toRequest('0');
+ void createExecutionContextIdForFile(String path) {
+ Request request = new ExecutionCreateContextParams(path).toRequest('0');
Response response = handler.handleRequest(request);
expect(response, isResponseSuccess('0'));
ExecutionCreateContextResult result =
@@ -137,17 +137,6 @@ main() {
Response response = handler.handleRequest(request);
expect(response, isResponseFailure('2'));
});
-
- test('valid', () {
- Request request = new ExecutionMapUriParams(contextId,
- file: '/a/b.dart').toRequest('2');
- Response response = handler.handleRequest(request);
- expect(response, isResponseSuccess('2'));
- ExecutionMapUriResult result =
- new ExecutionMapUriResult.fromResponse(response);
- expect(result.file, isNull);
- expect(result.uri, 'file:///a/b.dart');
- });
});
group('URI to file', () {
@@ -157,17 +146,6 @@ main() {
Response response = handler.handleRequest(request);
expect(response, isResponseFailure('2'));
});
-
- test('valid', () {
- Request request = new ExecutionMapUriParams(contextId,
- uri: 'file:///a/b.dart').toRequest('2');
- Response response = handler.handleRequest(request);
- expect(response, isResponseSuccess('2'));
- ExecutionMapUriResult result =
- new ExecutionMapUriResult.fromResponse(response);
- expect(result.file, '/a/b.dart');
- expect(result.uri, isNull);
- });
});
test('invalid context id', () {
@@ -311,7 +289,16 @@ class ExecutionDomainTest extends AbstractAnalysisTest {
_disposeExecutionContext();
}
- void test_mapUri_file_dart() {
+ void test_mapUri_file() {
+ String path = '/a/b.dart';
+ resourceProvider.newFile(path, '');
+ // map the file
+ ExecutionMapUriResult result = _mapUri(file: path);
+ expect(result.file, isNull);
+ expect(result.uri, 'file:///a/b.dart');
+ }
+
+ void test_mapUri_file_dartUriKind() {
String path = server.defaultSdk.mapDartUri('dart:async').fullName;
// hack - pretend that the SDK file exists in the project FS
resourceProvider.newFile(path, '// hack');
@@ -321,6 +308,15 @@ class ExecutionDomainTest extends AbstractAnalysisTest {
expect(result.uri, 'dart:async');
}
+ void test_mapUri_uri() {
+ String path = '/a/b.dart';
+ resourceProvider.newFile(path, '');
+ // map the uri
+ ExecutionMapUriResult result = _mapUri(uri: 'file://$path');
+ expect(result.file, '/a/b.dart');
+ expect(result.uri, isNull);
+ }
+
void _createExecutionContext(String path) {
Request request = new ExecutionCreateContextParams(path).toRequest('0');
Response response = handler.handleRequest(request);
« no previous file with comments | « pkg/analysis_server/test/analysis_server_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698