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

Unified Diff: pkg/analyzer/test/src/context/context_test.dart

Issue 1140573003: Fix context tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/context/context_test.dart
diff --git a/pkg/analyzer/test/src/context/context_test.dart b/pkg/analyzer/test/src/context/context_test.dart
index d5bbb16793e18438e28ad2d54f6b21031bef14c4..2eecc4d587615aeeae77e10bb5625945ca394832 100644
--- a/pkg/analyzer/test/src/context/context_test.dart
+++ b/pkg/analyzer/test/src/context/context_test.dart
@@ -217,15 +217,15 @@ import 'libB.dart';''';
expect(resolvedUnit, same(parsedUnit));
}
- Future fail_computeResolvedCompilationUnitAsync_dispose() {
+ Future test_computeResolvedCompilationUnitAsync_dispose() {
Source source = addSource("/lib.dart", "library lib;");
// Complete all pending analysis tasks and flush the AST so that it won't
// be available immediately.
_performPendingAnalysisTasks();
_flushAst(source);
+ bool completed = false;
CancelableFuture<CompilationUnit> future =
context.computeResolvedCompilationUnitAsync(source, source);
- bool completed = false;
future.then((CompilationUnit unit) {
fail('Future should have completed with error');
}, onError: (error) {
@@ -1200,7 +1200,7 @@ main() {}''');
expect(info, isNotNull);
}
- Future fail_computeResolvedCompilationUnitAsync_afterDispose() {
+ Future test_computeResolvedCompilationUnitAsync_afterDispose() {
Source source = addSource("/lib.dart", "library lib;");
// Complete all pending analysis tasks and flush the AST so that it won't
// be available immediately.
@@ -1949,7 +1949,7 @@ int a = 0;''');
}
void _flushAst(Source source) {
- CacheEntry entry = context.getReadableSourceEntryOrNull(source);
+ CacheEntry entry = context.getReadableSourceEntryOrNull(new LibrarySpecificUnit(source, source));
entry.setState(RESOLVED_UNIT, CacheState.FLUSHED);
}
@@ -1962,7 +1962,7 @@ int a = 0;''');
return context2.test_priorityOrder;
}
- void _performPendingAnalysisTasks([int maxTasks = 20]) {
+ void _performPendingAnalysisTasks([int maxTasks = 512]) {
for (int i = 0; context.performAnalysisTask().hasMoreWork; i++) {
if (i > maxTasks) {
fail('Analysis did not terminate.');
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698