Chromium Code Reviews| Index: pkg/analyzer/test/generated/engine_test.dart |
| diff --git a/pkg/analyzer/test/generated/engine_test.dart b/pkg/analyzer/test/generated/engine_test.dart |
| index 52b8c4026a27a86cb7d29184960b021f504972b3..df19bde330befd044a10459e8513894cd2f9d4bd 100644 |
| --- a/pkg/analyzer/test/generated/engine_test.dart |
| +++ b/pkg/analyzer/test/generated/engine_test.dart |
| @@ -4539,6 +4539,13 @@ class LintGeneratorTest_Linter_Null_Visitor extends Linter { |
| AstVisitor getVisitor() => null; |
| } |
| +class MockSourceFactory extends SourceFactory { |
| + MockSourceFactory() : super([]); |
| + Source resolveUri(Source containingSource, String containedUri) { |
| + throw new JavaIOException(); |
| + } |
| +} |
| + |
| @reflectiveTest |
| class ParseDartTaskTest extends EngineTestCase { |
| void test_accept() { |
| @@ -4627,6 +4634,26 @@ class A {}'''; |
| new ParseDartTaskTestTV_perform_validateDirectives(context, source)); |
| } |
| + void test_resolveDirective_dartUri() { |
| + GatheringErrorListener listener = new GatheringErrorListener(); |
| + ImportDirective directive = AstFactory.importDirective3('dart:core', null); |
| + AnalysisContext context = AnalysisContextFactory.contextWithCore(); |
| + Source source = |
| + ParseDartTask.resolveDirective(context, null, directive, listener); |
| + expect(source, isNotNull); |
| + } |
| + |
| + void test_resolveDirective_exception() { |
| + GatheringErrorListener listener = new GatheringErrorListener(); |
| + ImportDirective directive = AstFactory.importDirective3('dart:core', null); |
| + AnalysisContext context = new AnalysisContextImpl(); |
| + context.sourceFactory = new MockSourceFactory(); |
| + Source source = |
| + ParseDartTask.resolveDirective(context, null, directive, listener); |
| + expect(source, isNull); |
| + expect(listener.errors.length, 1); |
|
scheglov
2015/03/27 23:05:58
expect(listener.errors, hasLength(1));
Brian Wilkerson
2015/03/27 23:51:57
Done
|
| + } |
| + |
| /** |
| * Create and return a task that will parse the given content from the given source in the given |
| * context. |