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 const Test('Empty program', const { | 8 const Test('Empty program', const { |
9 'main.dart': 'main() {}' | 9 'main.dart': 'main() {}' |
10 }), | 10 }), |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 } | 447 } |
448 ''', | 448 ''', |
449 }, preserializedSourceFiles: const { | 449 }, preserializedSourceFiles: const { |
450 'a.dart': ''' | 450 'a.dart': ''' |
451 class A { | 451 class A { |
452 final field1; | 452 final field1; |
453 const A(a) : this.field1 = a + 1.0; | 453 const A(a) : this.field1 = a + 1.0; |
454 } | 454 } |
455 ''', | 455 ''', |
456 }), | 456 }), |
| 457 |
| 458 const Test('Deferred prefix loadLibrary', const { |
| 459 'main.dart': ''' |
| 460 import 'a.dart'; |
| 461 |
| 462 main() { |
| 463 test(); |
| 464 } |
| 465 ''', |
| 466 }, preserializedSourceFiles: const { |
| 467 'a.dart': ''' |
| 468 import 'b.dart' deferred as pre; |
| 469 test() { |
| 470 pre.loadLibrary(); |
| 471 } |
| 472 ''', |
| 473 'b.dart': ''' |
| 474 ''', |
| 475 }), |
457 ]; | 476 ]; |
458 | 477 |
459 class Test { | 478 class Test { |
460 final String name; | 479 final String name; |
461 final Map sourceFiles; | 480 final Map sourceFiles; |
462 final Map preserializedSourceFiles; | 481 final Map preserializedSourceFiles; |
463 final Map unserializedSourceFiles; | 482 final Map unserializedSourceFiles; |
464 final int expectedErrorCount; | 483 final int expectedErrorCount; |
465 final int expectedWarningCount; | 484 final int expectedWarningCount; |
466 final int expectedHintCount; | 485 final int expectedHintCount; |
467 final int expectedInfoCount; | 486 final int expectedInfoCount; |
468 | 487 |
469 const Test( | 488 const Test( |
470 this.name, | 489 this.name, |
471 this.sourceFiles, | 490 this.sourceFiles, |
472 {this.preserializedSourceFiles, | 491 {this.preserializedSourceFiles, |
473 this.unserializedSourceFiles, | 492 this.unserializedSourceFiles, |
474 this.expectedErrorCount: 0, | 493 this.expectedErrorCount: 0, |
475 this.expectedWarningCount: 0, | 494 this.expectedWarningCount: 0, |
476 this.expectedHintCount: 0, | 495 this.expectedHintCount: 0, |
477 this.expectedInfoCount: 0}); | 496 this.expectedInfoCount: 0}); |
478 } | 497 } |
OLD | NEW |