@@ -31,6 +31,7 @@ void main() {
31
31
Future <void > readAsString (String path) async {
32
32
final request = Request ('GET' , Uri .parse ('http://foo:0000/$path ' ));
33
33
final response = await context.assetHandler (request);
34
+ expect (response.statusCode, 200 );
34
35
final result = await response.readAsString ();
35
36
expect (result, isNotNull,
36
37
reason: 'Failed to read $path : ${response .statusCode }' );
@@ -39,25 +40,24 @@ void main() {
39
40
Future <void > readAsBytes (String path) async {
40
41
final request = Request ('GET' , Uri .parse ('http://foo:0000/$path ' ));
41
42
final response = await context.assetHandler (request);
43
+ expect (response.statusCode, 200 );
42
44
final result = await response.read ().toList ();
43
45
expect (result, isNotNull,
44
46
reason: 'Failed to read $path : ${response .statusCode }' );
45
47
}
46
48
47
49
test ('can read dill files' , () async {
48
- final path = 'hello_world/main.unsound. ddc.full.dill' ;
50
+ final path = 'hello_world/main.ddc.full.dill' ;
49
51
await readAsBytes (path);
50
52
});
51
53
52
54
test ('can read large number of resources simultaneously' , () async {
53
55
final n = 1000 ;
54
56
final futures = [
57
+ for (var i = 0 ; i < n; i++ ) readAsString ('hello_world/main.ddc.js.map' ),
58
+ for (var i = 0 ; i < n; i++ ) readAsString ('hello_world/main.ddc.js' ),
55
59
for (var i = 0 ; i < n; i++ )
56
- readAsString ('hello_world/main.unsound.ddc.js.map' ),
57
- for (var i = 0 ; i < n; i++ )
58
- readAsString ('hello_world/main.unsound.ddc.js' ),
59
- for (var i = 0 ; i < n; i++ )
60
- readAsBytes ('hello_world/main.unsound.ddc.full.dill' ),
60
+ readAsBytes ('hello_world/main.ddc.full.dill' ),
61
61
];
62
62
63
63
await expectLater (Future .wait (futures), completes);
0 commit comments