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

Ashod Nakashian ashod.nakashian at collabora.co.uk
Mon May 23 01:44:54 UTC 2016


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

New commits:
commit 65ed424199d6e25d9151d0c619237b947f86b412
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Sun May 22 19:00:57 2016 -0400

    loolwsd: new tile performance test
    
    Change-Id: I08d477ec5f04de9f82c49263f35ebbf38a968f31
    Reviewed-on: https://gerrit.libreoffice.org/25335
    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 e8524b3..f4bc0d8 100644
--- a/loolwsd/test/TileCacheTests.cpp
+++ b/loolwsd/test/TileCacheTests.cpp
@@ -32,6 +32,7 @@ class TileCacheTests : public CPPUNIT_NS::TestFixture
 
     CPPUNIT_TEST(testSimple);
     CPPUNIT_TEST(testSimpleCombine);
+    CPPUNIT_TEST(testPerformance);
     CPPUNIT_TEST(testUnresponsiveClient);
     CPPUNIT_TEST(testClientPartImpress);
     CPPUNIT_TEST(testClientPartCalc);
@@ -44,6 +45,7 @@ class TileCacheTests : public CPPUNIT_NS::TestFixture
 
     void testSimple();
     void testSimpleCombine();
+    void testPerformance();
     void testUnresponsiveClient();
     void testClientPartImpress();
     void testClientPartCalc();
@@ -195,6 +197,34 @@ void TileCacheTests::testSimpleCombine()
     socket2.shutdown();
 }
 
+void TileCacheTests::testPerformance()
+{
+    std::string documentPath, documentURL;
+    getDocumentPathAndURL("hello.odt", documentPath, documentURL);
+    Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, documentURL);
+
+    auto socket = *loadDocAndGetSocket(_uri, documentURL, "tile-performance ");
+    getResponseMessage(socket, "invalidatetiles:");
+
+    Poco::Timestamp timestamp;
+    for (auto x = 0; x < 5; ++x)
+    {
+        sendTextFrame(socket, "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");
+        for (auto i = 0; i < 8; ++i)
+        {
+            auto tile = getResponseMessage(socket, "tile:", "tile-performance ");
+            CPPUNIT_ASSERT_MESSAGE("did not receive a tile: message as expected", !tile.empty());
+        }
+    }
+
+    std::cerr << "Tile rendering roundtrip for 5 x 8 tiles combined: " << timestamp.elapsed() / 1000.
+              << " ms. Per-tilecombine: " << timestamp.elapsed() / (1000. * 5)
+              << " ms. Per-tile: " << timestamp.elapsed() / (1000. * 5 * 8) << "ms."
+              << std::endl;
+
+    socket.shutdown();
+}
+
 void TileCacheTests::testUnresponsiveClient()
 {
     std::string documentPath, documentURL;


More information about the Libreoffice-commits mailing list