| OLD | NEW |
| 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 testing.mock_sdk; | 5 library testing.mock_sdk; |
| 6 | 6 |
| 7 import 'package:analyzer/file_system/file_system.dart' as resource; | 7 import 'package:analyzer/file_system/file_system.dart' as resource; |
| 8 import 'package:analyzer/file_system/memory_file_system.dart' as resource; | 8 import 'package:analyzer/file_system/memory_file_system.dart' as resource; |
| 9 import 'package:analyzer/src/context/context.dart'; | 9 import 'package:analyzer/src/context/context.dart'; |
| 10 import 'package:analyzer/src/generated/engine.dart'; | 10 import 'package:analyzer/src/generated/engine.dart'; |
| 11 import 'package:analyzer/src/generated/sdk.dart'; | 11 import 'package:analyzer/src/generated/sdk.dart'; |
| 12 import 'package:analyzer/src/generated/source.dart'; | 12 import 'package:analyzer/src/generated/source.dart'; |
| 13 import 'package:analyzer/src/summary/idl.dart' show PackageBundle; |
| 13 | 14 |
| 14 class MockSdk implements DartSdk { | 15 class MockSdk implements DartSdk { |
| 15 static const _MockSdkLibrary LIB_CORE = const _MockSdkLibrary( | 16 static const _MockSdkLibrary LIB_CORE = const _MockSdkLibrary( |
| 16 'dart:core', | 17 'dart:core', |
| 17 '/lib/core/core.dart', | 18 '/lib/core/core.dart', |
| 18 ''' | 19 ''' |
| 19 library dart.core; | 20 library dart.core; |
| 20 | 21 |
| 21 import 'dart:async'; | 22 import 'dart:async'; |
| 22 import 'dart:_internal'; | 23 import 'dart:_internal'; |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 return file.createSource(dartUri); | 310 return file.createSource(dartUri); |
| 310 } catch (exception) { | 311 } catch (exception) { |
| 311 return null; | 312 return null; |
| 312 } | 313 } |
| 313 } | 314 } |
| 314 } | 315 } |
| 315 return null; | 316 return null; |
| 316 } | 317 } |
| 317 | 318 |
| 318 @override | 319 @override |
| 320 PackageBundle getLinkedBundle() => null; |
| 321 |
| 322 @override |
| 319 SdkLibrary getSdkLibrary(String dartUri) { | 323 SdkLibrary getSdkLibrary(String dartUri) { |
| 320 // getSdkLibrary() is only used to determine whether a library is internal | 324 // getSdkLibrary() is only used to determine whether a library is internal |
| 321 // to the SDK. The mock SDK doesn't have any internals, so it's safe to | 325 // to the SDK. The mock SDK doesn't have any internals, so it's safe to |
| 322 // return null. | 326 // return null. |
| 323 return null; | 327 return null; |
| 324 } | 328 } |
| 325 | 329 |
| 326 @override | 330 @override |
| 327 Source mapDartUri(String dartUri) { | 331 Source mapDartUri(String dartUri) { |
| 328 const Map<String, String> uriToPath = const { | 332 const Map<String, String> uriToPath = const { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 bool get isInternal => shortName.startsWith('dart:_'); | 375 bool get isInternal => shortName.startsWith('dart:_'); |
| 372 | 376 |
| 373 @override | 377 @override |
| 374 bool get isShared => throw unimplemented; | 378 bool get isShared => throw unimplemented; |
| 375 | 379 |
| 376 @override | 380 @override |
| 377 bool get isVmLibrary => throw unimplemented; | 381 bool get isVmLibrary => throw unimplemented; |
| 378 | 382 |
| 379 UnimplementedError get unimplemented => new UnimplementedError(); | 383 UnimplementedError get unimplemented => new UnimplementedError(); |
| 380 } | 384 } |
| OLD | NEW |