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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/context/AnalysisContextImplTest.java

Issue 595513003: Version 1.7.0-dev.3.3 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/dart/
Patch Set: Created 6 years, 3 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
Index: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/context/AnalysisContextImplTest.java
===================================================================
--- editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/context/AnalysisContextImplTest.java (revision 40542)
+++ editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/context/AnalysisContextImplTest.java (working copy)
@@ -783,12 +783,17 @@
public void test_getLibrarySources() {
Source[] sources = context.getLibrarySources();
- assertLength(0, sources);
+ int originalLength = sources.length;
Source source = addSource("/test.dart", "library lib;");
context.computeKindOf(source);
sources = context.getLibrarySources();
- assertLength(1, sources);
- assertEquals(source, sources[0]);
+ assertLength(originalLength + 1, sources);
+ for (Source returnedSource : sources) {
+ if (returnedSource.equals(source)) {
+ return;
+ }
+ }
+ fail("The added source was not in the list of library sources");
}
public void test_getLineInfo() throws Exception {
@@ -898,9 +903,10 @@
public void test_getStatistics() {
AnalysisContextStatistics statistics = context.getStatistics();
assertNotNull(statistics);
- assertLength(0, statistics.getCacheRows());
- assertLength(0, statistics.getExceptions());
- assertLength(0, statistics.getSources());
+ // The following lines are fragile. The values depend on the number of libraries in the SDK.
+// assertLength(0, statistics.getCacheRows());
+// assertLength(0, statistics.getExceptions());
+// assertLength(0, statistics.getSources());
}
public void test_isClientLibrary_dart() throws Exception {
@@ -1250,7 +1256,7 @@
}
public void test_resolveCompilationUnit_sourceChangeDuringResolution() throws Exception {
- context = new AnalysisContextImpl() {
+ context = new AnalysisContextFactory.AnalysisContextForTests() {
@Override
protected DartEntry recordResolveDartLibraryTaskResults(ResolveDartLibraryTask task)
throws AnalysisException {
@@ -1498,6 +1504,7 @@
@Override
protected void tearDown() throws Exception {
context = null;
+ sourceFactory = null;
super.tearDown();
}

Powered by Google App Engine
This is Rietveld 408576698