Skip to content

Commit 7cf8fe2

Browse files
author
Anna Gringauze
authored
Fix asset handler tests (#1956)
* Validate only needed summaries in expression_compiler_service * Fix incorrectly working asset handler test
1 parent c371ad7 commit 7cf8fe2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

dwds/test/handlers/asset_handler_test.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ void main() {
3131
Future<void> readAsString(String path) async {
3232
final request = Request('GET', Uri.parse('http://foo:0000/$path'));
3333
final response = await context.assetHandler(request);
34+
expect(response.statusCode, 200);
3435
final result = await response.readAsString();
3536
expect(result, isNotNull,
3637
reason: 'Failed to read $path: ${response.statusCode}');
@@ -39,25 +40,24 @@ void main() {
3940
Future<void> readAsBytes(String path) async {
4041
final request = Request('GET', Uri.parse('http://foo:0000/$path'));
4142
final response = await context.assetHandler(request);
43+
expect(response.statusCode, 200);
4244
final result = await response.read().toList();
4345
expect(result, isNotNull,
4446
reason: 'Failed to read $path: ${response.statusCode}');
4547
}
4648

4749
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';
4951
await readAsBytes(path);
5052
});
5153

5254
test('can read large number of resources simultaneously', () async {
5355
final n = 1000;
5456
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'),
5559
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'),
6161
];
6262

6363
await expectLater(Future.wait(futures), completes);

0 commit comments

Comments
 (0)