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 analyzer.test.src.context.context_test; | 5 library analyzer.test.src.context.context_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection'; | 8 import 'dart:collection'; |
9 | 9 |
10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
970 .then((_) { | 970 .then((_) { |
971 expect(completed, isFalse); | 971 expect(completed, isFalse); |
972 _performPendingAnalysisTasks(); | 972 _performPendingAnalysisTasks(); |
973 }) | 973 }) |
974 .then((_) => pumpEventQueue()) | 974 .then((_) => pumpEventQueue()) |
975 .then((_) { | 975 .then((_) { |
976 expect(completed, isTrue); | 976 expect(completed, isTrue); |
977 }); | 977 }); |
978 } | 978 } |
979 | 979 |
980 void test_configurationData() { | |
981 var key = new ResultDescriptor('test_key', 'TEST_DEFAULT'); | |
982 var testData = ['test', 'data']; | |
983 context.setConfigurationData(key, testData); | |
984 expect(context.getConfigurationData(key), testData); | |
985 var unusedKey = new ResultDescriptor('unused_key', 'UNUSED_DEFAULT'); | |
986 expect(context.getConfigurationData(unusedKey), 'UNUSED_DEFAULT'); | |
987 } | |
988 | |
989 void test_dispose() { | 980 void test_dispose() { |
990 expect(context.isDisposed, isFalse); | 981 expect(context.isDisposed, isFalse); |
991 context.dispose(); | 982 context.dispose(); |
992 expect(context.isDisposed, isTrue); | 983 expect(context.isDisposed, isTrue); |
993 } | 984 } |
994 | 985 |
995 void test_ensureResolvedDartUnits_definingUnit_hasResolved() { | 986 void test_ensureResolvedDartUnits_definingUnit_hasResolved() { |
996 Source source = addSource('/test.dart', ''); | 987 Source source = addSource('/test.dart', ''); |
997 LibrarySpecificUnit libTarget = new LibrarySpecificUnit(source, source); | 988 LibrarySpecificUnit libTarget = new LibrarySpecificUnit(source, source); |
998 analysisDriver.computeResult(libTarget, RESOLVED_UNIT); | 989 analysisDriver.computeResult(libTarget, RESOLVED_UNIT); |
(...skipping 4446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5445 * Initialize the visitor. | 5436 * Initialize the visitor. |
5446 */ | 5437 */ |
5447 _ElementGatherer(); | 5438 _ElementGatherer(); |
5448 | 5439 |
5449 @override | 5440 @override |
5450 void visitElement(Element element) { | 5441 void visitElement(Element element) { |
5451 elements[element] = element; | 5442 elements[element] = element; |
5452 super.visitElement(element); | 5443 super.visitElement(element); |
5453 } | 5444 } |
5454 } | 5445 } |
OLD | NEW |