Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 2ec09f9

Browse files
author
Emmanuel Garcia
committed
offset
1 parent 532808f commit 2ec09f9

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

testing/scenario_app/bin/android_integration_tests.dart

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,8 @@ void main(List<String> args) async {
6161
stdout.writeln('listening on host ${server.address.address}:${server.port}');
6262
server.listen((Socket client) {
6363
stdout.writeln('client connected ${client.remoteAddress.address}:${client.remotePort}');
64-
6564
client.listen((Uint8List data) {
66-
final int fnameLen = data.buffer.asByteData().getInt32(0);
65+
final int fnameLen = data.buffer.asByteData(0, 4).getInt32(0);
6766
final String fileName = utf8.decode(data.buffer.asUint8List(4, fnameLen));
6867
final Uint8List fileContent = data.buffer.asUint8List(4 + fnameLen);
6968
log('host received ${fileContent.lengthInBytes} bytes for screenshot `$fileName`');
@@ -79,11 +78,15 @@ void main(List<String> args) async {
7978
final Future<void> comparison = skiaGoldClient!
8079
.addImg(fileName, goldenFile, screenshotSize: fileContent.lengthInBytes)
8180
.catchError((dynamic err) {
82-
panic(<String>['Skia gold comparison failed: ${err.toString()}']);
81+
panic(<String>['skia gold comparison failed: ${err.toString()}']);
8382
});
8483
pendingComparisons.add(comparison);
8584
}
86-
});
85+
},
86+
onError: (dynamic err) {
87+
panic(<String>['error while receiving bytes: ${err.toString()}']);
88+
},
89+
cancelOnError: true);
8790
});
8891
});
8992

@@ -121,9 +124,9 @@ void main(List<String> args) async {
121124
await step('Skia Gold auth...', () async {
122125
if (isSkiaGoldClientAvailable) {
123126
await skiaGoldClient!.auth();
124-
log('Skia gold client is available');
127+
log('skia gold client is available');
125128
} else {
126-
log('Skia gold client is unavailable');
129+
log('skia gold client is unavailable');
127130
}
128131
});
129132

0 commit comments

Comments
 (0)