[Libreoffice-commits] online.git: loolwsd/test

Ashod Nakashian ashod.nakashian at collabora.co.uk
Wed Sep 21 05:16:39 UTC 2016


 loolwsd/test/TileCacheTests.cpp |   26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

New commits:
commit 14f11460b62ea5d05aad5bda05e11ae71dd47063
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Tue Sep 20 20:44:08 2016 -0400

    loolwsd: new multi-view canceltiles unittest
    
    Change-Id: Ia7fdc2c64c96e3edeb82ef48d3621b70ca958b5d
    Reviewed-on: https://gerrit.libreoffice.org/29122
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loolwsd/test/TileCacheTests.cpp b/loolwsd/test/TileCacheTests.cpp
index 2b172b0..926da87 100644
--- a/loolwsd/test/TileCacheTests.cpp
+++ b/loolwsd/test/TileCacheTests.cpp
@@ -53,6 +53,7 @@ class TileCacheTests : public CPPUNIT_NS::TestFixture
     CPPUNIT_TEST(testSimpleCombine);
     CPPUNIT_TEST(testPerformance);
     CPPUNIT_TEST(testCancelTiles);
+    CPPUNIT_TEST(testCancelTilesMultiView);
     CPPUNIT_TEST(testUnresponsiveClient);
     CPPUNIT_TEST(testImpressTiles);
     CPPUNIT_TEST(testClientPartImpress);
@@ -72,6 +73,7 @@ class TileCacheTests : public CPPUNIT_NS::TestFixture
     void testSimpleCombine();
     void testPerformance();
     void testCancelTiles();
+    void testCancelTilesMultiView();
     void testUnresponsiveClient();
     void testImpressTiles();
     void testClientPartImpress();
@@ -238,7 +240,7 @@ void TileCacheTests::testPerformance()
 void TileCacheTests::testCancelTiles()
 {
     const auto testName = "cancelTiles ";
-    auto socket = *loadDocAndGetSocket("load12.ods", _uri, testName);
+    auto socket = *loadDocAndGetSocket("setclientpart.ods", _uri, testName);
 
     // Request a huge tile, and cancel immediately.
     sendTextFrame(socket, "tilecombine part=0 width=2560 height=2560 tileposx=0 tileposy=0 tilewidth=38400 tileheight=38400");
@@ -247,6 +249,28 @@ void TileCacheTests::testCancelTiles()
     assertNotInResponse(socket, "tile:", testName);
 }
 
+void TileCacheTests::testCancelTilesMultiView()
+{
+    std::string documentPath, documentURL;
+    getDocumentPathAndURL("setclientpart.ods", documentPath, documentURL);
+
+    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 ");
+
+    sendTextFrame(socket1, "canceltiles");
+
+    for (auto i = 0; i < 4; ++i)
+    {
+        getTileMessage(*socket2, "cancelTilesMultiView-2 ");
+    }
+
+    assertNotInResponse(socket1, "tile:", "cancelTilesMultiView-1 ");
+    assertNotInResponse(socket2, "tile:", "cancelTilesMultiView-2 ");
+}
+
 void TileCacheTests::testUnresponsiveClient()
 {
     const std::string docFilename = "hello.odt";


More information about the Libreoffice-commits mailing list