| 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.src.context.context_test; | 5 library test.src.context.context_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analyzer/file_system/memory_file_system.dart'; | 9 import 'package:analyzer/file_system/memory_file_system.dart'; |
| 10 import 'package:analyzer/src/cancelable_future.dart'; | 10 import 'package:analyzer/src/cancelable_future.dart'; |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 completed = true; | 642 completed = true; |
| 643 }); | 643 }); |
| 644 return pumpEventQueue().then((_) { | 644 return pumpEventQueue().then((_) { |
| 645 expect(completed, isFalse); | 645 expect(completed, isFalse); |
| 646 _performPendingAnalysisTasks(); | 646 _performPendingAnalysisTasks(); |
| 647 }).then((_) => pumpEventQueue()).then((_) { | 647 }).then((_) => pumpEventQueue()).then((_) { |
| 648 expect(completed, isTrue); | 648 expect(completed, isTrue); |
| 649 }); | 649 }); |
| 650 } | 650 } |
| 651 | 651 |
| 652 void test_configurationData() { |
| 653 var key = new ResultDescriptor('test_key', ''); |
| 654 var testData = ['test', 'data']; |
| 655 context.setConfigurationData(key, testData); |
| 656 expect(context.getConfigurationData(key), testData); |
| 657 var unusedKey = new ResultDescriptor('unused_key', ''); |
| 658 expect(context.getConfigurationData(unusedKey), null); |
| 659 } |
| 660 |
| 652 void test_dispose() { | 661 void test_dispose() { |
| 653 expect(context.isDisposed, isFalse); | 662 expect(context.isDisposed, isFalse); |
| 654 context.dispose(); | 663 context.dispose(); |
| 655 expect(context.isDisposed, isTrue); | 664 expect(context.isDisposed, isTrue); |
| 656 } | 665 } |
| 657 | 666 |
| 658 void test_ensureResolvedDartUnits_definingUnit_hasResolved() { | 667 void test_ensureResolvedDartUnits_definingUnit_hasResolved() { |
| 659 Source source = addSource('/test.dart', ''); | 668 Source source = addSource('/test.dart', ''); |
| 660 LibrarySpecificUnit libTarget = new LibrarySpecificUnit(source, source); | 669 LibrarySpecificUnit libTarget = new LibrarySpecificUnit(source, source); |
| 661 analysisDriver.computeResult(libTarget, RESOLVED_UNIT); | 670 analysisDriver.computeResult(libTarget, RESOLVED_UNIT); |
| (...skipping 1890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2552 } | 2561 } |
| 2553 } | 2562 } |
| 2554 | 2563 |
| 2555 class _AnalysisContextImplTest_test_applyChanges_removeContainer | 2564 class _AnalysisContextImplTest_test_applyChanges_removeContainer |
| 2556 implements SourceContainer { | 2565 implements SourceContainer { |
| 2557 Source libB; | 2566 Source libB; |
| 2558 _AnalysisContextImplTest_test_applyChanges_removeContainer(this.libB); | 2567 _AnalysisContextImplTest_test_applyChanges_removeContainer(this.libB); |
| 2559 @override | 2568 @override |
| 2560 bool contains(Source source) => source == libB; | 2569 bool contains(Source source) => source == libB; |
| 2561 } | 2570 } |
| OLD | NEW |