summaryrefslogtreecommitdiff
path: root/libs/gui/tests/EndToEndNativeInputTest.cpp
diff options
context:
space:
mode:
authorScott Lobdell <slobdell@google.com>2019-09-18 12:28:18 -0700
committerSteven Laver <lavers@google.com>2019-09-24 17:52:31 -0700
commitdbafeb6d0667149ddb6c05b0815950174776c71f (patch)
tree8818ebea33a6b8c2f5b0ae0b7b742d6f8e508349 /libs/gui/tests/EndToEndNativeInputTest.cpp
parentad1e578f97b9b09cf9734ce666bceb993ccbde8c (diff)
parent6fbb7b84953ff7270a8d02501595d18380a09e13 (diff)
Merge RP1A.190822.001
Change-Id: Id91d081aed7b9484bc4e178f7b7be04c2ca0423a
Diffstat (limited to 'libs/gui/tests/EndToEndNativeInputTest.cpp')
-rw-r--r--libs/gui/tests/EndToEndNativeInputTest.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/gui/tests/EndToEndNativeInputTest.cpp b/libs/gui/tests/EndToEndNativeInputTest.cpp
index abc47177a9..c1e753241a 100644
--- a/libs/gui/tests/EndToEndNativeInputTest.cpp
+++ b/libs/gui/tests/EndToEndNativeInputTest.cpp
@@ -414,6 +414,19 @@ TEST_F(InputSurfacesTest, input_respects_scaled_surface_insets) {
bgSurface->expectTap(1, 1);
}
+TEST_F(InputSurfacesTest, input_respects_scaled_surface_insets_overflow) {
+ std::unique_ptr<InputSurface> fgSurface = makeSurface(100, 100);
+ // In case we pass the very big inset without any checking.
+ fgSurface->mInputInfo.surfaceInset = INT32_MAX;
+ fgSurface->showAt(100, 100);
+
+ fgSurface->doTransaction([&](auto &t, auto &sc) { t.setMatrix(sc, 2.0, 0, 0, 2.0); });
+
+ // expect no crash for overflow, and inset size to be clamped to surface size
+ injectTap(202, 202);
+ fgSurface->expectTap(1, 1);
+}
+
// Ensure we ignore transparent region when getting screen bounds when positioning input frame.
TEST_F(InputSurfacesTest, input_ignores_transparent_region) {
std::unique_ptr<InputSurface> surface = makeSurface(100, 100);