Fixed CropLatchingTest that was failing
FinalCropLatchingRegressionForb37531386 test was failing
do to an incorrect assertion. Also added the test classes that
were not yet added to the filter so they run in presubmit.
Change-Id: Ia298ac2e9f64809373f9d0267325c6b51b70d9c5
diff --git a/services/surfaceflinger/tests/Transaction_test.cpp b/services/surfaceflinger/tests/Transaction_test.cpp
index b7792c7..4ce14f8 100644
--- a/services/surfaceflinger/tests/Transaction_test.cpp
+++ b/services/surfaceflinger/tests/Transaction_test.cpp
@@ -566,6 +566,15 @@
sc->expectBGColor(127, 127);
sc->expectBGColor(128, 128);
}
+
+ void EXPECT_RESIZE_STATE(const char* trace) {
+ SCOPED_TRACE(trace);
+ ScreenCapture::captureScreen(&sc);
+ // The FG is now resized too 128,128 at 64,64
+ sc->expectFGColor(64, 64);
+ sc->expectFGColor(191, 191);
+ sc->expectBGColor(192, 192);
+ }
};
TEST_F(CropLatchingTest, CropLatching) {
@@ -666,15 +675,17 @@
mFGSurfaceControl->setFinalCrop(Rect(64, 64, 127, 127));
SurfaceComposerClient::closeGlobalTransaction(true);
+ EXPECT_INITIAL_STATE("after setting crops with geometryAppliesWithResize");
+
SurfaceComposerClient::openGlobalTransaction();
mFGSurfaceControl->setFinalCrop(Rect(0, 0, -1, -1));
SurfaceComposerClient::closeGlobalTransaction(true);
- EXPECT_INITIAL_STATE("after setting crops with geometryAppliesWithResize");
+ EXPECT_INITIAL_STATE("after setting another crop");
completeFGResize();
- EXPECT_INITIAL_STATE("after the resize finishes");
+ EXPECT_RESIZE_STATE("after the resize finishes");
}
TEST_F(LayerUpdateTest, DeferredTransactionTest) {