OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 dart2js.serialization_test_data; | 5 library dart2js.serialization_test_data; |
6 | 6 |
7 const List<Test> TESTS = const <Test>[ | 7 const List<Test> TESTS = const <Test>[ |
8 // This test is very long-running and put here first to compile it on its own | 8 // These tests are very long-running and put here first to compile them on |
9 // in compilation0_test.dart | 9 // their own tests. |
10 const Test('Disable tree shaking through reflection', const { | 10 const Test('Disable tree shaking through reflection', const { |
11 'main.dart': ''' | 11 'main.dart': ''' |
12 import 'dart:mirrors'; | 12 import 'dart:mirrors'; |
13 | 13 |
14 main() { | 14 main() { |
15 reflect(null).invoke(#toString, []).reflectee; | 15 reflect(null).invoke(#toString, []).reflectee; |
16 } | 16 } |
17 ''', | 17 ''', |
18 }, expectedWarningCount: 1), | 18 }, expectedWarningCount: 1), |
19 | 19 |
| 20 const Test('Use of dart:indexed_db', const { |
| 21 'main.dart': ''' |
| 22 import 'a.dart'; |
| 23 |
| 24 main() {} |
| 25 ''', |
| 26 }, preserializedSourceFiles: const { |
| 27 'a.dart': ''' |
| 28 import 'dart:indexed_db'; |
| 29 ''', |
| 30 }), |
| 31 |
| 32 // These tests |
20 const Test('Empty program', const { | 33 const Test('Empty program', const { |
21 'main.dart': 'main() {}' | 34 'main.dart': 'main() {}' |
22 }), | 35 }), |
23 | 36 |
24 const Test('Hello World', const { | 37 const Test('Hello World', const { |
25 'main.dart': 'main() => print("Hello World");' | 38 'main.dart': 'main() => print("Hello World");' |
26 }), | 39 }), |
27 | 40 |
28 const Test('Too many arguments to print', const { | 41 const Test('Too many arguments to print', const { |
29 'main.dart': 'main() => print("Hello World", 0);' | 42 'main.dart': 'main() => print("Hello World", 0);' |
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 ''', | 637 ''', |
625 }, preserializedSourceFiles: const { | 638 }, preserializedSourceFiles: const { |
626 'a.dart': ''' | 639 'a.dart': ''' |
627 import "dart:core" deferred as core; | 640 import "dart:core" deferred as core; |
628 | 641 |
629 test() { | 642 test() { |
630 core.loadLibrary().then((_) => null); | 643 core.loadLibrary().then((_) => null); |
631 } | 644 } |
632 ''', | 645 ''', |
633 }), | 646 }), |
634 | |
635 const Test('Use of dart:indexed_db', const { | |
636 'main.dart': ''' | |
637 import 'a.dart'; | |
638 | |
639 main() {} | |
640 ''', | |
641 }, preserializedSourceFiles: const { | |
642 'a.dart': ''' | |
643 import 'dart:indexed_db'; | |
644 ''', | |
645 }), | |
646 ]; | 647 ]; |
647 | 648 |
648 class Test { | 649 class Test { |
649 final String name; | 650 final String name; |
650 final Map sourceFiles; | 651 final Map sourceFiles; |
651 final Map preserializedSourceFiles; | 652 final Map preserializedSourceFiles; |
652 final Map unserializedSourceFiles; | 653 final Map unserializedSourceFiles; |
653 final int expectedErrorCount; | 654 final int expectedErrorCount; |
654 final int expectedWarningCount; | 655 final int expectedWarningCount; |
655 final int expectedHintCount; | 656 final int expectedHintCount; |
656 final int expectedInfoCount; | 657 final int expectedInfoCount; |
657 final bool checkedMode; | 658 final bool checkedMode; |
658 | 659 |
659 const Test( | 660 const Test( |
660 this.name, | 661 this.name, |
661 this.sourceFiles, | 662 this.sourceFiles, |
662 {this.preserializedSourceFiles, | 663 {this.preserializedSourceFiles, |
663 this.unserializedSourceFiles, | 664 this.unserializedSourceFiles, |
664 this.expectedErrorCount: 0, | 665 this.expectedErrorCount: 0, |
665 this.expectedWarningCount: 0, | 666 this.expectedWarningCount: 0, |
666 this.expectedHintCount: 0, | 667 this.expectedHintCount: 0, |
667 this.expectedInfoCount: 0, | 668 this.expectedInfoCount: 0, |
668 this.checkedMode: false}); | 669 this.checkedMode: false}); |
669 } | 670 } |
OLD | NEW |