OSDN Git Service

Fixed CropLatchingTest that was failing
authorchaviw <chaviw@google.com>
Wed, 28 Jun 2017 23:39:06 +0000 (16:39 -0700)
committerchaviw <chaviw@google.com>
Wed, 28 Jun 2017 23:39:06 +0000 (16:39 -0700)
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

services/surfaceflinger/tests/SurfaceFlinger_test.filter
services/surfaceflinger/tests/Transaction_test.cpp

index 915b5cd..6be708a 100644 (file)
@@ -1,5 +1,5 @@
 {
         "presubmit": {
-            "filter": "LayerUpdateTest.*:ChildLayerTest.*:SurfaceFlingerStress.*
+            "filter": "LayerUpdateTest.*:ChildLayerTest.*:SurfaceFlingerStress.*:CropLatchingTest.*:GeometryLatchingTest.*"
         }
 }
\ No newline at end of file
index b7792c7..4ce14f8 100644 (file)
@@ -566,6 +566,15 @@ protected:
         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 @@ TEST_F(CropLatchingTest, FinalCropLatchingRegressionForb37531386) {
     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) {