Chromium Code Reviews| Index: pkg/analyzer/test/src/summary/in_summary_source_test.dart |
| diff --git a/pkg/analyzer/test/src/summary/in_summary_source_test.dart b/pkg/analyzer/test/src/summary/in_summary_source_test.dart |
| index f45602c49b6d8f3242fb0401d44f41f7f4ae25cc..f83d30ab9ef91cc68b73b2f53f1cfb539faca525 100644 |
| --- a/pkg/analyzer/test/src/summary/in_summary_source_test.dart |
| +++ b/pkg/analyzer/test/src/summary/in_summary_source_test.dart |
| @@ -4,6 +4,7 @@ |
| library analyzer.test.src.summary.in_summary_source_test; |
| +import 'package:analyzer/file_system/physical_file_system.dart'; |
| import 'package:analyzer/src/generated/source_io.dart'; |
| import 'package:analyzer/src/summary/format.dart'; |
| import 'package:analyzer/src/summary/idl.dart'; |
| @@ -23,35 +24,41 @@ class InSummarySourceTest extends ReflectiveTest { |
| test_fallbackPath() { |
| String fooFallbackPath = absolute('path', 'to', 'foo.dart'); |
| var sourceFactory = new SourceFactory([ |
| - new InSummaryPackageUriResolver(new MockSummaryDataStore.fake( |
| - {'package:foo/foo.dart': 'foo.sum',}, |
| - uriToFallbackModePath: {'package:foo/foo.dart': fooFallbackPath})) |
| + new InSummaryUriResolver( |
| + PhysicalResourceProvider.INSTANCE, |
| + new MockSummaryDataStore.fake({ |
| + 'package:foo/foo.dart': 'foo.sum', |
| + }, uriToFallbackModePath: { |
| + 'package:foo/foo.dart': fooFallbackPath |
| + })) |
| ]); |
| InSummarySource source = sourceFactory.forUri('package:foo/foo.dart'); |
| - expect(source, new isInstanceOf<FileBasedSource>()); |
| + expect(source, isNotNull); |
|
Brian Wilkerson
2016/08/17 15:11:52
Is there a reason why we were testing the class of
scheglov
2016/08/17 15:42:24
You are right that clients should not care, as lon
|
| expect(source.fullName, fooFallbackPath); |
| } |
| test_InSummarySource() { |
| var sourceFactory = new SourceFactory([ |
| - new InSummaryPackageUriResolver(new MockSummaryDataStore.fake({ |
| - 'package:foo/foo.dart': 'foo.sum', |
| - 'package:foo/src/foo_impl.dart': 'foo.sum', |
| - 'package:bar/baz.dart': 'bar.sum', |
| - })) |
| + new InSummaryUriResolver( |
| + PhysicalResourceProvider.INSTANCE, |
| + new MockSummaryDataStore.fake({ |
| + 'package:foo/foo.dart': 'foo.sum', |
| + 'package:foo/src/foo_impl.dart': 'foo.sum', |
| + 'package:bar/baz.dart': 'bar.sum', |
| + })) |
| ]); |
| InSummarySource source = sourceFactory.forUri('package:foo/foo.dart'); |
| - expect(source, isNot(new isInstanceOf<FileBasedSource>())); |
| + expect(source, isNotNull); |
| expect(source.summaryPath, 'foo.sum'); |
| source = sourceFactory.forUri('package:foo/src/foo_impl.dart'); |
| - expect(source, isNot(new isInstanceOf<FileBasedSource>())); |
| + expect(source, isNotNull); |
| expect(source.summaryPath, 'foo.sum'); |
| source = sourceFactory.forUri('package:bar/baz.dart'); |
| - expect(source, isNot(new isInstanceOf<FileBasedSource>())); |
| + expect(source, isNotNull); |
| expect(source.summaryPath, 'bar.sum'); |
| } |
| } |