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

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

Issue 1212973003: Fix another new task model test (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/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 6aecc4fd5731edd51803a39ab857ff3aa303a5cf..3ea2f8c7d6feb9a881c3aae63dc0d9725e8f0fa0 100644
--- a/pkg/analyzer/test/src/context/context_test.dart
+++ b/pkg/analyzer/test/src/context/context_test.dart
@@ -45,6 +45,7 @@ import '../../generated/engine_test.dart';
import '../../generated/test_support.dart';
import '../../reflective_tests.dart';
import 'abstract_context.dart';
+import 'package:analyzer/src/task/html.dart';
main() {
groupSep = ' | ';
@@ -54,7 +55,7 @@ main() {
@reflectiveTest
class AnalysisContextImplTest extends AbstractContextTest {
- void fail_parseHtmlUnit_resolveDirectives() {
+ void test_parseHtmlUnit_resolveDirectives() {
Source libSource = addSource("/lib.dart", r'''
library lib;
class ClassA {}''');
@@ -70,25 +71,12 @@ class ClassA {}''');
<body>
</body>
</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
- ht.XmlTagNode htmlNode = unit.tagNodes[0];
- ht.XmlTagNode headNode = htmlNode.tagNodes[0];
- ht.HtmlScriptTagNode scriptNode = headNode.tagNodes[0];
- CompilationUnit script = scriptNode.script;
- ImportDirective importNode = script.directives[0] as ImportDirective;
+ 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_UNIT);
+ ImportDirective importNode = unit.directives[0] as ImportDirective;
expect(importNode.uriContent, isNotNull);
expect(importNode.source, libSource);
}
« 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