diff options
author | alk3pInjection <webmaster@raspii.tech> | 2023-04-20 00:08:54 +0800 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2023-04-20 00:08:54 +0800 |
commit | fb34b76e3f7a1b2bb8cafba9a485b4a5f57c4a2c (patch) | |
tree | 02c3f70afc88c4a9fd26d2a490e3ea4fbdfe7c1c /libs/gui/tests/EndToEndNativeInputTest.cpp | |
parent | cc8a3758be627207828a9c70353e84cb1525edbb (diff) | |
parent | f0037e2123deb6b62847c9e2fec53a8b00cf2a31 (diff) |
Merge tag 'LA.QSSI.13.0.r1-09800-qssi.0' into tachibana
"LA.QSSI.13.0.r1-09800-qssi.0"
Change-Id: I59609ccba4dd384f5a1d653de9f926614a220037
Diffstat (limited to 'libs/gui/tests/EndToEndNativeInputTest.cpp')
-rw-r--r-- | libs/gui/tests/EndToEndNativeInputTest.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libs/gui/tests/EndToEndNativeInputTest.cpp b/libs/gui/tests/EndToEndNativeInputTest.cpp index a30920268a..3ce8c481d2 100644 --- a/libs/gui/tests/EndToEndNativeInputTest.cpp +++ b/libs/gui/tests/EndToEndNativeInputTest.cpp @@ -1188,18 +1188,23 @@ public: std::vector<sp<IGraphicBufferProducer>> mProducers; }; -TEST_F(MultiDisplayTests, drop_input_if_layer_on_invalid_display) { +TEST_F(MultiDisplayTests, drop_touch_if_layer_on_invalid_display) { ui::LayerStack layerStack = ui::LayerStack::fromValue(42); // Do not create a display associated with the LayerStack. std::unique_ptr<InputSurface> surface = makeSurface(100, 100); surface->doTransaction([&](auto &t, auto &sc) { t.setLayerStack(sc, layerStack); }); surface->showAt(100, 100); + // Touches should be dropped if the layer is on an invalid display. injectTapOnDisplay(101, 101, layerStack.id); + EXPECT_EQ(surface->consumeEvent(100), nullptr); + + // However, we still let the window be focused and receive keys. surface->requestFocus(layerStack.id); - injectKeyOnDisplay(AKEYCODE_V, layerStack.id); + surface->assertFocusChange(true); - EXPECT_EQ(surface->consumeEvent(100), nullptr); + injectKeyOnDisplay(AKEYCODE_V, layerStack.id); + surface->expectKey(AKEYCODE_V); } TEST_F(MultiDisplayTests, virtual_display_receives_input) { |