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

Side by Side Diff: test/dependency_graph_test.dart

Issue 986023003: Add dart_core.js (fixes #89) (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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 | « test/codegen/expect/server_mode/html_input.html ('k') | test/test.sh » ('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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 dev_compiler.test.dependency_graph_test; 5 library dev_compiler.test.dependency_graph_test;
6 6
7 import 'package:unittest/compact_vm_config.dart'; 7 import 'package:unittest/compact_vm_config.dart';
8 import 'package:unittest/unittest.dart'; 8 import 'package:unittest/unittest.dart';
9 9
10 import 'package:dev_compiler/src/checker/dart_sdk.dart' 10 import 'package:dev_compiler/src/checker/dart_sdk.dart'
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 }); 548 });
549 }); 549 });
550 550
551 group('refresh structure and marks', () { 551 group('refresh structure and marks', () {
552 test('initial marks', () { 552 test('initial marks', () {
553 var node = nodeOf('/index3.html'); 553 var node = nodeOf('/index3.html');
554 expectGraph(node, ''' 554 expectGraph(node, '''
555 index3.html 555 index3.html
556 |-- harmony_feature_check.js 556 |-- harmony_feature_check.js
557 |-- dart_runtime.js 557 |-- dart_runtime.js
558 |-- dart_core.js
558 '''); 559 ''');
559 refreshStructureAndMarks(node, graph); 560 refreshStructureAndMarks(node, graph);
560 expectGraph(node, ''' 561 expectGraph(node, '''
561 index3.html [needs-rebuild] [structure-changed] 562 index3.html [needs-rebuild] [structure-changed]
562 |-- a2.dart [needs-rebuild] [structure-changed] 563 |-- a2.dart [needs-rebuild] [structure-changed]
563 | |-- a3.dart [needs-rebuild] 564 | |-- a3.dart [needs-rebuild]
564 | |-- a4.dart [needs-rebuild] [structure-changed] 565 | |-- a4.dart [needs-rebuild] [structure-changed]
565 | | |-- a10.dart [needs-rebuild] 566 | | |-- a10.dart [needs-rebuild]
566 | |-- a5.dart [needs-rebuild] 567 | |-- a5.dart [needs-rebuild]
567 | |-- a6.dart (part) [needs-rebuild] 568 | |-- a6.dart (part) [needs-rebuild]
568 |-- harmony_feature_check.js [needs-rebuild] 569 |-- harmony_feature_check.js [needs-rebuild]
569 |-- dart_runtime.js [needs-rebuild] 570 |-- dart_runtime.js [needs-rebuild]
571 |-- dart_core.js [needs-rebuild]
570 '''); 572 ''');
571 }); 573 });
572 574
573 test('cleared marks stay clear', () { 575 test('cleared marks stay clear', () {
574 var node = nodeOf('/index3.html'); 576 var node = nodeOf('/index3.html');
575 refreshStructureAndMarks(node, graph); 577 refreshStructureAndMarks(node, graph);
576 expectGraph(node, ''' 578 expectGraph(node, '''
577 index3.html [needs-rebuild] [structure-changed] 579 index3.html [needs-rebuild] [structure-changed]
578 |-- a2.dart [needs-rebuild] [structure-changed] 580 |-- a2.dart [needs-rebuild] [structure-changed]
579 | |-- a3.dart [needs-rebuild] 581 | |-- a3.dart [needs-rebuild]
580 | |-- a4.dart [needs-rebuild] [structure-changed] 582 | |-- a4.dart [needs-rebuild] [structure-changed]
581 | | |-- a10.dart [needs-rebuild] 583 | | |-- a10.dart [needs-rebuild]
582 | |-- a5.dart [needs-rebuild] 584 | |-- a5.dart [needs-rebuild]
583 | |-- a6.dart (part) [needs-rebuild] 585 | |-- a6.dart (part) [needs-rebuild]
584 |-- harmony_feature_check.js [needs-rebuild] 586 |-- harmony_feature_check.js [needs-rebuild]
585 |-- dart_runtime.js [needs-rebuild] 587 |-- dart_runtime.js [needs-rebuild]
588 |-- dart_core.js [needs-rebuild]
586 '''); 589 ''');
587 clearMarks(node); 590 clearMarks(node);
588 expectGraph(node, ''' 591 expectGraph(node, '''
589 index3.html 592 index3.html
590 |-- a2.dart 593 |-- a2.dart
591 | |-- a3.dart 594 | |-- a3.dart
592 | |-- a4.dart 595 | |-- a4.dart
593 | | |-- a10.dart 596 | | |-- a10.dart
594 | |-- a5.dart 597 | |-- a5.dart
595 | |-- a6.dart (part) 598 | |-- a6.dart (part)
596 |-- harmony_feature_check.js 599 |-- harmony_feature_check.js
597 |-- dart_runtime.js 600 |-- dart_runtime.js
601 |-- dart_core.js
598 '''); 602 ''');
599 603
600 refreshStructureAndMarks(node, graph); 604 refreshStructureAndMarks(node, graph);
601 expectGraph(node, ''' 605 expectGraph(node, '''
602 index3.html 606 index3.html
603 |-- a2.dart 607 |-- a2.dart
604 | |-- a3.dart 608 | |-- a3.dart
605 | |-- a4.dart 609 | |-- a4.dart
606 | | |-- a10.dart 610 | | |-- a10.dart
607 | |-- a5.dart 611 | |-- a5.dart
608 | |-- a6.dart (part) 612 | |-- a6.dart (part)
609 |-- harmony_feature_check.js 613 |-- harmony_feature_check.js
610 |-- dart_runtime.js 614 |-- dart_runtime.js
615 |-- dart_core.js
611 '''); 616 ''');
612 }); 617 });
613 618
614 test('needsRebuild mark updated on local modifications', () { 619 test('needsRebuild mark updated on local modifications', () {
615 var node = nodeOf('/index3.html'); 620 var node = nodeOf('/index3.html');
616 refreshStructureAndMarks(node, graph); 621 refreshStructureAndMarks(node, graph);
617 clearMarks(node); 622 clearMarks(node);
618 var a3 = nodeOf('/a3.dart'); 623 var a3 = nodeOf('/a3.dart');
619 a3.source.contents.modificationTime++; 624 a3.source.contents.modificationTime++;
620 625
621 refreshStructureAndMarks(node, graph); 626 refreshStructureAndMarks(node, graph);
622 expectGraph(node, ''' 627 expectGraph(node, '''
623 index3.html 628 index3.html
624 |-- a2.dart 629 |-- a2.dart
625 | |-- a3.dart [needs-rebuild] 630 | |-- a3.dart [needs-rebuild]
626 | |-- a4.dart 631 | |-- a4.dart
627 | | |-- a10.dart 632 | | |-- a10.dart
628 | |-- a5.dart 633 | |-- a5.dart
629 | |-- a6.dart (part) 634 | |-- a6.dart (part)
630 |-- harmony_feature_check.js 635 |-- harmony_feature_check.js
631 |-- dart_runtime.js 636 |-- dart_runtime.js
637 |-- dart_core.js
632 '''); 638 ''');
633 }); 639 });
634 640
635 test('structuredChanged mark updated on structure modifications', () { 641 test('structuredChanged mark updated on structure modifications', () {
636 var node = nodeOf('/index3.html'); 642 var node = nodeOf('/index3.html');
637 refreshStructureAndMarks(node, graph); 643 refreshStructureAndMarks(node, graph);
638 clearMarks(node); 644 clearMarks(node);
639 var a5 = nodeOf('/a5.dart'); 645 var a5 = nodeOf('/a5.dart');
640 a5.source.contents.modificationTime++; 646 a5.source.contents.modificationTime++;
641 a5.source.contents.data = 'import "a8.dart";'; 647 a5.source.contents.data = 'import "a8.dart";';
642 648
643 refreshStructureAndMarks(node, graph); 649 refreshStructureAndMarks(node, graph);
644 expectGraph(node, ''' 650 expectGraph(node, '''
645 index3.html 651 index3.html
646 |-- a2.dart 652 |-- a2.dart
647 | |-- a3.dart 653 | |-- a3.dart
648 | |-- a4.dart 654 | |-- a4.dart
649 | | |-- a10.dart 655 | | |-- a10.dart
650 | |-- a5.dart [needs-rebuild] [structure-changed] 656 | |-- a5.dart [needs-rebuild] [structure-changed]
651 | | |-- a8.dart [needs-rebuild] [structure-changed] 657 | | |-- a8.dart [needs-rebuild] [structure-changed]
652 | | | |-- a8.dart... 658 | | | |-- a8.dart...
653 | |-- a6.dart (part) 659 | |-- a6.dart (part)
654 |-- harmony_feature_check.js 660 |-- harmony_feature_check.js
655 |-- dart_runtime.js 661 |-- dart_runtime.js
662 |-- dart_core.js
656 '''); 663 ''');
657 }); 664 });
658 }); 665 });
659 666
660 group('sever-mode', () { 667 group('sever-mode', () {
vsm 2015/03/11 01:23:00 server-mode :-)
Siggi Cherem (dart-lang) 2015/03/11 01:33:03 :)
661 setUp(() { 668 setUp(() {
662 var options2 = new CompilerOptions(serverMode: true); 669 var options2 = new CompilerOptions(serverMode: true);
663 context = new TypeResolver.fromMock(mockSdkSources, options2, 670 context = new TypeResolver.fromMock(mockSdkSources, options2,
664 otherResolvers: [testUriResolver]).context; 671 otherResolvers: [testUriResolver]).context;
665 graph = new SourceGraph(context, new LogReporter(), options2); 672 graph = new SourceGraph(context, new LogReporter(), options2);
666 }); 673 });
667 674
668 test('messages widget is automatically included', () { 675 test('messages widget is automatically included', () {
669 var node = nodeOf('/index3.html'); 676 var node = nodeOf('/index3.html');
670 expectGraph(node, ''' 677 expectGraph(node, '''
671 index3.html 678 index3.html
672 |-- harmony_feature_check.js 679 |-- harmony_feature_check.js
673 |-- dart_runtime.js 680 |-- dart_runtime.js
681 |-- dart_core.js
674 |-- messages_widget.js 682 |-- messages_widget.js
675 |-- messages.css 683 |-- messages.css
676 '''); 684 ''');
677 refreshStructureAndMarks(node, graph); 685 refreshStructureAndMarks(node, graph);
678 expectGraph(node, ''' 686 expectGraph(node, '''
679 index3.html [needs-rebuild] [structure-changed] 687 index3.html [needs-rebuild] [structure-changed]
680 |-- a2.dart [needs-rebuild] [structure-changed] 688 |-- a2.dart [needs-rebuild] [structure-changed]
681 | |-- a3.dart [needs-rebuild] 689 | |-- a3.dart [needs-rebuild]
682 | |-- a4.dart [needs-rebuild] [structure-changed] 690 | |-- a4.dart [needs-rebuild] [structure-changed]
683 | | |-- a10.dart [needs-rebuild] 691 | | |-- a10.dart [needs-rebuild]
684 | |-- a5.dart [needs-rebuild] 692 | |-- a5.dart [needs-rebuild]
685 | |-- a6.dart (part) [needs-rebuild] 693 | |-- a6.dart (part) [needs-rebuild]
686 |-- harmony_feature_check.js [needs-rebuild] 694 |-- harmony_feature_check.js [needs-rebuild]
687 |-- dart_runtime.js [needs-rebuild] 695 |-- dart_runtime.js [needs-rebuild]
696 |-- dart_core.js [needs-rebuild]
688 |-- messages_widget.js [needs-rebuild] 697 |-- messages_widget.js [needs-rebuild]
689 |-- messages.css [needs-rebuild] 698 |-- messages.css [needs-rebuild]
690 '''); 699 ''');
691 }); 700 });
692 }); 701 });
693 702
694 group('rebuild', () { 703 group('rebuild', () {
695 var results; 704 var results;
696 void addName(SourceNode n) => results.add(nameFor(n)); 705 void addName(SourceNode n) => results.add(nameFor(n));
697 706
(...skipping 16 matching lines...) Expand all
714 rebuild(node, graph, buildNoTransitiveChange); 723 rebuild(node, graph, buildNoTransitiveChange);
715 // Note: a6.dart is not included because it built as part of a2.dart 724 // Note: a6.dart is not included because it built as part of a2.dart
716 expect(results, [ 725 expect(results, [
717 'a3.dart', 726 'a3.dart',
718 'a10.dart', 727 'a10.dart',
719 'a4.dart', 728 'a4.dart',
720 'a5.dart', 729 'a5.dart',
721 'a2.dart', 730 'a2.dart',
722 'harmony_feature_check.js', 731 'harmony_feature_check.js',
723 'dart_runtime.js', 732 'dart_runtime.js',
733 'dart_core.js',
724 'index3.html', 734 'index3.html',
725 ]); 735 ]);
726 736
727 // Marks are removed automatically by rebuild 737 // Marks are removed automatically by rebuild
728 expectGraph(node, ''' 738 expectGraph(node, '''
729 index3.html 739 index3.html
730 |-- a2.dart 740 |-- a2.dart
731 | |-- a3.dart 741 | |-- a3.dart
732 | |-- a4.dart 742 | |-- a4.dart
733 | | |-- a10.dart 743 | | |-- a10.dart
734 | |-- a5.dart 744 | |-- a5.dart
735 | |-- a6.dart (part) 745 | |-- a6.dart (part)
736 |-- harmony_feature_check.js 746 |-- harmony_feature_check.js
737 |-- dart_runtime.js 747 |-- dart_runtime.js
748 |-- dart_core.js
738 '''); 749 ''');
739 }); 750 });
740 751
741 test('nothing to do after build', () { 752 test('nothing to do after build', () {
742 var node = nodeOf('/index3.html'); 753 var node = nodeOf('/index3.html');
743 rebuild(node, graph, buildNoTransitiveChange); 754 rebuild(node, graph, buildNoTransitiveChange);
744 755
745 results = []; 756 results = [];
746 rebuild(node, graph, buildNoTransitiveChange); 757 rebuild(node, graph, buildNoTransitiveChange);
747 expect(results, []); 758 expect(results, []);
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 expectGraph(node, ''' 891 expectGraph(node, '''
881 index3.html 892 index3.html
882 |-- a2.dart 893 |-- a2.dart
883 | |-- a3.dart 894 | |-- a3.dart
884 | |-- a4.dart 895 | |-- a4.dart
885 | | |-- a10.dart 896 | | |-- a10.dart
886 | |-- a5.dart 897 | |-- a5.dart
887 | |-- a6.dart (part) 898 | |-- a6.dart (part)
888 |-- harmony_feature_check.js 899 |-- harmony_feature_check.js
889 |-- dart_runtime.js 900 |-- dart_runtime.js
901 |-- dart_core.js
890 '''); 902 ''');
891 903
892 // Modify the file first: 904 // Modify the file first:
893 a6.source.contents.modificationTime++; 905 a6.source.contents.modificationTime++;
894 a6.source.contents.data = 'library a6; import "a5.dart";'; 906 a6.source.contents.data = 'library a6; import "a5.dart";';
895 results = []; 907 results = [];
896 rebuild(node, graph, buildNoTransitiveChange); 908 rebuild(node, graph, buildNoTransitiveChange);
897 909
898 // Looks to us like a change in a part, we'll report errors that the 910 // Looks to us like a change in a part, we'll report errors that the
899 // part is not really a part-file. Note that a6.dart is not included 911 // part is not really a part-file. Note that a6.dart is not included
900 // below, because we don't build it as a library. 912 // below, because we don't build it as a library.
901 expect(results, ['a2.dart']); 913 expect(results, ['a2.dart']);
902 expectGraph(node, ''' 914 expectGraph(node, '''
903 index3.html 915 index3.html
904 |-- a2.dart 916 |-- a2.dart
905 | |-- a3.dart 917 | |-- a3.dart
906 | |-- a4.dart 918 | |-- a4.dart
907 | | |-- a10.dart 919 | | |-- a10.dart
908 | |-- a5.dart 920 | |-- a5.dart
909 | |-- a6.dart (part) 921 | |-- a6.dart (part)
910 |-- harmony_feature_check.js 922 |-- harmony_feature_check.js
911 |-- dart_runtime.js 923 |-- dart_runtime.js
924 |-- dart_core.js
912 '''); 925 ''');
913 926
914 a2.source.contents.modificationTime++; 927 a2.source.contents.modificationTime++;
915 a2.source.contents.data = ''' 928 a2.source.contents.data = '''
916 library a2; 929 library a2;
917 import 'a3.dart'; 930 import 'a3.dart';
918 import 'a4.dart'; 931 import 'a4.dart';
919 import 'a6.dart'; // properly import it 932 import 'a6.dart'; // properly import it
920 export 'a5.dart'; 933 export 'a5.dart';
921 '''; 934 ''';
(...skipping 12 matching lines...) Expand all
934 index3.html 947 index3.html
935 |-- a2.dart 948 |-- a2.dart
936 | |-- a3.dart 949 | |-- a3.dart
937 | |-- a4.dart 950 | |-- a4.dart
938 | | |-- a10.dart 951 | | |-- a10.dart
939 | |-- a6.dart 952 | |-- a6.dart
940 | | |-- a5.dart 953 | | |-- a5.dart
941 | |-- a5.dart... 954 | |-- a5.dart...
942 |-- harmony_feature_check.js 955 |-- harmony_feature_check.js
943 |-- dart_runtime.js 956 |-- dart_runtime.js
957 |-- dart_core.js
944 '''); 958 ''');
945 }); 959 });
946 960
947 test('convert part to a library after updating the import', () { 961 test('convert part to a library after updating the import', () {
948 var node = nodeOf('/index3.html'); 962 var node = nodeOf('/index3.html');
949 var a2 = nodeOf('/a2.dart'); 963 var a2 = nodeOf('/a2.dart');
950 var a6 = nodeOf('/a6.dart'); 964 var a6 = nodeOf('/a6.dart');
951 rebuild(node, graph, buildNoTransitiveChange); 965 rebuild(node, graph, buildNoTransitiveChange);
952 966
953 expectGraph(node, ''' 967 expectGraph(node, '''
954 index3.html 968 index3.html
955 |-- a2.dart 969 |-- a2.dart
956 | |-- a3.dart 970 | |-- a3.dart
957 | |-- a4.dart 971 | |-- a4.dart
958 | | |-- a10.dart 972 | | |-- a10.dart
959 | |-- a5.dart 973 | |-- a5.dart
960 | |-- a6.dart (part) 974 | |-- a6.dart (part)
961 |-- harmony_feature_check.js 975 |-- harmony_feature_check.js
962 |-- dart_runtime.js 976 |-- dart_runtime.js
977 |-- dart_core.js
963 '''); 978 ''');
964 979
965 a2.source.contents.modificationTime++; 980 a2.source.contents.modificationTime++;
966 a2.source.contents.data = ''' 981 a2.source.contents.data = '''
967 library a2; 982 library a2;
968 import 'a3.dart'; 983 import 'a3.dart';
969 import 'a4.dart'; 984 import 'a4.dart';
970 import 'a6.dart'; // properly import it 985 import 'a6.dart'; // properly import it
971 export 'a5.dart'; 986 export 'a5.dart';
972 '''; 987 ''';
973 results = []; 988 results = [];
974 rebuild(node, graph, buildNoTransitiveChange); 989 rebuild(node, graph, buildNoTransitiveChange);
975 expect(results, ['a6.dart', 'a2.dart', 'index3.html']); 990 expect(results, ['a6.dart', 'a2.dart', 'index3.html']);
976 expectGraph(node, ''' 991 expectGraph(node, '''
977 index3.html 992 index3.html
978 |-- a2.dart 993 |-- a2.dart
979 | |-- a3.dart 994 | |-- a3.dart
980 | |-- a4.dart 995 | |-- a4.dart
981 | | |-- a10.dart 996 | | |-- a10.dart
982 | |-- a6.dart 997 | |-- a6.dart
983 | |-- a5.dart 998 | |-- a5.dart
984 |-- harmony_feature_check.js 999 |-- harmony_feature_check.js
985 |-- dart_runtime.js 1000 |-- dart_runtime.js
1001 |-- dart_core.js
986 '''); 1002 ''');
987 1003
988 a6.source.contents.modificationTime++; 1004 a6.source.contents.modificationTime++;
989 a6.source.contents.data = 'library a6; import "a5.dart";'; 1005 a6.source.contents.data = 'library a6; import "a5.dart";';
990 results = []; 1006 results = [];
991 rebuild(node, graph, buildNoTransitiveChange); 1007 rebuild(node, graph, buildNoTransitiveChange);
992 expect(results, ['a6.dart', 'index3.html']); 1008 expect(results, ['a6.dart', 'index3.html']);
993 expectGraph(node, ''' 1009 expectGraph(node, '''
994 index3.html 1010 index3.html
995 |-- a2.dart 1011 |-- a2.dart
996 | |-- a3.dart 1012 | |-- a3.dart
997 | |-- a4.dart 1013 | |-- a4.dart
998 | | |-- a10.dart 1014 | | |-- a10.dart
999 | |-- a6.dart 1015 | |-- a6.dart
1000 | | |-- a5.dart 1016 | | |-- a5.dart
1001 | |-- a5.dart... 1017 | |-- a5.dart...
1002 |-- harmony_feature_check.js 1018 |-- harmony_feature_check.js
1003 |-- dart_runtime.js 1019 |-- dart_runtime.js
1020 |-- dart_core.js
1004 '''); 1021 ''');
1005 }); 1022 });
1006 1023
1007 test('disconnect part making it a library', () { 1024 test('disconnect part making it a library', () {
1008 var node = nodeOf('/index3.html'); 1025 var node = nodeOf('/index3.html');
1009 var a2 = nodeOf('/a2.dart'); 1026 var a2 = nodeOf('/a2.dart');
1010 var a6 = nodeOf('/a6.dart'); 1027 var a6 = nodeOf('/a6.dart');
1011 rebuild(node, graph, buildNoTransitiveChange); 1028 rebuild(node, graph, buildNoTransitiveChange);
1012 1029
1013 expectGraph(node, ''' 1030 expectGraph(node, '''
1014 index3.html 1031 index3.html
1015 |-- a2.dart 1032 |-- a2.dart
1016 | |-- a3.dart 1033 | |-- a3.dart
1017 | |-- a4.dart 1034 | |-- a4.dart
1018 | | |-- a10.dart 1035 | | |-- a10.dart
1019 | |-- a5.dart 1036 | |-- a5.dart
1020 | |-- a6.dart (part) 1037 | |-- a6.dart (part)
1021 |-- harmony_feature_check.js 1038 |-- harmony_feature_check.js
1022 |-- dart_runtime.js 1039 |-- dart_runtime.js
1040 |-- dart_core.js
1023 '''); 1041 ''');
1024 1042
1025 a2.source.contents.modificationTime++; 1043 a2.source.contents.modificationTime++;
1026 a2.source.contents.data = ''' 1044 a2.source.contents.data = '''
1027 library a2; 1045 library a2;
1028 import 'a3.dart'; 1046 import 'a3.dart';
1029 import 'a4.dart'; 1047 import 'a4.dart';
1030 export 'a5.dart'; 1048 export 'a5.dart';
1031 '''; 1049 ''';
1032 a6.source.contents.modificationTime++; 1050 a6.source.contents.modificationTime++;
1033 a6.source.contents.data = 'library a6; import "a5.dart";'; 1051 a6.source.contents.data = 'library a6; import "a5.dart";';
1034 results = []; 1052 results = [];
1035 rebuild(node, graph, buildNoTransitiveChange); 1053 rebuild(node, graph, buildNoTransitiveChange);
1036 // a6 is not here, it's not reachable so we don't build it. 1054 // a6 is not here, it's not reachable so we don't build it.
1037 expect(results, ['a2.dart', 'index3.html']); 1055 expect(results, ['a2.dart', 'index3.html']);
1038 expectGraph(node, ''' 1056 expectGraph(node, '''
1039 index3.html 1057 index3.html
1040 |-- a2.dart 1058 |-- a2.dart
1041 | |-- a3.dart 1059 | |-- a3.dart
1042 | |-- a4.dart 1060 | |-- a4.dart
1043 | | |-- a10.dart 1061 | | |-- a10.dart
1044 | |-- a5.dart 1062 | |-- a5.dart
1045 |-- harmony_feature_check.js 1063 |-- harmony_feature_check.js
1046 |-- dart_runtime.js 1064 |-- dart_runtime.js
1065 |-- dart_core.js
1047 '''); 1066 ''');
1048 }); 1067 });
1049 1068
1050 test('convert a library to a part', () { 1069 test('convert a library to a part', () {
1051 var node = nodeOf('/index3.html'); 1070 var node = nodeOf('/index3.html');
1052 var a2 = nodeOf('/a2.dart'); 1071 var a2 = nodeOf('/a2.dart');
1053 var a5 = nodeOf('/a5.dart'); 1072 var a5 = nodeOf('/a5.dart');
1054 rebuild(node, graph, buildNoTransitiveChange); 1073 rebuild(node, graph, buildNoTransitiveChange);
1055 1074
1056 expectGraph(node, ''' 1075 expectGraph(node, '''
1057 index3.html 1076 index3.html
1058 |-- a2.dart 1077 |-- a2.dart
1059 | |-- a3.dart 1078 | |-- a3.dart
1060 | |-- a4.dart 1079 | |-- a4.dart
1061 | | |-- a10.dart 1080 | | |-- a10.dart
1062 | |-- a5.dart 1081 | |-- a5.dart
1063 | |-- a6.dart (part) 1082 | |-- a6.dart (part)
1064 |-- harmony_feature_check.js 1083 |-- harmony_feature_check.js
1065 |-- dart_runtime.js 1084 |-- dart_runtime.js
1085 |-- dart_core.js
1066 '''); 1086 ''');
1067 1087
1068 a2.source.contents.modificationTime++; 1088 a2.source.contents.modificationTime++;
1069 a2.source.contents.data = ''' 1089 a2.source.contents.data = '''
1070 library a2; 1090 library a2;
1071 import 'a3.dart'; 1091 import 'a3.dart';
1072 import 'a4.dart'; 1092 import 'a4.dart';
1073 part 'a5.dart'; // make it a part 1093 part 'a5.dart'; // make it a part
1074 part 'a6.dart'; 1094 part 'a6.dart';
1075 '''; 1095 ''';
1076 results = []; 1096 results = [];
1077 rebuild(node, graph, buildNoTransitiveChange); 1097 rebuild(node, graph, buildNoTransitiveChange);
1078 expect(results, ['a2.dart', 'index3.html']); 1098 expect(results, ['a2.dart', 'index3.html']);
1079 expectGraph(node, ''' 1099 expectGraph(node, '''
1080 index3.html 1100 index3.html
1081 |-- a2.dart 1101 |-- a2.dart
1082 | |-- a3.dart 1102 | |-- a3.dart
1083 | |-- a4.dart 1103 | |-- a4.dart
1084 | | |-- a10.dart 1104 | | |-- a10.dart
1085 | |-- a5.dart (part) 1105 | |-- a5.dart (part)
1086 | |-- a6.dart (part) 1106 | |-- a6.dart (part)
1087 |-- harmony_feature_check.js 1107 |-- harmony_feature_check.js
1088 |-- dart_runtime.js 1108 |-- dart_runtime.js
1109 |-- dart_core.js
1089 '''); 1110 ''');
1090 1111
1091 a5.source.contents.modificationTime++; 1112 a5.source.contents.modificationTime++;
1092 a5.source.contents.data = 'part of a2;'; 1113 a5.source.contents.data = 'part of a2;';
1093 results = []; 1114 results = [];
1094 rebuild(node, graph, buildNoTransitiveChange); 1115 rebuild(node, graph, buildNoTransitiveChange);
1095 expect(results, ['a2.dart']); 1116 expect(results, ['a2.dart']);
1096 expectGraph(node, ''' 1117 expectGraph(node, '''
1097 index3.html 1118 index3.html
1098 |-- a2.dart 1119 |-- a2.dart
1099 | |-- a3.dart 1120 | |-- a3.dart
1100 | |-- a4.dart 1121 | |-- a4.dart
1101 | | |-- a10.dart 1122 | | |-- a10.dart
1102 | |-- a5.dart (part) 1123 | |-- a5.dart (part)
1103 | |-- a6.dart (part) 1124 | |-- a6.dart (part)
1104 |-- harmony_feature_check.js 1125 |-- harmony_feature_check.js
1105 |-- dart_runtime.js 1126 |-- dart_runtime.js
1127 |-- dart_core.js
1106 '''); 1128 ''');
1107 }); 1129 });
1108 }); 1130 });
1109 }); 1131 });
1110 } 1132 }
1111 1133
1112 expectGraph(SourceNode node, String expectation) { 1134 expectGraph(SourceNode node, String expectation) {
1113 expect(printReachable(node), equalsIgnoringWhitespace(expectation)); 1135 expect(printReachable(node), equalsIgnoringWhitespace(expectation));
1114 } 1136 }
1115 1137
(...skipping 30 matching lines...) Expand all
1146 ..write(e.structureChanged ? '[structure-changed] ' : ' ') 1168 ..write(e.structureChanged ? '[structure-changed] ' : ' ')
1147 ..write('\n'); 1169 ..write('\n');
1148 }); 1170 });
1149 } 1171 }
1150 } 1172 }
1151 helper(node); 1173 helper(node);
1152 return sb.toString(); 1174 return sb.toString();
1153 } 1175 }
1154 1176
1155 bool _same(Set a, Set b) => a.length == b.length && a.containsAll(b); 1177 bool _same(Set a, Set b) => a.length == b.length && a.containsAll(b);
OLDNEW
« no previous file with comments | « test/codegen/expect/server_mode/html_input.html ('k') | test/test.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698