| 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 // add overlay | 301 // add overlay |
| 302 context.setContents(source, r''' | 302 context.setContents(source, r''' |
| 303 main() { | 303 main() { |
| 304 print(12); | 304 print(12); |
| 305 } | 305 } |
| 306 '''); | 306 '''); |
| 307 _analyzeAll_assertFinished(); | 307 _analyzeAll_assertFinished(); |
| 308 expect(context.getResolvedCompilationUnit2(source, source), unit); | 308 expect(context.getResolvedCompilationUnit2(source, source), unit); |
| 309 // remove overlay | 309 // remove overlay |
| 310 context.setContents(source, null); | 310 context.setContents(source, null); |
| 311 context.validateCacheConsistency(); |
| 311 _analyzeAll_assertFinished(); | 312 _analyzeAll_assertFinished(); |
| 312 expect(context.getResolvedCompilationUnit2(source, source), unit); | 313 expect(context.getResolvedCompilationUnit2(source, source), unit); |
| 313 } | 314 } |
| 314 | 315 |
| 315 Future test_applyChanges_removeContainer() { | 316 Future test_applyChanges_removeContainer() { |
| 316 SourcesChangedListener listener = new SourcesChangedListener(); | 317 SourcesChangedListener listener = new SourcesChangedListener(); |
| 317 context.onSourcesChanged.listen(listener.onData); | 318 context.onSourcesChanged.listen(listener.onData); |
| 318 String libAContents = r''' | 319 String libAContents = r''' |
| 319 library libA; | 320 library libA; |
| 320 import 'libB.dart';'''; | 321 import 'libB.dart';'''; |
| (...skipping 1984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2305 } | 2306 } |
| 2306 } | 2307 } |
| 2307 | 2308 |
| 2308 class _AnalysisContextImplTest_test_applyChanges_removeContainer | 2309 class _AnalysisContextImplTest_test_applyChanges_removeContainer |
| 2309 implements SourceContainer { | 2310 implements SourceContainer { |
| 2310 Source libB; | 2311 Source libB; |
| 2311 _AnalysisContextImplTest_test_applyChanges_removeContainer(this.libB); | 2312 _AnalysisContextImplTest_test_applyChanges_removeContainer(this.libB); |
| 2312 @override | 2313 @override |
| 2313 bool contains(Source source) => source == libB; | 2314 bool contains(Source source) => source == libB; |
| 2314 } | 2315 } |
| OLD | NEW |