OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library test.domain.analysis; | 5 library test.domain.analysis; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
10 import 'package:analysis_server/src/analysis_server.dart'; | 10 import 'package:analysis_server/src/analysis_server.dart'; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 resourceProvider.newFile(fileB, ''); | 63 resourceProvider.newFile(fileB, ''); |
64 | 64 |
65 server.setAnalysisRoots('0', ['/project/'], [], {}); | 65 server.setAnalysisRoots('0', ['/project/'], [], {}); |
66 | 66 |
67 await server.onAnalysisComplete; | 67 await server.onAnalysisComplete; |
68 | 68 |
69 var request = | 69 var request = |
70 new AnalysisGetReachableSourcesParams(fileA).toRequest('0'); | 70 new AnalysisGetReachableSourcesParams(fileA).toRequest('0'); |
71 var response = handler.handleRequest(request); | 71 var response = handler.handleRequest(request); |
72 | 72 |
73 var json = response.toJson()[Response.RESULT]; | 73 Map json = response.toJson()[Response.RESULT]; |
74 | 74 |
75 // Sanity checks. | 75 // Sanity checks. |
76 expect(json['sources'], hasLength(6)); | 76 expect(json['sources'], hasLength(6)); |
77 expect(json['sources']['file:///project/a.dart'], | 77 expect(json['sources']['file:///project/a.dart'], |
78 unorderedEquals(['dart:core', 'file:///project/b.dart'])); | 78 unorderedEquals(['dart:core', 'file:///project/b.dart'])); |
79 expect(json['sources']['file:///project/b.dart'], ['dart:core']); | 79 expect(json['sources']['file:///project/b.dart'], ['dart:core']); |
80 }); | 80 }); |
81 | 81 |
82 test('invalid source', () async { | 82 test('invalid source', () async { |
83 resourceProvider.newFile('/project/a.dart', 'import "b.dart";'); | 83 resourceProvider.newFile('/project/a.dart', 'import "b.dart";'); |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 test_beforeAnalysis() async { | 808 test_beforeAnalysis() async { |
809 addTestFile('int V = 42;'); | 809 addTestFile('int V = 42;'); |
810 createProject(); | 810 createProject(); |
811 // subscribe | 811 // subscribe |
812 addAnalysisSubscription(AnalysisService.HIGHLIGHTS, testFile); | 812 addAnalysisSubscription(AnalysisService.HIGHLIGHTS, testFile); |
813 // wait for analysis | 813 // wait for analysis |
814 await waitForTasksFinished(); | 814 await waitForTasksFinished(); |
815 expect(filesHighlights[testFile], isNotEmpty); | 815 expect(filesHighlights[testFile], isNotEmpty); |
816 } | 816 } |
817 } | 817 } |
OLD | NEW |