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

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

Issue 1211993003: Get more tests passing using the new task model (Closed) Base URL: https://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/test/generated/test_support.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 69250b12de975dd38338e62da8aa07cda6a78ce4..e670075dcda35a3cbc7db1452077b99bc0256603 100644
--- a/pkg/analyzer/test/src/context/context_test.dart
+++ b/pkg/analyzer/test/src/context/context_test.dart
@@ -54,21 +54,9 @@ main() {
@reflectiveTest
class AnalysisContextImplTest extends AbstractContextTest {
- void fail_applyChanges_empty() {
+ void test_applyChanges_empty() {
context.applyChanges(new ChangeSet());
expect(context.performAnalysisTask().changeNotices, isNull);
- // This test appears to be flaky. If it is named "test_" it fails, if it's
- // named "fail_" it doesn't fail. I'm guessing that it's dependent on
- // whether some other test is run.
- fail('Should have failed');
- }
-
- void fail_extractContext() {
- fail("Implement this");
- }
-
- void fail_mergeContext() {
- fail("Implement this");
}
void fail_parseHtmlUnit_resolveDirectives() {
@@ -89,6 +77,15 @@ class ClassA {}''');
</html>''');
// TODO(brianwilkerson) Rewrite this. We need a way to get the AST for the
// script.
+// Document document = context.parseHtmlDocument(source);
+// expect(document, isNotNull);
+// List<DartScript> scripts = context.computeResult(source, DART_SCRIPTS);
+// expect(scripts, hasLength(1));
+// CompilationUnit unit = context.computeResult(scripts[0], PARSED_AST);
+// ImportDirective importNode = unit.directives[0] as ImportDirective;
+// expect(importNode.uriContent, isNotNull);
+// expect(importNode.source, libSource);
+
ht.HtmlUnit unit = context.parseHtmlUnit(source);
expect(unit, isNotNull);
// import directive should be resolved
@@ -101,7 +98,7 @@ class ClassA {}''');
expect(importNode.source, libSource);
}
- void fail_performAnalysisTask_getContentException_dart() {
+ void test_performAnalysisTask_getContentException_dart() {
Source source = _addSourceWithException('test.dart');
// prepare errors
_analyzeAll_assertFinished();
@@ -113,7 +110,7 @@ class ClassA {}''');
expect(error.errorCode, ScannerErrorCode.UNABLE_GET_CONTENT);
}
- void fail_performAnalysisTask_getContentException_html() {
+ void test_performAnalysisTask_getContentException_html() {
Source source = _addSourceWithException('test.html');
// prepare errors
_analyzeAll_assertFinished();
@@ -149,20 +146,15 @@ class ClassA {}''');
reason: "htmlSource has an error");
}
- void fail_performAnalysisTask_IOException() {
+ void test_performAnalysisTask_IOException() {
TestSource source = _addSourceWithException2("/test.dart", "library test;");
- int oldTimestamp = context.getModificationStamp(source);
source.generateExceptionOnRead = false;
_analyzeAll_assertFinished();
expect(source.readCount, 1);
+ _changeSource(source, "");
source.generateExceptionOnRead = true;
- do {
- _changeSource(source, "");
- // Ensure that the timestamp differs,
- // so that analysis engine notices the change
- } while (oldTimestamp == context.getModificationStamp(source));
_analyzeAll_assertFinished();
- expect(source.readCount, 2);
+ expect(source.readCount, 3);
}
void fail_recordLibraryElements() {
« no previous file with comments | « pkg/analyzer/test/generated/test_support.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698