Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Side by Side Diff: pkg/analyzer/test/src/context/context_test.dart

Issue 2402883002: More test clean-up (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2700 matching lines...) Expand 10 before | Expand all | Expand 10 after
2711 context.applyAnalysisDelta(delta); 2711 context.applyAnalysisDelta(delta);
2712 expect(context.sourcesNeedingProcessing, contains(source)); 2712 expect(context.sourcesNeedingProcessing, contains(source));
2713 delta = new AnalysisDelta(); 2713 delta = new AnalysisDelta();
2714 delta.setAnalysisLevel(source, AnalysisLevel.NONE); 2714 delta.setAnalysisLevel(source, AnalysisLevel.NONE);
2715 context.applyAnalysisDelta(delta); 2715 context.applyAnalysisDelta(delta);
2716 expect(context.sourcesNeedingProcessing.contains(source), isFalse); 2716 expect(context.sourcesNeedingProcessing.contains(source), isFalse);
2717 } 2717 }
2718 2718
2719 void test_validateCacheConsistency_deletedFile() { 2719 void test_validateCacheConsistency_deletedFile() {
2720 MemoryResourceProvider resourceProvider = new MemoryResourceProvider(); 2720 MemoryResourceProvider resourceProvider = new MemoryResourceProvider();
2721 var fileA = resourceProvider.newFile('/a.dart', ""); 2721 String pathA = resourceProvider.convertPath('/a.dart');
2722 var fileB = resourceProvider.newFile('/b.dart', "import 'a.dart';"); 2722 String pathB = resourceProvider.convertPath('/b.dart');
2723 var fileA = resourceProvider.newFile(pathA, "");
2724 var fileB = resourceProvider.newFile(pathB, "import 'a.dart';");
2723 Source sourceA = fileA.createSource(); 2725 Source sourceA = fileA.createSource();
2724 Source sourceB = fileB.createSource(); 2726 Source sourceB = fileB.createSource();
2725 context.applyChanges( 2727 context.applyChanges(
2726 new ChangeSet()..addedSource(sourceA)..addedSource(sourceB)); 2728 new ChangeSet()..addedSource(sourceA)..addedSource(sourceB));
2727 // analyze everything 2729 // analyze everything
2728 _analyzeAll_assertFinished(); 2730 _analyzeAll_assertFinished();
2729 // delete a.dart 2731 // delete a.dart
2730 resourceProvider.deleteFile(resourceProvider.convertPath('/a.dart')); 2732 resourceProvider.deleteFile(pathA);
2731 // analysis should eventually stop 2733 // analysis should eventually stop
2732 _analyzeAll_assertFinished(); 2734 _analyzeAll_assertFinished();
2733 } 2735 }
2734 2736
2735 void xtest_performAnalysisTask_stress() { 2737 void xtest_performAnalysisTask_stress() {
2736 int maxCacheSize = 4; 2738 int maxCacheSize = 4;
2737 AnalysisOptionsImpl options = 2739 AnalysisOptionsImpl options =
2738 new AnalysisOptionsImpl.from(context.analysisOptions); 2740 new AnalysisOptionsImpl.from(context.analysisOptions);
2739 context.analysisOptions = options; 2741 context.analysisOptions = options;
2740 int sourceCount = maxCacheSize + 2; 2742 int sourceCount = maxCacheSize + 2;
(...skipping 2531 matching lines...) Expand 10 before | Expand all | Expand 10 after
5272 * Initialize the visitor. 5274 * Initialize the visitor.
5273 */ 5275 */
5274 _ElementGatherer(); 5276 _ElementGatherer();
5275 5277
5276 @override 5278 @override
5277 void visitElement(Element element) { 5279 void visitElement(Element element) {
5278 elements[element] = element; 5280 elements[element] = element;
5279 super.visitElement(element); 5281 super.visitElement(element);
5280 } 5282 }
5281 } 5283 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/file_system/memory_file_system.dart ('k') | pkg/analyzer/test/src/dart/sdk/sdk_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698