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

Side by Side Diff: pkg/analyzer/test/generated/all_the_rest_test.dart

Issue 1691603002: Get rid of redundant MockSdk. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Remove strong mode's copy of mock SDK. Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/sdk.dart ('k') | pkg/analyzer/test/src/context/mock_sdk.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.test.generated.all_the_rest_test; 5 library analyzer.test.generated.all_the_rest_test;
6 6
7 import 'package:analyzer/dart/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/element/element.dart'; 8 import 'package:analyzer/dart/element/element.dart';
9 import 'package:analyzer/dart/element/type.dart'; 9 import 'package:analyzer/dart/element/type.dart';
10 import 'package:analyzer/file_system/physical_file_system.dart'; 10 import 'package:analyzer/file_system/physical_file_system.dart';
(...skipping 3933 matching lines...) Expand 10 before | Expand all | Expand 10 after
3944 Source source = resolver.resolveAbsolute(uri); 3944 Source source = resolver.resolveAbsolute(uri);
3945 expect(source, isNotNull); 3945 expect(source, isNotNull);
3946 expect(resolver.restoreAbsolute(source), uri); 3946 expect(resolver.restoreAbsolute(source), uri);
3947 expect( 3947 expect(
3948 resolver.restoreAbsolute( 3948 resolver.restoreAbsolute(
3949 new NonExistingSource(source.fullName, null, null)), 3949 new NonExistingSource(source.fullName, null, null)),
3950 uri); 3950 uri);
3951 } 3951 }
3952 } 3952 }
3953 3953
3954 /**
3955 * Instances of the class `MockDartSdk` implement a [DartSdk].
3956 */
3957 class MockDartSdk implements DartSdk {
3958 @override
3959 AnalysisContext get context => null;
3960
3961 @override
3962 List<SdkLibrary> get sdkLibraries => null;
3963
3964 @override
3965 String get sdkVersion => null;
3966
3967 @override
3968 List<String> get uris => null;
3969
3970 @override
3971 Source fromFileUri(Uri uri) => null;
3972
3973 @override
3974 SdkLibrary getSdkLibrary(String dartUri) => null;
3975
3976 @override
3977 Source mapDartUri(String dartUri) => null;
3978 }
3979
3980 @reflectiveTest 3954 @reflectiveTest
3981 class SDKLibrariesReaderTest extends EngineTestCase { 3955 class SDKLibrariesReaderTest extends EngineTestCase {
3982 void test_readFrom_dart2js() { 3956 void test_readFrom_dart2js() {
3983 LibraryMap libraryMap = new SdkLibrariesReader(true).readFromFile( 3957 LibraryMap libraryMap = new SdkLibrariesReader(true).readFromFile(
3984 FileUtilities2.createFile("/libs.dart"), 3958 FileUtilities2.createFile("/libs.dart"),
3985 r''' 3959 r'''
3986 final Map<String, LibraryInfo> LIBRARIES = const <String, LibraryInfo> { 3960 final Map<String, LibraryInfo> LIBRARIES = const <String, LibraryInfo> {
3987 'first' : const LibraryInfo( 3961 'first' : const LibraryInfo(
3988 'first/first.dart', 3962 'first/first.dart',
3989 categories: 'Client', 3963 categories: 'Client',
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
4060 expect(UriKind.fromEncoding(0x70), same(UriKind.PACKAGE_URI)); 4034 expect(UriKind.fromEncoding(0x70), same(UriKind.PACKAGE_URI));
4061 expect(UriKind.fromEncoding(0x58), same(null)); 4035 expect(UriKind.fromEncoding(0x58), same(null));
4062 } 4036 }
4063 4037
4064 void test_getEncoding() { 4038 void test_getEncoding() {
4065 expect(UriKind.DART_URI.encoding, 0x64); 4039 expect(UriKind.DART_URI.encoding, 0x64);
4066 expect(UriKind.FILE_URI.encoding, 0x66); 4040 expect(UriKind.FILE_URI.encoding, 0x66);
4067 expect(UriKind.PACKAGE_URI.encoding, 0x70); 4041 expect(UriKind.PACKAGE_URI.encoding, 0x70);
4068 } 4042 }
4069 } 4043 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/sdk.dart ('k') | pkg/analyzer/test/src/context/mock_sdk.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698