| 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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 Source source = addSource("/test.dart", content); | 391 Source source = addSource("/test.dart", content); |
| 392 context.setContents(source, content); | 392 context.setContents(source, content); |
| 393 context.computeErrors(source); | 393 context.computeErrors(source); |
| 394 while (!context.sourcesNeedingProcessing.isEmpty) { | 394 while (!context.sourcesNeedingProcessing.isEmpty) { |
| 395 context.performAnalysisTask(); | 395 context.performAnalysisTask(); |
| 396 } | 396 } |
| 397 // Adding the source as a changedSource should have no effect since | 397 // Adding the source as a changedSource should have no effect since |
| 398 // it is already overridden in the content cache. | 398 // it is already overridden in the content cache. |
| 399 ChangeSet changeSet = new ChangeSet(); | 399 ChangeSet changeSet = new ChangeSet(); |
| 400 changeSet.changedSource(source); | 400 changeSet.changedSource(source); |
| 401 ApplyChangesStatus changesStatus = context.applyChanges(changeSet); | 401 context.applyChanges(changeSet); |
| 402 expect(changesStatus.hasChanges, isFalse); | |
| 403 expect(context.sourcesNeedingProcessing, hasLength(0)); | 402 expect(context.sourcesNeedingProcessing, hasLength(0)); |
| 404 } | 403 } |
| 405 | 404 |
| 406 void test_applyChanges_recompute_exportNamespace() { | 405 void test_applyChanges_recompute_exportNamespace() { |
| 407 Source libSource = addSource( | 406 Source libSource = addSource( |
| 408 "/lib.dart", | 407 "/lib.dart", |
| 409 r''' | 408 r''' |
| 410 class A {} | 409 class A {} |
| 411 '''); | 410 '''); |
| 412 Source exporterSource = addSource( | 411 Source exporterSource = addSource( |
| (...skipping 4835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5248 * Initialize the visitor. | 5247 * Initialize the visitor. |
| 5249 */ | 5248 */ |
| 5250 _ElementGatherer(); | 5249 _ElementGatherer(); |
| 5251 | 5250 |
| 5252 @override | 5251 @override |
| 5253 void visitElement(Element element) { | 5252 void visitElement(Element element) { |
| 5254 elements[element] = element; | 5253 elements[element] = element; |
| 5255 super.visitElement(element); | 5254 super.visitElement(element); |
| 5256 } | 5255 } |
| 5257 } | 5256 } |
| OLD | NEW |