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

Fix race condition in Platform View Scenario tests #47575

Merged
merged 1 commit into from
Nov 2, 2023
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
5 changes: 5 additions & 0 deletions testing/scenario_app/lib/src/platform_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1758,6 +1758,7 @@ class PlatformViewsWithClipsScrolling extends Scenario
}

final Map<String, int> _createdPlatformViews = <String, int> {};
final Map<String, bool> _calledToBeCreatedPlatformViews = <String, bool> {};

/// Adds the platform view to the scene.
///
Expand Down Expand Up @@ -1787,6 +1788,10 @@ void addPlatformView(
);
return;
}
if (_calledToBeCreatedPlatformViews.containsKey(platformViewKey)) {
return;
}
_calledToBeCreatedPlatformViews[platformViewKey] = true;

final bool usesAndroidHybridComposition = scenarioParams['use_android_view'] as bool? ?? false;
final bool expectAndroidHybridCompositionFallback =
Expand Down