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

Side by Side Diff: pkg/analysis_server/test/integration/execution/map_uri_test.dart

Issue 2681393004: Implement also 'execution.mapUri' for file to URI. (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « pkg/analysis_server/lib/src/domain_execution.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:async';
6
7 import 'package:analysis_server/plugin/protocol/protocol.dart'; 5 import 'package:analysis_server/plugin/protocol/protocol.dart';
8 import 'package:test/test.dart'; 6 import 'package:test/test.dart';
9 import 'package:test_reflective_loader/test_reflective_loader.dart'; 7 import 'package:test_reflective_loader/test_reflective_loader.dart';
10 8
11 import '../integration_tests.dart'; 9 import '../integration_tests.dart';
12 10
13 main() { 11 main() {
14 defineReflectiveSuite(() { 12 defineReflectiveSuite(() {
15 defineReflectiveTests(MapUriTest); 13 defineReflectiveTests(MapUriTest);
16 defineReflectiveTests(MapUriTest_Driver); 14 defineReflectiveTests(MapUriTest_Driver);
17 }); 15 });
18 } 16 }
19 17
20 class AbstractMapUriTest extends AbstractAnalysisServerIntegrationTest { 18 class AbstractMapUriTest extends AbstractAnalysisServerIntegrationTest {
21 Future test_mapUri() async { 19 test_mapUri() async {
22 String pathname = sourcePath('lib/main.dart'); 20 String pathname = sourcePath('lib/main.dart');
23 writeFile(pathname, '// dummy'); 21 writeFile(pathname, '// dummy');
24 writeFile(sourcePath('.packages'), 'foo:lib/'); 22 writeFile(sourcePath('.packages'), 'foo:lib/');
25 standardAnalysisSetup(); 23 standardAnalysisSetup();
26 24
27 String contextId = 25 String contextId =
28 (await sendExecutionCreateContext(sourceDirectory.path))?.id; 26 (await sendExecutionCreateContext(sourceDirectory.path))?.id;
29 ExecutionMapUriResult result = 27
30 await sendExecutionMapUri(contextId, uri: 'package:foo/main.dart'); 28 {
31 expect(result.file, pathname); 29 ExecutionMapUriResult result =
30 await sendExecutionMapUri(contextId, uri: 'package:foo/main.dart');
31 expect(result.file, pathname);
32 }
33
34 {
35 ExecutionMapUriResult result =
36 await sendExecutionMapUri(contextId, file: pathname);
37 expect(result.uri, 'package:foo/main.dart');
38 }
32 } 39 }
33 } 40 }
34 41
35 @reflectiveTest 42 @reflectiveTest
36 class MapUriTest extends AbstractMapUriTest {} 43 class MapUriTest extends AbstractMapUriTest {}
37 44
38 @reflectiveTest 45 @reflectiveTest
39 class MapUriTest_Driver extends AbstractMapUriTest { 46 class MapUriTest_Driver extends AbstractMapUriTest {
40 @override 47 @override
41 bool get enableNewAnalysisDriver => true; 48 bool get enableNewAnalysisDriver => true;
42 } 49 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/domain_execution.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698