test/TileCacheTests.cpp |   31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

New commits:
commit f861a9e1a7f2ad0c3bd58b4be3fce4cff5a98d6c
Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk>
Date:   Sun Jan 8 23:31:51 2017 -0500

    wsd: new unittest for multiview tiles when disconnecting
    
    When there are many views requesting tiles,
    disconnecting any should not cancel tiles
    for other views.
    
    Change-Id: I6029432c4b9ab931811dcb3b03b0441b413a9971
    Reviewed-on: https://gerrit.libreoffice.org/32872
    Reviewed-by: Ashod Nakashian <ashnak...@gmail.com>
    Tested-by: Ashod Nakashian <ashnak...@gmail.com>

diff --git a/test/TileCacheTests.cpp b/test/TileCacheTests.cpp
index 44a3484..42f72c4 100644
--- a/test/TileCacheTests.cpp
+++ b/test/TileCacheTests.cpp
@@ -56,6 +56,7 @@ class TileCacheTests : public CPPUNIT_NS::TestFixture
     CPPUNIT_TEST(testPerformance);
     CPPUNIT_TEST(testCancelTiles);
     CPPUNIT_TEST(testCancelTilesMultiView);
+    CPPUNIT_TEST(testDisconnectMultiView);
     CPPUNIT_TEST(testUnresponsiveClient);
     CPPUNIT_TEST(testImpressTiles);
     CPPUNIT_TEST(testClientPartImpress);
@@ -79,6 +80,7 @@ class TileCacheTests : public CPPUNIT_NS::TestFixture
     void testPerformance();
     void testCancelTiles();
     void testCancelTilesMultiView();
+    void testDisconnectMultiView();
     void testUnresponsiveClient();
     void testImpressTiles();
     void testClientPartImpress();
@@ -321,6 +323,35 @@ void TileCacheTests::testCancelTilesMultiView()
     }
 }
 
+void TileCacheTests::testDisconnectMultiView()
+{
+    std::string documentPath, documentURL;
+    getDocumentPathAndURL("setclientpart.ods", documentPath, documentURL, 
"cancelTilesMultiView ");
+
+    const size_t repeat = 4;
+    for (size_t j = 1; j <= repeat; ++j)
+    {
+        std::cerr << "cancelTilesMultiView try #" << j << std::endl;
+
+        // Request a huge tile, and cancel immediately.
+        auto socket1 = loadDocAndGetSocket(_uri, documentURL, 
"cancelTilesMultiView-1 ");
+        auto socket2 = loadDocAndGetSocket(_uri, documentURL, 
"cancelTilesMultiView-2 ", true);
+
+        sendTextFrame(socket1, "tilecombine part=0 width=256 height=256 
tileposx=0,3840,7680,11520,0,3840,7680,11520 
tileposy=0,0,0,0,3840,3840,3840,3840 tilewidth=3840 tileheight=3840", 
"cancelTilesMultiView-1 ");
+        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 ");
+
+        socket1->shutdown();
+
+        for (auto i = 0; i < 4; ++i)
+        {
+            getTileMessage(*socket2, "cancelTilesMultiView-2 ");
+        }
+
+        // Should never get more than 4 tiles on socket2.
+        const auto res2 = getResponseString(socket2, "tile:", 
"cancelTilesMultiView-2 ", 1000);
+    }
+}
+
 void TileCacheTests::testUnresponsiveClient()
 {
     std::string documentPath, documentURL;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to