| 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.analysis_server; | 5 library test.analysis_server; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/analysis_server.dart'; | 9 import 'package:analysis_server/src/analysis_server.dart'; |
| 10 import 'package:analysis_server/src/constants.dart'; | 10 import 'package:analysis_server/src/constants.dart'; |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 server.serverServices = [ServerService.STATUS].toSet(); | 196 server.serverServices = [ServerService.STATUS].toSet(); |
| 197 // Analyze project foo containing foo.dart and project bar containing | 197 // Analyze project foo containing foo.dart and project bar containing |
| 198 // bar.dart. | 198 // bar.dart. |
| 199 resourceProvider.newFolder('/foo'); | 199 resourceProvider.newFolder('/foo'); |
| 200 resourceProvider.newFolder('/bar'); | 200 resourceProvider.newFolder('/bar'); |
| 201 File foo = resourceProvider.newFile('/foo/foo.dart', 'library lib;'); | 201 File foo = resourceProvider.newFile('/foo/foo.dart', 'library lib;'); |
| 202 Source fooSource = foo.createSource(); | 202 Source fooSource = foo.createSource(); |
| 203 File bar = resourceProvider.newFile('/bar/bar.dart', 'library lib;'); | 203 File bar = resourceProvider.newFile('/bar/bar.dart', 'library lib;'); |
| 204 Source barSource = bar.createSource(); | 204 Source barSource = bar.createSource(); |
| 205 server.setAnalysisRoots('0', ['/foo', '/bar'], [], {}); | 205 server.setAnalysisRoots('0', ['/foo', '/bar'], [], {}); |
| 206 return pumpEventQueue(40).then((_) { | 206 return pumpEventQueue(50).then((_) { |
| 207 expect(server.statusAnalyzing, isFalse); | 207 expect(server.statusAnalyzing, isFalse); |
| 208 // Make sure getAnalysisContext returns the proper context for each. | 208 // Make sure getAnalysisContext returns the proper context for each. |
| 209 AnalysisContext fooContext = | 209 AnalysisContext fooContext = |
| 210 server.getAnalysisContextForSource(fooSource); | 210 server.getAnalysisContextForSource(fooSource); |
| 211 expect(fooContext, isNotNull); | 211 expect(fooContext, isNotNull); |
| 212 AnalysisContext barContext = | 212 AnalysisContext barContext = |
| 213 server.getAnalysisContextForSource(barSource); | 213 server.getAnalysisContextForSource(barSource); |
| 214 expect(barContext, isNotNull); | 214 expect(barContext, isNotNull); |
| 215 expect(fooContext, isNot(same(barContext))); | 215 expect(fooContext, isNot(same(barContext))); |
| 216 expect(fooContext.getKindOf(fooSource), SourceKind.LIBRARY); | 216 expect(fooContext.getKindOf(fooSource), SourceKind.LIBRARY); |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 _MockServerOperation(this.context); | 481 _MockServerOperation(this.context); |
| 482 | 482 |
| 483 @override | 483 @override |
| 484 ServerOperationPriority get priority => ServerOperationPriority.ANALYSIS; | 484 ServerOperationPriority get priority => ServerOperationPriority.ANALYSIS; |
| 485 | 485 |
| 486 @override | 486 @override |
| 487 void perform(AnalysisServer server) { | 487 void perform(AnalysisServer server) { |
| 488 isComplete = true; | 488 isComplete = true; |
| 489 } | 489 } |
| 490 } | 490 } |
| OLD | NEW |