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

Commit b9b27c8

Browse files
author
Emmanuel Garcia
committed
Maybe fixes test
1 parent f0651cb commit b9b27c8

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

shell/platform/android/external_view_embedder/external_view_embedder_unittests.cc

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -549,28 +549,31 @@ TEST(AndroidExternalViewEmbedder, SubmitFrame__overlayComposition) {
549549
stack));
550550
EXPECT_CALL(*jni_mock, FlutterViewOnDisplayPlatformView(1, 0, 0, 100, 100,
551551
150, 150, stack));
552-
}
553-
// This simulates Flutter UI that intersects with the first and second Android
554-
// views.
555-
embedder->CompositeEmbeddedView(1)->drawRect(SkRect::MakeXYWH(25, 25, 50, 50),
556-
rect_paint);
557-
558-
EXPECT_CALL(*jni_mock, FlutterViewCreateOverlaySurface())
559-
.WillRepeatedly([&]() {
560-
return std::make_unique<PlatformViewAndroidJNI::OverlayMetadata>(
561-
1, window);
562-
});
552+
// This simulates Flutter UI that intersects with the first and second
553+
// Android views.
554+
embedder->CompositeEmbeddedView(1)->drawRect(
555+
SkRect::MakeXYWH(25, 25, 50, 50), rect_paint);
563556

564-
EXPECT_CALL(*jni_mock, FlutterViewDisplayOverlaySurface(1, 25, 25, 50, 150))
565-
.Times(2);
557+
EXPECT_CALL(*jni_mock, FlutterViewCreateOverlaySurface())
558+
.WillRepeatedly([&]() {
559+
return std::make_unique<PlatformViewAndroidJNI::OverlayMetadata>(
560+
1, window);
561+
});
566562

567-
auto surface_frame = std::make_unique<SurfaceFrame>(
568-
SkSurface::MakeNull(1000, 1000), false,
569-
[](const SurfaceFrame& surface_frame, SkCanvas* canvas) mutable {
570-
return true;
571-
});
563+
EXPECT_CALL(*jni_mock, FlutterViewDisplayOverlaySurface(1, 25, 25, 50, 150))
564+
.Times(2);
572565

573-
embedder->SubmitFrame(gr_context.get(), std::move(surface_frame), nullptr);
566+
auto surface_frame = std::make_unique<SurfaceFrame>(
567+
SkSurface::MakeNull(1000, 1000), false,
568+
[](const SurfaceFrame& surface_frame, SkCanvas* canvas) mutable {
569+
return true;
570+
});
571+
572+
embedder->SubmitFrame(gr_context.get(), std::move(surface_frame), nullptr);
573+
574+
EXPECT_CALL(*jni_mock, FlutterViewEndFrame());
575+
embedder->EndFrame(/*should_resubmit_frame=*/false, raster_thread_merger);
576+
}
574577
}
575578

576579
TEST(AndroidExternalViewEmbedder, DoesNotCallJNIPlatformThreadOnlyMethods) {

0 commit comments

Comments
 (0)