未验证 提交 480d8e45 编写于 作者: E Emmanuel Garcia 提交者: GitHub

Fix scenario platform view tests on Android (#18332)

上级 80fa77eb
......@@ -446,9 +446,6 @@ class PlatformViewClipPathScenario extends PlatformViewScenario {
builder.pushOffset(0, 0);
// Create a path of rectangle with width of 200 and height of 300, starting from (100, 100).
//
// Refer to "../../ios/Scenarios/Scenarios/ScenariosUITests/golden_platform_view_clippath_iPhone SE_simulator.png" for the exact path after clipping.
final Path path = Path()
..moveTo(100, 100)
..quadraticBezierTo(50, 250, 100, 400)
......@@ -632,11 +629,18 @@ mixin _BasePlatformViewScenarioMixin on Scenario {
);
}
void _addPlatformViewtoScene(SceneBuilder sceneBuilder, int viewId, double width, double height) {
void _addPlatformViewtoScene(
SceneBuilder sceneBuilder,
int viewId,
double width,
double height, {
Offset overlayOffset,
}) {
overlayOffset ??= const Offset(50, 50);
if (Platform.isIOS) {
sceneBuilder.addPlatformView(viewId, width: width, height: height);
sceneBuilder.addPlatformView(viewId, offset: overlayOffset, width: width, height: height);
} else if (Platform.isAndroid && _textureId != null) {
sceneBuilder.addTexture(_textureId, offset: const Offset(150, 300), width: width, height: height);
sceneBuilder.addTexture(_textureId, offset: overlayOffset, width: width, height: height);
} else {
throw UnsupportedError('Platform ${Platform.operatingSystem} is not supported');
}
......@@ -649,7 +653,13 @@ mixin _BasePlatformViewScenarioMixin on Scenario {
Offset overlayOffset,
}) {
overlayOffset ??= const Offset(50, 50);
_addPlatformViewtoScene(sceneBuilder, viewId, 500, 500);
_addPlatformViewtoScene(
sceneBuilder,
viewId,
500,
500,
overlayOffset: overlayOffset,
);
final PictureRecorder recorder = PictureRecorder();
final Canvas canvas = Canvas(recorder);
canvas.drawCircle(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册