Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix the test.
  • Loading branch information
matanlurey committed Feb 2, 2024
commit c93d68e8afd9d6e055b9830d185deaef594c5cad
3 changes: 3 additions & 0 deletions testing/scenario_app/bin/android_integration_tests.dart
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ Future<void> _run({
if (exitCode != 0) {
panic(<String>['instrumented tests failed to run']);
}
// Unfortunately adb shell am instrument does not return a non-zero exit
// code when tests fail, but it does seem to print "FAILURES!!!" to
// stdout, so we can use that as a signal that something went wrong.
if (out.toString().contains('FAILURES!!!')) {
stdout.write(out);
panic(<String>['1 or more tests failed']);
Expand Down
15 changes: 10 additions & 5 deletions testing/scenario_app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,19 @@ void main() {
channelBuffers.setListener('driver', _handleDriverMessage);
channelBuffers.setListener('write_timeline', _handleWriteTimelineMessage);

final FlutterView view = PlatformDispatcher.instance.implicitView!;
// TODO(matanlurey): https://github.com/flutter/flutter/issues/142746.
// This Dart program is used for every test, but there is at least one test
// (EngineLaunchE2ETest.java) that does not create a FlutterView, so the
// implicit view's size is not initialized (and the assert would be tripped).
//
// final FlutterView view = PlatformDispatcher.instance.implicitView!;
// Asserting that this is greater than zero since this app runs on different
// platforms with different sizes. If it is greater than zero, it has been
// initialized to some meaningful value at least.
assert(
view.display.size > Offset.zero,
'Expected ${view.display} to be initialized.',
);
// assert(
// view.display.size > Offset.zero,
// 'Expected ${view.display} to be initialized.',
// );

final ByteData data = ByteData(1);
data.setUint8(0, 1);
Expand Down