| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 #import('dart:uri'); | 5 #import('dart:uri'); |
| 6 #import('parser_helper.dart'); | 6 #import('parser_helper.dart'); |
| 7 #import('mock_compiler.dart'); | 7 #import('mock_compiler.dart'); |
| 8 #import("../../../lib/compiler/compiler.dart"); | 8 #import("../../../lib/compiler/compiler.dart"); |
| 9 #import("../../../lib/compiler/implementation/leg.dart", prefix:'leg'); | 9 #import("../../../lib/compiler/implementation/leg.dart", prefix:'leg'); |
| 10 #import("../../../lib/compiler/implementation/dart_backend/dart_backend.dart"); | 10 #import("../../../lib/compiler/implementation/dart_backend/dart_backend.dart"); |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 } | 630 } |
| 631 | 631 |
| 632 testStaticAccessIoLib() { | 632 testStaticAccessIoLib() { |
| 633 var src = ''' | 633 var src = ''' |
| 634 #import('dart:io'); | 634 #import('dart:io'); |
| 635 | 635 |
| 636 main() { | 636 main() { |
| 637 Platform.operatingSystem; | 637 Platform.operatingSystem; |
| 638 } | 638 } |
| 639 '''; | 639 '''; |
| 640 var expectedResult = '#import("dart:io",prefix:"p");' | 640 var expectedResult = 'import "dart:io" as p;' |
| 641 'main(){p.Platform.operatingSystem;}'; | 641 'main(){p.Platform.operatingSystem;}'; |
| 642 testDart2Dart(src, | 642 testDart2Dart(src, |
| 643 (String result) { Expect.equals(expectedResult, result); }); | 643 (String result) { Expect.equals(expectedResult, result); }); |
| 644 } | 644 } |
| 645 | 645 |
| 646 testMinification() { | 646 testMinification() { |
| 647 var src = ''' | 647 var src = ''' |
| 648 class ClassWithVeryVeryLongName {} | 648 class ClassWithVeryVeryLongName {} |
| 649 main() { | 649 main() { |
| 650 new ClassWithVeryVeryLongName(); | 650 new ClassWithVeryVeryLongName(); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 #import('dart:html'); | 760 #import('dart:html'); |
| 761 | 761 |
| 762 class A { | 762 class A { |
| 763 static String get userAgent => window.navigator.userAgent; | 763 static String get userAgent => window.navigator.userAgent; |
| 764 } | 764 } |
| 765 | 765 |
| 766 main() { | 766 main() { |
| 767 A.userAgent; | 767 A.userAgent; |
| 768 } | 768 } |
| 769 '''; | 769 '''; |
| 770 var expectedResult = '#import("dart:html",prefix:"p");' | 770 var expectedResult = 'import "dart:html" as p;' |
| 771 'class A{static String get userAgent=>p.window.navigator.userAgent;}' | 771 'class A{static String get userAgent=>p.window.navigator.userAgent;}' |
| 772 'main(){A.userAgent;}'; | 772 'main(){A.userAgent;}'; |
| 773 testDart2Dart(src, | 773 testDart2Dart(src, |
| 774 (String result) { Expect.equals(expectedResult, result); }); | 774 (String result) { Expect.equals(expectedResult, result); }); |
| 775 } | 775 } |
| 776 | 776 |
| 777 main() { | 777 main() { |
| 778 testSimpleFileUnparse(); | 778 testSimpleFileUnparse(); |
| 779 testTopLevelField(); | 779 testTopLevelField(); |
| 780 testSimpleTopLevelClass(); | 780 testSimpleTopLevelClass(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 801 testInterfaceDefaultAnotherLib(); | 801 testInterfaceDefaultAnotherLib(); |
| 802 testStaticAccessIoLib(); | 802 testStaticAccessIoLib(); |
| 803 testLocalFunctionPlaceholder(); | 803 testLocalFunctionPlaceholder(); |
| 804 testMinification(); | 804 testMinification(); |
| 805 testClosureLocalsMinified(); | 805 testClosureLocalsMinified(); |
| 806 testParametersMinified(); | 806 testParametersMinified(); |
| 807 testTypeVariablesInDifferentLibraries(); | 807 testTypeVariablesInDifferentLibraries(); |
| 808 testDeclarationTypePlaceholders(); | 808 testDeclarationTypePlaceholders(); |
| 809 testPlatformLibraryMemberNamesAreFixed(); | 809 testPlatformLibraryMemberNamesAreFixed(); |
| 810 } | 810 } |
| OLD | NEW |