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

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

Issue 1181223002: Fix for computeResolvedCompilationUnitAsync(). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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 | « pkg/analyzer/lib/src/context/context.dart ('k') | 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 6808d88a026390847a3ac69d751c273ed6b31b00..81a0d50cd7ad33158305f9ab9ecdc5ba6e2324c5 100644
--- a/pkg/analyzer/test/src/context/context_test.dart
+++ b/pkg/analyzer/test/src/context/context_test.dart
@@ -240,16 +240,14 @@ import 'libB.dart';''';
});
}
- Future fail_computeResolvedCompilationUnitAsync_unrelatedLibrary() {
+ Future test_computeResolvedCompilationUnitAsync_noCacheEntry() {
Source librarySource = addSource("/lib.dart", "library lib;");
Source partSource = addSource("/part.dart", "part of foo;");
bool completed = false;
context
.computeResolvedCompilationUnitAsync(partSource, librarySource)
- .then((_) {
- fail('Expected resolution to fail');
- }, onError: (e) {
- expect(e, new isInstanceOf<AnalysisNotScheduledError>());
+ .then((CompilationUnit unit) {
+ expect(unit, isNotNull);
completed = true;
});
return pumpEventQueue().then((_) {
@@ -1957,7 +1955,7 @@ int a = 0;''');
expect(context.sourcesNeedingProcessing.contains(source), isFalse);
}
- Future xtest_computeResolvedCompilationUnitAsync() {
+ Future test_computeResolvedCompilationUnitAsync() {
Source source = addSource("/lib.dart", "library lib;");
// Complete all pending analysis tasks and flush the AST so that it won't
// be available immediately.
@@ -1978,7 +1976,7 @@ int a = 0;''');
});
}
- Future xtest_computeResolvedCompilationUnitAsync_cancel() {
+ Future test_computeResolvedCompilationUnitAsync_cancel() {
Source source = addSource("/lib.dart", "library lib;");
// Complete all pending analysis tasks and flush the AST so that it won't
// be available immediately.
@@ -2084,8 +2082,8 @@ int a = 0;''');
}
void _flushAst(Source source) {
- CacheEntry entry = context
- .getReadableSourceEntryOrNull(new LibrarySpecificUnit(source, source));
+ CacheEntry entry =
+ context.getCacheEntry(new LibrarySpecificUnit(source, source));
entry.setState(RESOLVED_UNIT, CacheState.FLUSHED);
}
« no previous file with comments | « pkg/analyzer/lib/src/context/context.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698