Skip to content

Commit 525e783

Browse files
HarryCuttsAndroid (Google) Code Review
authored andcommitted
Merge "Fix flaky uncropped_container_replaces_touchable_region_with_null_crop" into main
2 parents b9e29b6 + 56d55bc commit 525e783

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

libs/gui/tests/EndToEndNativeInputTest.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,8 @@ TEST_F(InputSurfacesTest, cropped_container_replaces_touchable_region_with_null_
11161116
* in its parent's touchable region. The input events should be in the layer's coordinate space.
11171117
*/
11181118
TEST_F(InputSurfacesTest, uncropped_container_replaces_touchable_region_with_null_crop) {
1119+
std::unique_ptr<InputSurface> bgContainer =
1120+
InputSurface::makeContainerInputSurface(mComposerClient, 0, 0);
11191121
std::unique_ptr<InputSurface> parentContainer =
11201122
InputSurface::makeContainerInputSurface(mComposerClient, 0, 0);
11211123
std::unique_ptr<InputSurface> containerSurface =
@@ -1124,6 +1126,9 @@ TEST_F(InputSurfacesTest, uncropped_container_replaces_touchable_region_with_nul
11241126
[&](auto& t, auto& sc) { t.reparent(sc, parentContainer->mSurfaceControl); });
11251127
containerSurface->mInputInfo.replaceTouchableRegionWithCrop = true;
11261128
containerSurface->mInputInfo.touchableRegionCropHandle = nullptr;
1129+
parentContainer->doTransaction(
1130+
[&](auto& t, auto& sc) { t.reparent(sc, bgContainer->mSurfaceControl); });
1131+
bgContainer->showAt(0, 0, Rect(0, 0, 100, 100));
11271132
parentContainer->showAt(10, 10, Rect(0, 0, 20, 20));
11281133
containerSurface->showAt(10, 10, Rect::INVALID_RECT);
11291134

0 commit comments

Comments
 (0)