[Libreoffice-commits] online.git: test/TileCacheTests.cpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Mon Jan 2 06:20:03 UTC 2017


 test/TileCacheTests.cpp |   18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

New commits:
commit 6f6f308895cdd687897f1e14d2b48bb8495468cd
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Mon Jan 2 00:45:21 2017 -0500

    wsd: more robust canceltiles unittest
    
    Change-Id: I0a71bbb84ff4ca3233d8a78a7c4b3718ec0ad382
    Reviewed-on: https://gerrit.libreoffice.org/32634
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/test/TileCacheTests.cpp b/test/TileCacheTests.cpp
index df8e336..4acd29e 100644
--- a/test/TileCacheTests.cpp
+++ b/test/TileCacheTests.cpp
@@ -282,10 +282,10 @@ void TileCacheTests::testCancelTilesMultiView()
         sendTextFrame(socket2, "tilecombine part=0 width=256 height=256 tileposx=0,3840,7680,0 tileposy=0,0,0,22520 tilewidth=3840 tileheight=3840", "cancelTilesMultiView-2 ");
 
         sendTextFrame(socket1, "canceltiles");
-        auto res = getResponseString(socket1, "tile:", "cancelTilesMultiView-1 ", 1000);
-        if (!res.empty() && j == repeat)
+        const auto res1 = getResponseString(socket1, "tile:", "cancelTilesMultiView-1 ", 1000);
+        if (!res1.empty() && j == repeat)
         {
-            CPPUNIT_ASSERT_MESSAGE("Did not expect getting message [" + res + "].", res.empty());
+            CPPUNIT_ASSERT_MESSAGE("Did not expect getting message [" + res1 + "].", res1.empty());
         }
 
         for (auto i = 0; i < 4; ++i)
@@ -294,8 +294,16 @@ void TileCacheTests::testCancelTilesMultiView()
         }
 
         // Should never get more than 4 tiles on socket2.
-        assertNotInResponse(socket2, "tile:", "cancelTilesMultiView-2 ");
-        if (res.empty())
+        // Though in practice we get the rendering result from socket1's request and ours.
+        // This happens because we currently always send back tiles even if they are of old version
+        // because we want to be responsive, since we've rendered them anyway.
+        const auto res2 = getResponseString(socket2, "tile:", "cancelTilesMultiView-2 ", 1000);
+        if (!res2.empty() && j == repeat)
+        {
+            CPPUNIT_ASSERT_MESSAGE("Did not expect getting message [" + res2 + "].", res2.empty());
+        }
+
+        if (res1.empty() && res2.empty())
         {
             break;
         }


More information about the Libreoffice-commits mailing list