| 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 import 'package:analysis_server/protocol/protocol.dart'; | 7 import 'package:analysis_server/protocol/protocol.dart'; |
| 8 import 'package:analysis_server/protocol/protocol_constants.dart'; |
| 8 import 'package:analysis_server/protocol/protocol_generated.dart'; | 9 import 'package:analysis_server/protocol/protocol_generated.dart'; |
| 9 import 'package:analysis_server/src/constants.dart'; | |
| 10 import 'package:analyzer_plugin/protocol/protocol_common.dart'; | 10 import 'package:analyzer_plugin/protocol/protocol_common.dart'; |
| 11 import 'package:test/test.dart'; | 11 import 'package:test/test.dart'; |
| 12 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 12 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 13 | 13 |
| 14 import '../analysis_abstract.dart'; | 14 import '../analysis_abstract.dart'; |
| 15 | 15 |
| 16 main() { | 16 main() { |
| 17 defineReflectiveSuite(() { | 17 defineReflectiveSuite(() { |
| 18 defineReflectiveTests(_AnalysisNotificationOutlineTest); | 18 defineReflectiveTests(_AnalysisNotificationOutlineTest); |
| 19 }); | 19 }); |
| 20 } | 20 } |
| 21 | 21 |
| 22 @reflectiveTest | 22 @reflectiveTest |
| 23 class _AnalysisNotificationOutlineTest extends AbstractAnalysisTest { | 23 class _AnalysisNotificationOutlineTest extends AbstractAnalysisTest { |
| 24 FileKind fileKind; | 24 FileKind fileKind; |
| 25 String libraryName; | 25 String libraryName; |
| 26 Outline outline; | 26 Outline outline; |
| 27 | 27 |
| 28 Completer _resultsAvailable = new Completer(); | 28 Completer _resultsAvailable = new Completer(); |
| 29 | 29 |
| 30 Future prepareOutline() { | 30 Future prepareOutline() { |
| 31 addAnalysisSubscription(AnalysisService.OUTLINE, testFile); | 31 addAnalysisSubscription(AnalysisService.OUTLINE, testFile); |
| 32 return _resultsAvailable.future; | 32 return _resultsAvailable.future; |
| 33 } | 33 } |
| 34 | 34 |
| 35 void processNotification(Notification notification) { | 35 void processNotification(Notification notification) { |
| 36 if (notification.event == ANALYSIS_OUTLINE) { | 36 if (notification.event == ANALYSIS_NOTIFICATION_OUTLINE) { |
| 37 var params = new AnalysisOutlineParams.fromNotification(notification); | 37 var params = new AnalysisOutlineParams.fromNotification(notification); |
| 38 if (params.file == testFile) { | 38 if (params.file == testFile) { |
| 39 fileKind = params.kind; | 39 fileKind = params.kind; |
| 40 libraryName = params.libraryName; | 40 libraryName = params.libraryName; |
| 41 outline = params.outline; | 41 outline = params.outline; |
| 42 _resultsAvailable.complete(null); | 42 _resultsAvailable.complete(null); |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 | 46 |
| (...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 847 } | 847 } |
| 848 | 848 |
| 849 void _isEnumConstant(Outline outline, String name) { | 849 void _isEnumConstant(Outline outline, String name) { |
| 850 Element element = outline.element; | 850 Element element = outline.element; |
| 851 expect(element.kind, ElementKind.ENUM_CONSTANT); | 851 expect(element.kind, ElementKind.ENUM_CONSTANT); |
| 852 expect(element.name, name); | 852 expect(element.name, name); |
| 853 expect(element.parameters, isNull); | 853 expect(element.parameters, isNull); |
| 854 expect(element.returnType, isNull); | 854 expect(element.returnType, isNull); |
| 855 } | 855 } |
| 856 } | 856 } |
| OLD | NEW |