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

Fix race condition in Unobstructed Platform View Scenario tests #48096

Merged
Merged
Changes from all commits
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
7 changes: 6 additions & 1 deletion testing/scenario_app/lib/src/platform_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,6 @@ class MultiPlatformViewBackgroundForegroundScenario extends Scenario
required this.secondId,
}) {
_nextFrame = _firstFrame;
channelBuffers.setListener('flutter/lifecycle', _onPlatformMessage);
}

/// The platform view identifier to use for the first platform view.
Expand All @@ -438,7 +437,13 @@ class MultiPlatformViewBackgroundForegroundScenario extends Scenario
_nextFrame();
}

bool _firstFrameBegan = false;

void _firstFrame() {
if (!_firstFrameBegan) {
channelBuffers.setListener('flutter/lifecycle', _onPlatformMessage);
}
_firstFrameBegan = true;
final SceneBuilder builder = SceneBuilder();

builder.pushOffset(50, 600);
Expand Down