summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAndras Timar <andras.timar@collabora.com>2021-11-18 13:08:14 +0100
committerAndras Timar <andras.timar@collabora.com>2021-11-18 14:14:11 +0100
commitf07ff8c7e0754babe9819163fb0edeacac326caf (patch)
tree2e24c52eb95edf971399e33580d26b691528b211 /test
parentNotebookbarBuilder.js: Set role of Menubar. (diff)
downloadonline-f07ff8c7e0754babe9819163fb0edeacac326caf.tar.gz
online-f07ff8c7e0754babe9819163fb0edeacac326caf.zip
rename: remaining lool->cool changes
Signed-off-by: Andras Timar <andras.timar@collabora.com> Change-Id: Ib7d4e804bebe52dead8d53b0e0bbaed0f08bf3d0
Diffstat (limited to 'test')
-rw-r--r--test/HttpTestServer.hpp2
-rw-r--r--test/Makefile.am6
-rw-r--r--test/TileCacheTests.cpp66
-rw-r--r--test/UnitAdmin.cpp22
-rw-r--r--test/UnitBadDocLoad.cpp26
-rw-r--r--test/UnitCalc.cpp20
-rw-r--r--test/UnitClient.cpp2
-rw-r--r--test/UnitClose.cpp14
-rw-r--r--test/UnitCopyPaste.cpp4
-rw-r--r--test/UnitCursor.cpp22
-rw-r--r--test/UnitEachView.cpp6
-rw-r--r--test/UnitHTTP.cpp2
-rw-r--r--test/UnitHTTP.hpp8
-rw-r--r--test/UnitHosting.cpp2
-rw-r--r--test/UnitInsertDelete.cpp14
-rw-r--r--test/UnitLargePaste.cpp4
-rw-r--r--test/UnitLoad.cpp14
-rw-r--r--test/UnitLoadTorture.cpp6
-rw-r--r--test/UnitOAuth.cpp2
-rw-r--r--test/UnitPasswordProtected.cpp20
-rw-r--r--test/UnitPaste.cpp4
-rw-r--r--test/UnitPrefork.cpp2
-rw-r--r--test/UnitRenderSearchResult.cpp4
-rw-r--r--test/UnitRenderShape.cpp6
-rw-r--r--test/UnitRenderingOptions.cpp4
-rw-r--r--test/UnitSession.cpp16
-rw-r--r--test/UnitStorage.cpp2
-rw-r--r--test/UnitTiffLoad.cpp4
-rw-r--r--test/UnitTyping.cpp16
-rw-r--r--test/UnitUNOCommand.cpp4
-rw-r--r--test/UnitWOPI.cpp10
-rw-r--r--test/UnitWOPIAsyncUpload_Close.cpp8
-rw-r--r--test/UnitWOPIAsyncUpload_Modify.cpp8
-rw-r--r--test/UnitWOPIAsyncUpload_ModifyClose.cpp4
-rw-r--r--test/UnitWOPIHttpHeaders.cpp2
-rw-r--r--test/UnitWOPILoadEncoded.cpp4
-rw-r--r--test/UnitWOPILock.cpp4
-rw-r--r--test/UnitWOPIRenameFile.cpp4
-rw-r--r--test/UnitWOPISaveAs.cpp4
-rw-r--r--test/UnitWOPIWatermark.cpp6
-rw-r--r--test/WhiteBoxTests.cpp50
-rw-r--r--test/WopiTestServer.hpp10
-rw-r--r--test/countcoolkits.hpp (renamed from test/countloolkits.hpp)32
-rw-r--r--test/helpers.hpp90
-rw-r--r--test/httpcrashtest.cpp24
-rw-r--r--test/httpwstest.cpp26
-rw-r--r--test/integration-http-server.cpp12
-rwxr-xr-xtest/run_unit.sh.in2
-rw-r--r--test/test.cpp14
-rw-r--r--test/test.hpp4
50 files changed, 321 insertions, 321 deletions
diff --git a/test/HttpTestServer.hpp b/test/HttpTestServer.hpp
index 1184c76c6e..342dd811fc 100644
--- a/test/HttpTestServer.hpp
+++ b/test/HttpTestServer.hpp
@@ -15,7 +15,7 @@
#include <chrono>
#include <string>
-#ifndef LOOLWSD_VERSION
+#ifndef COOLWSD_VERSION
static_assert(false, "config.h must be included in the .cpp being compiled");
#endif
diff --git a/test/Makefile.am b/test/Makefile.am
index 583fbbec17..4ab0bb5b58 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -2,7 +2,7 @@
export MAX_CONCURRENCY=4
AUTOMAKE_OPTION = serial-tests
-# unittest: tests that run a captive loolwsd as part of themselves.
+# unittest: tests that run a captive coolwsd as part of themselves.
check_PROGRAMS = fakesockettest
noinst_PROGRAMS = fakesockettest unittest unithttplib
@@ -10,8 +10,8 @@ noinst_PROGRAMS = fakesockettest unittest unithttplib
AM_CXXFLAGS = $(CPPUNIT_CFLAGS) -DTDOC=\"$(abs_top_srcdir)/test/data\" \
-I${top_srcdir}/common -I${top_srcdir}/net -I${top_srcdir}/wsd -I${top_srcdir}/kit \
-I${top_srcdir} \
- -pthread -DLOOLWSD_DATADIR='"@LOOLWSD_DATADIR@"' \
- -DLOOLWSD_CONFIGDIR='"@LOOLWSD_CONFIGDIR@"' \
+ -pthread -DCOOLWSD_DATADIR='"@COOLWSD_DATADIR@"' \
+ -DCOOLWSD_CONFIGDIR='"@COOLWSD_CONFIGDIR@"' \
-DDEBUG_ABSSRCDIR='"@abs_srcdir@"' \
${include_paths}
diff --git a/test/TileCacheTests.cpp b/test/TileCacheTests.cpp
index 331ad17293..86b0d82223 100644
--- a/test/TileCacheTests.cpp
+++ b/test/TileCacheTests.cpp
@@ -23,7 +23,7 @@
#include <Unit.hpp>
#include <Util.hpp>
-#include <countloolkits.hpp>
+#include <countcoolkits.hpp>
#include <helpers.hpp>
#include <test.hpp>
#include <sstream>
@@ -126,20 +126,20 @@ class TileCacheTests : public CPPUNIT_NS::TestFixture
void checkTiles(std::shared_ptr<http::WebSocketSession>& socket, const std::string& docType,
const std::string& testname);
- void checkTiles(std::shared_ptr<LOOLWebSocket>& socket, const std::string& type,
+ void checkTiles(std::shared_ptr<COOLWebSocket>& socket, const std::string& type,
const std::string& testname);
void requestTiles(std::shared_ptr<http::WebSocketSession>& socket, const std::string& docType,
const int part, const int docWidth, const int docHeight,
const std::string& testname);
- void requestTiles(std::shared_ptr<LOOLWebSocket>& socket, const std::string& docType,
+ void requestTiles(std::shared_ptr<COOLWebSocket>& socket, const std::string& docType,
const int part, const int docWidth, const int docHeight,
const std::string& testname);
void checkBlackTiles(std::shared_ptr<http::WebSocketSession>& socket, const int /*part*/,
const int /*docWidth*/, const int /*docHeight*/,
const std::string& testname);
- void checkBlackTiles(std::shared_ptr<LOOLWebSocket>& socket, const int part, const int docWidth,
+ void checkBlackTiles(std::shared_ptr<COOLWebSocket>& socket, const int part, const int docWidth,
const int docHeight, const std::string& testname);
void checkBlackTile(std::stringstream& tile);
@@ -169,7 +169,7 @@ public:
void setUp()
{
resetTestStartTime();
- testCountHowManyLoolkits();
+ testCountHowManyCoolkits();
resetTestStartTime();
_socketPoll->startThread();
}
@@ -178,7 +178,7 @@ public:
{
_socketPoll->joinThread();
resetTestStartTime();
- testNoExtraLoolKitsLeft();
+ testNoExtraCoolKitsLeft();
resetTestStartTime();
}
};
@@ -322,7 +322,7 @@ void TileCacheTests::testCancelTiles()
TST_LOG("cancelTiles try #" << i);
// Wait to clear previous sessions.
- countLoolKitProcesses(InitialLoolKitCount);
+ countCoolKitProcesses(InitialCoolKitCount);
std::shared_ptr<http::WebSocketSession> socket
= loadDocAndGetSession(_socketPoll, "setclientpart.ods", _uri, testname);
@@ -367,7 +367,7 @@ void TileCacheTests::testCancelTilesMultiView()
TST_LOG("cancelTilesMultiView try #" << j);
// Wait to clear previous sessions.
- countLoolKitProcesses(InitialLoolKitCount);
+ countCoolKitProcesses(InitialCoolKitCount);
// Request a huge tile, and cancel immediately.
std::shared_ptr<http::WebSocketSession> socket1
@@ -449,7 +449,7 @@ void TileCacheTests::testDisconnectMultiView()
TST_LOG("disconnectMultiView try #" << j);
// Wait to clear previous sessions.
- countLoolKitProcesses(InitialLoolKitCount);
+ countCoolKitProcesses(InitialCoolKitCount);
// Request a huge tile, and cancel immediately.
std::shared_ptr<http::WebSocketSession> socket1
@@ -634,7 +634,7 @@ void TileCacheTests::testTilesRenderedJustOnce()
sendTextFrame(socket, "ping", testname);
const auto ping1 = assertResponseString(socket, "pong", testname);
int renderCount1 = 0;
- LOK_ASSERT(LOOLProtocol::getTokenIntegerFromMessage(ping1, "rendercount", renderCount1));
+ LOK_ASSERT(COOLProtocol::getTokenIntegerFromMessage(ping1, "rendercount", renderCount1));
LOK_ASSERT_EQUAL(i * 3, renderCount1);
// Modify.
@@ -651,31 +651,31 @@ void TileCacheTests::testTilesRenderedJustOnce()
sendTextFrame(socket, "ping", testname);
const auto ping2 = assertResponseString(socket, "pong", testname);
int renderCount2 = 0;
- LOK_ASSERT(LOOLProtocol::getTokenIntegerFromMessage(ping2, "rendercount", renderCount2));
+ LOK_ASSERT(COOLProtocol::getTokenIntegerFromMessage(ping2, "rendercount", renderCount2));
LOK_ASSERT_EQUAL((i+1) * 3, renderCount2);
// Get same 3 tiles.
sendTextFrame(socket, "tilecombine nviewid=0 part=0 width=256 height=256 tileposx=0,3840,7680 tileposy=0,0,0 tilewidth=3840 tileheight=3840", testname);
const auto tile1 = assertResponseString(socket, "tile:", testname);
std::string renderId1;
- LOOLProtocol::getTokenStringFromMessage(tile1, "renderid", renderId1);
+ COOLProtocol::getTokenStringFromMessage(tile1, "renderid", renderId1);
LOK_ASSERT_EQUAL(std::string("cached"), renderId1);
const auto tile2 = assertResponseString(socket, "tile:", testname);
std::string renderId2;
- LOOLProtocol::getTokenStringFromMessage(tile2, "renderid", renderId2);
+ COOLProtocol::getTokenStringFromMessage(tile2, "renderid", renderId2);
LOK_ASSERT_EQUAL(std::string("cached"), renderId2);
const auto tile3 = assertResponseString(socket, "tile:", testname);
std::string renderId3;
- LOOLProtocol::getTokenStringFromMessage(tile3, "renderid", renderId3);
+ COOLProtocol::getTokenStringFromMessage(tile3, "renderid", renderId3);
LOK_ASSERT_EQUAL(std::string("cached"), renderId3);
// Get new rendercount.
sendTextFrame(socket, "ping", testname);
const auto ping3 = assertResponseString(socket, "pong", testname);
int renderCount3 = 0;
- LOK_ASSERT(LOOLProtocol::getTokenIntegerFromMessage(ping3, "rendercount", renderCount3));
+ LOK_ASSERT(COOLProtocol::getTokenIntegerFromMessage(ping3, "rendercount", renderCount3));
LOK_ASSERT_EQUAL(renderCount2, renderCount3);
}
@@ -720,7 +720,7 @@ void TileCacheTests::testTilesRenderedJustOnceMultiClient()
sendTextFrame(socket1, "ping", testname1);
const auto ping1 = assertResponseString(socket1, "pong", testname1);
int renderCount1 = 0;
- LOK_ASSERT(LOOLProtocol::getTokenIntegerFromMessage(ping1, "rendercount", renderCount1));
+ LOK_ASSERT(COOLProtocol::getTokenIntegerFromMessage(ping1, "rendercount", renderCount1));
LOK_ASSERT_EQUAL(i * 3, renderCount1);
// Modify.
@@ -755,31 +755,31 @@ void TileCacheTests::testTilesRenderedJustOnceMultiClient()
sendTextFrame(socket1, "ping", testname1);
const auto ping2 = assertResponseString(socket1, "pong", testname1);
int renderCount2 = 0;
- LOK_ASSERT(LOOLProtocol::getTokenIntegerFromMessage(ping2, "rendercount", renderCount2));
+ LOK_ASSERT(COOLProtocol::getTokenIntegerFromMessage(ping2, "rendercount", renderCount2));
LOK_ASSERT_EQUAL((i+1) * 3, renderCount2);
// Get same 3 tiles.
sendTextFrame(socket1, "tilecombine nviewid=0 part=0 width=256 height=256 tileposx=0,3840,7680 tileposy=0,0,0 tilewidth=3840 tileheight=3840", testname1);
const auto tile1 = assertResponseString(socket1, "tile:", testname1);
std::string renderId1;
- LOOLProtocol::getTokenStringFromMessage(tile1, "renderid", renderId1);
+ COOLProtocol::getTokenStringFromMessage(tile1, "renderid", renderId1);
LOK_ASSERT_EQUAL(std::string("cached"), renderId1);
const auto tile2 = assertResponseString(socket1, "tile:", testname1);
std::string renderId2;
- LOOLProtocol::getTokenStringFromMessage(tile2, "renderid", renderId2);
+ COOLProtocol::getTokenStringFromMessage(tile2, "renderid", renderId2);
LOK_ASSERT_EQUAL(std::string("cached"), renderId2);
const auto tile3 = assertResponseString(socket1, "tile:", testname1);
std::string renderId3;
- LOOLProtocol::getTokenStringFromMessage(tile3, "renderid", renderId3);
+ COOLProtocol::getTokenStringFromMessage(tile3, "renderid", renderId3);
LOK_ASSERT_EQUAL(std::string("cached"), renderId3);
// Get new rendercount.
sendTextFrame(socket1, "ping", testname1);
const auto ping3 = assertResponseString(socket1, "pong", testname1);
int renderCount3 = 0;
- LOK_ASSERT(LOOLProtocol::getTokenIntegerFromMessage(ping3, "rendercount", renderCount3));
+ LOK_ASSERT(COOLProtocol::getTokenIntegerFromMessage(ping3, "rendercount", renderCount3));
LOK_ASSERT_EQUAL(renderCount2, renderCount3);
}
@@ -825,9 +825,9 @@ void TileCacheTests::testSimultaneousTilesRenderedJustOnce()
if (!response1.empty() && !response2.empty())
{
std::string renderId1;
- LOOLProtocol::getTokenStringFromMessage(response1, "renderid", renderId1);
+ COOLProtocol::getTokenStringFromMessage(response1, "renderid", renderId1);
std::string renderId2;
- LOOLProtocol::getTokenStringFromMessage(response2, "renderid", renderId2);
+ COOLProtocol::getTokenStringFromMessage(response2, "renderid", renderId2);
LOK_ASSERT(renderId1 == renderId2 ||
(renderId1 == "cached" && renderId2 != "cached") ||
@@ -930,7 +930,7 @@ void TileCacheTests::checkBlackTiles(std::shared_ptr<http::WebSocketSession>& so
return;
}
- const std::string firstLine = LOOLProtocol::getFirstLine(tile);
+ const std::string firstLine = COOLProtocol::getFirstLine(tile);
#if 0
std::fstream outStream("/tmp/black.png", std::ios::out);
@@ -944,7 +944,7 @@ void TileCacheTests::checkBlackTiles(std::shared_ptr<http::WebSocketSession>& so
checkBlackTile(streamTile);
}
-void TileCacheTests::checkBlackTiles(std::shared_ptr<LOOLWebSocket>& socket, const int /*part*/,
+void TileCacheTests::checkBlackTiles(std::shared_ptr<COOLWebSocket>& socket, const int /*part*/,
const int /*docWidth*/, const int /*docHeight*/,
const std::string& testname)
{
@@ -962,7 +962,7 @@ void TileCacheTests::checkBlackTiles(std::shared_ptr<LOOLWebSocket>& socket, con
return;
}
- const std::string firstLine = LOOLProtocol::getFirstLine(tile);
+ const std::string firstLine = COOLProtocol::getFirstLine(tile);
#if 0
std::fstream outStream("/tmp/black.png", std::ios::out);
@@ -1033,7 +1033,7 @@ void TileCacheTests::testTileInvalidateWriterPage()
const auto res = assertResponseString(socket, "invalidatetiles:", testname);
int part = -1;
LOK_ASSERT_MESSAGE("No part# in invalidatetiles message.",
- LOOLProtocol::getTokenIntegerFromMessage(res, "part", part));
+ COOLProtocol::getTokenIntegerFromMessage(res, "part", part));
LOK_ASSERT_EQUAL(0, part);
socket->asyncShutdown();
@@ -1193,12 +1193,12 @@ void TileCacheTests::testTileInvalidatePartCalc()
const auto response1 = assertResponseString(socket1, "invalidatetiles:", testname1);
int value1;
- LOOLProtocol::getTokenIntegerFromMessage(response1, "part", value1);
+ COOLProtocol::getTokenIntegerFromMessage(response1, "part", value1);
LOK_ASSERT_EQUAL(2, value1);
const auto response2 = assertResponseString(socket2, "invalidatetiles:", testname2);
int value2;
- LOOLProtocol::getTokenIntegerFromMessage(response2, "part", value2);
+ COOLProtocol::getTokenIntegerFromMessage(response2, "part", value2);
LOK_ASSERT_EQUAL(5, value2);
}
@@ -1242,12 +1242,12 @@ void TileCacheTests::testTileInvalidatePartImpress()
const auto response1 = assertResponseString(socket1, "invalidatetiles:", testname1);
int value1;
- LOOLProtocol::getTokenIntegerFromMessage(response1, "part", value1);
+ COOLProtocol::getTokenIntegerFromMessage(response1, "part", value1);
LOK_ASSERT_EQUAL(2, value1);
const auto response2 = assertResponseString(socket2, "invalidatetiles:", testname2);
int value2;
- LOOLProtocol::getTokenIntegerFromMessage(response2, "part", value2);
+ COOLProtocol::getTokenIntegerFromMessage(response2, "part", value2);
LOK_ASSERT_EQUAL(5, value2);
}
@@ -1418,7 +1418,7 @@ void TileCacheTests::requestTiles(std::shared_ptr<http::WebSocketSession>& socke
TST_LOG("requestTiles for " << testname << " finished.");
}
-void TileCacheTests::checkTiles(std::shared_ptr<LOOLWebSocket>& socket, const std::string& docType,
+void TileCacheTests::checkTiles(std::shared_ptr<COOLWebSocket>& socket, const std::string& docType,
const std::string& testname)
{
const std::string current = "current=";
@@ -1503,7 +1503,7 @@ void TileCacheTests::checkTiles(std::shared_ptr<LOOLWebSocket>& socket, const st
}
}
-void TileCacheTests::requestTiles(std::shared_ptr<LOOLWebSocket>& socket,
+void TileCacheTests::requestTiles(std::shared_ptr<COOLWebSocket>& socket,
const std::string& , const int part, const int docWidth,
const int docHeight, const std::string& testname)
{
diff --git a/test/UnitAdmin.cpp b/test/UnitAdmin.cpp
index 66caa77899..469d0d0a52 100644
--- a/test/UnitAdmin.cpp
+++ b/test/UnitAdmin.cpp
@@ -26,7 +26,7 @@
#include <Util.hpp>
#include <helpers.hpp>
-#define UNIT_URI "/loolwsd/unit-admin"
+#define UNIT_URI "/coolwsd/unit-admin"
using Poco::Net::HTTPBasicCredentials;
using Poco::Net::HTTPCookie;
@@ -42,14 +42,14 @@ private:
std::string _jwtCookie;
bool _isTestRunning = false;
const Poco::URI _uri;
- std::shared_ptr<LOOLWebSocket> _adminWs;
+ std::shared_ptr<COOLWebSocket> _adminWs;
typedef TestResult (UnitAdmin::*AdminTest)(void);
std::vector<AdminTest> _tests;
- std::shared_ptr<LOOLWebSocket> _docWs1;
- std::shared_ptr<LOOLWebSocket> _docWs2;
- std::shared_ptr<LOOLWebSocket> _docWs3;
+ std::shared_ptr<COOLWebSocket> _docWs1;
+ std::shared_ptr<COOLWebSocket> _docWs2;
+ std::shared_ptr<COOLWebSocket> _docWs3;
int _docPid1;
int _docPid2;
int _docPid3;
@@ -128,7 +128,7 @@ private:
HTTPRequest request(HTTPRequest::HTTP_GET, "/cool/adminws/");
std::unique_ptr<HTTPClientSession> session(UnitHTTP::createSession());
- _adminWs = std::make_shared<LOOLWebSocket>(*session, request, response);
+ _adminWs = std::make_shared<COOLWebSocket>(*session, request, response);
const std::string testMessage = "documents";
std::unique_lock<std::mutex> lock(_messageReceivedMutex);
_messageReceived.clear();
@@ -159,7 +159,7 @@ private:
HTTPRequest request(HTTPRequest::HTTP_GET, "/cool/adminws/");
std::unique_ptr<HTTPClientSession> session(UnitHTTP::createSession());
- _adminWs = std::make_shared<LOOLWebSocket>(*session, request, response);
+ _adminWs = std::make_shared<COOLWebSocket>(*session, request, response);
const std::string testMessage = "auth jwt=incorrectJWT";
std::unique_lock<std::mutex> lock(_messageReceivedMutex);
_messageReceived.clear();
@@ -190,7 +190,7 @@ private:
HTTPRequest request(HTTPRequest::HTTP_GET, "/cool/adminws/");
std::unique_ptr<HTTPClientSession> session(UnitHTTP::createSession());
- _adminWs = std::make_shared<LOOLWebSocket>(*session, request, response);
+ _adminWs = std::make_shared<COOLWebSocket>(*session, request, response);
const std::string authMessage = "auth jwt=" + _jwtCookie;
_adminWs->sendFrame(authMessage.data(), authMessage.size());
@@ -213,7 +213,7 @@ private:
std::unique_lock<std::mutex> lock(_messageReceivedMutex);
_messageReceived.clear();
- _docWs1 = std::make_shared<LOOLWebSocket>(*session1, request1, response1);
+ _docWs1 = std::make_shared<COOLWebSocket>(*session1, request1, response1);
_docWs1->sendFrame(loadMessage1.data(), loadMessage1.size());
if (_messageReceivedCV.wait_for(lock, std::chrono::milliseconds(_messageTimeoutMilliSeconds)) == std::cv_status::timeout)
{
@@ -241,7 +241,7 @@ private:
// Open another view of same document
lock.lock(); // lock _messageReceivedMutex
_messageReceived.clear();
- _docWs2 = std::make_shared<LOOLWebSocket>(*session2, request1, response1);
+ _docWs2 = std::make_shared<COOLWebSocket>(*session2, request1, response1);
_docWs2->sendFrame(loadMessage1.data(), loadMessage1.size());
if (_messageReceivedCV.wait_for(lock, std::chrono::milliseconds(_messageTimeoutMilliSeconds)) == std::cv_status::timeout)
{
@@ -276,7 +276,7 @@ private:
lock.lock(); // lock _messageReceivedMutex
_messageReceived.clear();
- _docWs3 = std::make_shared<LOOLWebSocket>(*session3, request2, response2);
+ _docWs3 = std::make_shared<COOLWebSocket>(*session3, request2, response2);
_docWs3->sendFrame(loadMessage2.data(), loadMessage2.size());
if (_messageReceivedCV.wait_for(lock, std::chrono::milliseconds(_messageTimeoutMilliSeconds)) == std::cv_status::timeout)
{
diff --git a/test/UnitBadDocLoad.cpp b/test/UnitBadDocLoad.cpp
index adf7902705..8620fd9e9b 100644
--- a/test/UnitBadDocLoad.cpp
+++ b/test/UnitBadDocLoad.cpp
@@ -24,7 +24,7 @@
// Include config.h last, so the test server URI is still HTTP, even in SSL builds.
#include <config.h>
-class LOOLWebSocket;
+class COOLWebSocket;
/// Test suite for bad document loading, etc.
class UnitBadDocLoad : public UnitWSD
@@ -50,7 +50,7 @@ UnitBase::TestResult UnitBadDocLoad::testBadDocLoadFail()
Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, documentURL);
Poco::URI uri(helpers::getTestServerURI());
Poco::Net::HTTPResponse httpResponse;
- std::shared_ptr<LOOLWebSocket> socket
+ std::shared_ptr<COOLWebSocket> socket
= helpers::connectLOKit(uri, request, httpResponse, testname);
// Send a load request with incorrect password
@@ -62,8 +62,8 @@ UnitBase::TestResult UnitBadDocLoad::testBadDocLoadFail()
std::string errorCommand;
std::string errorKind;
- LOOLProtocol::getTokenString(tokens[1], "cmd", errorCommand);
- LOOLProtocol::getTokenString(tokens[2], "kind", errorKind);
+ COOLProtocol::getTokenString(tokens[1], "cmd", errorCommand);
+ COOLProtocol::getTokenString(tokens[2], "kind", errorKind);
LOK_ASSERT_EQUAL(std::string("load"), errorCommand);
LOK_ASSERT_EQUAL(std::string("faileddocloading"), errorKind);
}
@@ -90,7 +90,7 @@ UnitBase::TestResult UnitBadDocLoad::testMaxDocuments()
try
{
// Load a document.
- std::vector<std::shared_ptr<LOOLWebSocket>> docs;
+ std::vector<std::shared_ptr<COOLWebSocket>> docs;
std::cerr << "Loading max number of documents: " << MAX_DOCUMENTS << std::endl;
for (int it = 1; it <= MAX_DOCUMENTS; ++it)
@@ -110,7 +110,7 @@ UnitBase::TestResult UnitBadDocLoad::testMaxDocuments()
Poco::URI uri(helpers::getTestServerURI());
std::unique_ptr<Poco::Net::HTTPClientSession> session(helpers::createSession(uri));
Poco::Net::HTTPResponse httpResponse;
- auto socket = std::make_shared<LOOLWebSocket>(*session, request, httpResponse);
+ auto socket = std::make_shared<COOLWebSocket>(*session, request, httpResponse);
// Send load request, which will fail.
helpers::sendTextFrame(socket, "load url=" + docURL, testname);
@@ -155,15 +155,15 @@ UnitBase::TestResult UnitBadDocLoad::testMaxConnections()
helpers::getDocumentPathAndURL("empty.odt", docPath, docURL, testname);
Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, docURL);
Poco::URI uri(helpers::getTestServerURI());
- std::shared_ptr<LOOLWebSocket> socket = helpers::loadDocAndGetSocket(uri, docURL, testname);
+ std::shared_ptr<COOLWebSocket> socket = helpers::loadDocAndGetSocket(uri, docURL, testname);
std::cerr << "Opened connection #1 of " << MAX_CONNECTIONS << std::endl;
- std::vector<std::shared_ptr<LOOLWebSocket>> views;
+ std::vector<std::shared_ptr<COOLWebSocket>> views;
for (int it = 1; it < MAX_CONNECTIONS; ++it)
{
std::unique_ptr<Poco::Net::HTTPClientSession> session(helpers::createSession(uri));
Poco::Net::HTTPResponse httpResponse;
- auto ws = std::make_shared<LOOLWebSocket>(*session, request, httpResponse);
+ auto ws = std::make_shared<COOLWebSocket>(*session, request, httpResponse);
views.emplace_back(ws);
std::cerr << "Opened connection #" << (it + 1) << " of " << MAX_CONNECTIONS
<< std::endl;
@@ -174,7 +174,7 @@ UnitBase::TestResult UnitBadDocLoad::testMaxConnections()
// try to connect MAX_CONNECTIONS + 1
std::unique_ptr<Poco::Net::HTTPClientSession> session(helpers::createSession(uri));
Poco::Net::HTTPResponse httpResponse;
- auto socketN = std::make_shared<LOOLWebSocket>(*session, request, httpResponse);
+ auto socketN = std::make_shared<COOLWebSocket>(*session, request, httpResponse);
// Send load request, which will fail.
helpers::sendTextFrame(socketN, "load url=" + docURL, testname);
@@ -217,10 +217,10 @@ UnitBase::TestResult UnitBadDocLoad::testMaxViews()
helpers::getDocumentPathAndURL("empty.odt", docPath, docURL, testname);
Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, docURL);
Poco::URI uri(helpers::getTestServerURI());
- std::shared_ptr<LOOLWebSocket> socket = helpers::loadDocAndGetSocket(uri, docURL, testname);
+ std::shared_ptr<COOLWebSocket> socket = helpers::loadDocAndGetSocket(uri, docURL, testname);
std::cerr << "Opened view #1 of " << MAX_CONNECTIONS << std::endl;
- std::vector<std::shared_ptr<LOOLWebSocket>> views;
+ std::vector<std::shared_ptr<COOLWebSocket>> views;
for (int it = 1; it < MAX_CONNECTIONS; ++it)
{
views.emplace_back(helpers::loadDocAndGetSocket(uri, docURL, testname));
@@ -232,7 +232,7 @@ UnitBase::TestResult UnitBadDocLoad::testMaxViews()
// try to connect MAX_CONNECTIONS + 1
std::unique_ptr<Poco::Net::HTTPClientSession> session(helpers::createSession(uri));
Poco::Net::HTTPResponse httpResponse;
- auto socketN = std::make_shared<LOOLWebSocket>(*session, request, httpResponse);
+ auto socketN = std::make_shared<COOLWebSocket>(*session, request, httpResponse);
// Send load request, which will fail.
helpers::sendTextFrame(socketN, "load url=" + docURL, testname);
diff --git a/test/UnitCalc.cpp b/test/UnitCalc.cpp
index f9d65a0aa3..18fa4c2336 100644
--- a/test/UnitCalc.cpp
+++ b/test/UnitCalc.cpp
@@ -21,7 +21,7 @@
#include <Unit.hpp>
#include <helpers.hpp>
-class LOOLWebSocket;
+class COOLWebSocket;
namespace
{
@@ -46,7 +46,7 @@ double getColRowSize(const std::string& property, const std::string& message, in
return item->getValue<double>("size");
}
-double getColRowSize(const std::shared_ptr<LOOLWebSocket>& socket, const std::string& item,
+double getColRowSize(const std::shared_ptr<COOLWebSocket>& socket, const std::string& item,
int index, const std::string& testname)
{
std::vector<char> response;
@@ -77,7 +77,7 @@ UnitBase::TestResult UnitCalc::testCalcEditRendering()
{
const char* testname = "calcEditRendering ";
Poco::URI uri(helpers::getTestServerURI());
- std::shared_ptr<LOOLWebSocket> socket
+ std::shared_ptr<COOLWebSocket> socket
= helpers::loadDocAndGetSocket("calc_render.xls", uri, testname);
helpers::sendTextFrame(socket, "mouse type=buttondown x=5000 y=5 count=1 buttons=1 modifier=0",
@@ -100,7 +100,7 @@ UnitBase::TestResult UnitCalc::testCalcEditRendering()
int minor = 0;
helpers::getServerVersion(socket, major, minor, testname);
- const std::string firstLine = LOOLProtocol::getFirstLine(tile);
+ const std::string firstLine = COOLProtocol::getFirstLine(tile);
std::vector<char> res(tile.begin() + firstLine.size() + 1, tile.end());
std::stringstream streamRes;
std::copy(res.begin(), res.end(), std::ostream_iterator<char>(streamRes));
@@ -155,7 +155,7 @@ UnitBase::TestResult UnitCalc::testCalcRenderAfterNewView51()
helpers::getDocumentPathAndURL("empty.ods", documentPath, documentURL, testname);
Poco::URI uri(helpers::getTestServerURI());
- std::shared_ptr<LOOLWebSocket> socket
+ std::shared_ptr<COOLWebSocket> socket
= helpers::loadDocAndGetSocket(uri, documentURL, testname);
int major = 0;
@@ -186,7 +186,7 @@ UnitBase::TestResult UnitCalc::testCalcRenderAfterNewView51()
// Connect second client, which will load at the top.
TST_LOG("Connecting second client.");
- std::shared_ptr<LOOLWebSocket> socket2
+ std::shared_ptr<COOLWebSocket> socket2
= helpers::loadDocAndGetSocket(uri, documentURL, testname);
// Up one row on the first view to trigger the bug.
@@ -211,7 +211,7 @@ UnitBase::TestResult UnitCalc::testCalcRenderAfterNewView53()
helpers::getDocumentPathAndURL("calc-render.ods", documentPath, documentURL, testname);
Poco::URI uri(helpers::getTestServerURI());
- std::shared_ptr<LOOLWebSocket> socket
+ std::shared_ptr<COOLWebSocket> socket
= helpers::loadDocAndGetSocket(uri, documentURL, testname);
int major = 0;
@@ -236,7 +236,7 @@ UnitBase::TestResult UnitCalc::testCalcRenderAfterNewView53()
// Connect second client, which will load at the top.
TST_LOG("Connecting second client.");
- std::shared_ptr<LOOLWebSocket> socket2
+ std::shared_ptr<COOLWebSocket> socket2
= helpers::loadDocAndGetSocket(uri, documentURL, testname);
TST_LOG("Waiting for cellviewcursor of second on first.");
@@ -265,7 +265,7 @@ UnitBase::TestResult UnitCalc::testColumnRowResize()
helpers::getDocumentPathAndURL("setclientpart.ods", documentPath, documentURL, testname);
Poco::URI uri(helpers::getTestServerURI());
- std::shared_ptr<LOOLWebSocket> socket
+ std::shared_ptr<COOLWebSocket> socket
= helpers::loadDocAndGetSocket(uri, documentURL, testname);
const std::string commandValues = "commandvalues command=.uno:ViewRowColumnHeaders";
@@ -372,7 +372,7 @@ UnitBase::TestResult UnitCalc::testOptimalResize()
std::string documentPath, documentURL;
helpers::getDocumentPathAndURL("empty.ods", documentPath, documentURL, testname);
Poco::URI uri(helpers::getTestServerURI());
- std::shared_ptr<LOOLWebSocket> socket
+ std::shared_ptr<COOLWebSocket> socket
= helpers::loadDocAndGetSocket(uri, documentURL, testname);
const std::string commandValues = "commandvalues command=.uno:ViewRowColumnHeaders";
diff --git a/test/UnitClient.cpp b/test/UnitClient.cpp
index 42812f7a0a..8abb53c799 100644
--- a/test/UnitClient.cpp
+++ b/test/UnitClient.cpp
@@ -13,7 +13,7 @@
#define TST_LOG_REDIRECT
#include <Unit.hpp>
-#include <wsd/LOOLWSD.hpp>
+#include <wsd/COOLWSD.hpp>
#include <test.hpp>
diff --git a/test/UnitClose.cpp b/test/UnitClose.cpp
index 54e8e5c78d..de69809527 100644
--- a/test/UnitClose.cpp
+++ b/test/UnitClose.cpp
@@ -25,7 +25,7 @@
// Include config.h last, so the test server URI is still HTTP, even in SSL builds.
#include <config.h>
-class LOOLWebSocket;
+class COOLWebSocket;
namespace
{
@@ -61,7 +61,7 @@ UnitBase::TestResult UnitClose::testCloseAfterClose()
{
TST_LOG("Connecting and loading.");
Poco::URI uri(helpers::getTestServerURI());
- std::shared_ptr<LOOLWebSocket> socket
+ std::shared_ptr<COOLWebSocket> socket
= helpers::loadDocAndGetSocket("hello.odt", uri, testname);
// send normal socket shutdown
@@ -116,7 +116,7 @@ UnitBase::TestResult UnitClose::testFontList()
{
// Load a document
Poco::URI uri(helpers::getTestServerURI());
- std::shared_ptr<LOOLWebSocket> socket
+ std::shared_ptr<COOLWebSocket> socket
= helpers::loadDocAndGetSocket("setclientpart.odp", uri, testname);
helpers::sendTextFrame(socket, "commandvalues command=.uno:CharFontName", testname);
@@ -144,7 +144,7 @@ UnitBase::TestResult UnitClose::testGraphicInvalidate()
{
// Load a document.
Poco::URI uri(helpers::getTestServerURI());
- std::shared_ptr<LOOLWebSocket> socket
+ std::shared_ptr<COOLWebSocket> socket
= helpers::loadDocAndGetSocket("shape.ods", uri, testname);
// Send click message
@@ -181,7 +181,7 @@ UnitBase::TestResult UnitClose::testAlertAllUsers()
const char* testname = "alertAllUsers ";
try
{
- std::shared_ptr<LOOLWebSocket> socket[4];
+ std::shared_ptr<COOLWebSocket> socket[4];
Poco::URI uri(helpers::getTestServerURI());
socket[0] = helpers::loadDocAndGetSocket("hello.odt", uri, testname);
@@ -197,10 +197,10 @@ UnitBase::TestResult UnitClose::testAlertAllUsers()
= helpers::assertResponseString(socket[i], "error:", testname);
StringVector tokens(Util::tokenize(response.substr(6), ' '));
std::string cmd;
- LOOLProtocol::getTokenString(tokens, "cmd", cmd);
+ COOLProtocol::getTokenString(tokens, "cmd", cmd);
LOK_ASSERT_EQUAL(std::string("internal"), cmd);
std::string kind;
- LOOLProtocol::getTokenString(tokens, "kind", kind);
+ COOLProtocol::getTokenString(tokens, "kind", kind);
LOK_ASSERT_EQUAL(std::string("diskfull"), kind);
}
}
diff --git a/test/UnitCopyPaste.cpp b/test/UnitCopyPaste.cpp
index 4581ac68e7..4ece40892c 100644
--- a/test/UnitCopyPaste.cpp
+++ b/test/UnitCopyPaste.cpp
@@ -15,7 +15,7 @@
#include <UnitHTTP.hpp>
#include <helpers.hpp>
#include <sstream>
-#include <wsd/LOOLWSD.hpp>
+#include <wsd/COOLWSD.hpp>
#include <common/Clipboard.hpp>
#include <wsd/ClientSession.hpp>
#include <net/WebSocketSession.hpp>
@@ -211,7 +211,7 @@ public:
std::shared_ptr<DocumentBroker> broker;
std::shared_ptr<ClientSession> clientSession;
- std::vector<std::shared_ptr<DocumentBroker>> brokers = LOOLWSD::getBrokersTestOnly();
+ std::vector<std::shared_ptr<DocumentBroker>> brokers = COOLWSD::getBrokersTestOnly();
assert(brokers.size() > 0);
broker = brokers[0];
auto sessions = broker->getSessionsTestOnlyUnsafe();
diff --git a/test/UnitCursor.cpp b/test/UnitCursor.cpp
index a175421ff9..3983700053 100644
--- a/test/UnitCursor.cpp
+++ b/test/UnitCursor.cpp
@@ -20,7 +20,7 @@
#include <Unit.hpp>
#include <helpers.hpp>
-class LOOLWebSocket;
+class COOLWebSocket;
namespace
{
@@ -45,7 +45,7 @@ void getCursor(const std::string& message, int& cursorX, int& cursorY, int& curs
LOK_ASSERT(cursorHeight >= 0);
}
-void limitCursor(const std::function<void(const std::shared_ptr<LOOLWebSocket>& socket, int cursorX,
+void limitCursor(const std::function<void(const std::shared_ptr<COOLWebSocket>& socket, int cursorX,
int cursorY, int cursorWidth, int cursorHeight,
int docWidth, int docHeight)>& keyhandler,
const std::function<void(int docWidth, int docHeight, int newWidth,
@@ -69,7 +69,7 @@ void limitCursor(const std::function<void(const std::shared_ptr<LOOLWebSocket>&
std::string response;
Poco::URI uri(helpers::getTestServerURI());
- std::shared_ptr<LOOLWebSocket> socket
+ std::shared_ptr<COOLWebSocket> socket
= helpers::loadDocAndGetSocket("empty.ods", uri, testname);
// check document size
@@ -126,7 +126,7 @@ UnitBase::TestResult UnitCursor::testMaxColumn()
{
limitCursor(
// move cursor to last column
- [](const std::shared_ptr<LOOLWebSocket>& socket, int cursorX, int cursorY,
+ [](const std::shared_ptr<COOLWebSocket>& socket, int cursorX, int cursorY,
int cursorWidth, int cursorHeight, int docWidth, int docHeight) {
LOK_ASSERT(cursorX >= 0);
LOK_ASSERT(cursorY >= 0);
@@ -162,7 +162,7 @@ UnitBase::TestResult UnitCursor::testMaxRow()
{
limitCursor(
// move cursor to last row
- [](const std::shared_ptr<LOOLWebSocket>& socket, int cursorX, int cursorY,
+ [](const std::shared_ptr<COOLWebSocket>& socket, int cursorX, int cursorY,
int cursorWidth, int cursorHeight, int docWidth, int docHeight) {
LOK_ASSERT(cursorX >= 0);
LOK_ASSERT(cursorY >= 0);
@@ -200,7 +200,7 @@ UnitBase::TestResult UnitCursor::testInsertAnnotationWriter()
helpers::getDocumentPathAndURL("hello.odt", documentPath, documentURL, testname);
Poco::URI uri(helpers::getTestServerURI());
- std::shared_ptr<LOOLWebSocket> socket
+ std::shared_ptr<COOLWebSocket> socket
= helpers::loadDocAndGetSocket(uri, documentURL, testname);
// Insert comment.
@@ -251,7 +251,7 @@ UnitBase::TestResult UnitCursor::testInsertAnnotationWriter()
socket->shutdown();
// Make sure the document is fully unloaded.
- // testNoExtraLoolKitsLeft();
+ // testNoExtraCoolKitsLeft();
TST_LOG("Reloading ");
socket = helpers::loadDocAndGetSocket(uri, documentURL, testname);
@@ -291,7 +291,7 @@ UnitBase::TestResult UnitCursor::testEditAnnotationWriter()
helpers::getDocumentPathAndURL("with_comment.odt", documentPath, documentURL, testname);
Poco::URI uri(helpers::getTestServerURI());
- std::shared_ptr<LOOLWebSocket> socket
+ std::shared_ptr<COOLWebSocket> socket
= helpers::loadDocAndGetSocket(uri, documentURL, testname);
// Click in the body.
@@ -320,7 +320,7 @@ UnitBase::TestResult UnitCursor::testEditAnnotationWriter()
LOK_ASSERT_EQUAL(
std::string("textselectioncontent: and now for something completely different"), res);
- // const int kitcount = getLoolKitProcessCount();
+ // const int kitcount = getCoolKitProcessCount();
// Close and reopen the same document and test again.
TST_LOG("Closing connection after pasting.");
@@ -330,7 +330,7 @@ UnitBase::TestResult UnitCursor::testEditAnnotationWriter()
socket = helpers::loadDocAndGetSocket(uri, documentURL, testname);
// Should have no new instances.
- // CPPUNIT_ASSERT_EQUAL(kitcount, countLoolKitProcesses(kitcount));
+ // CPPUNIT_ASSERT_EQUAL(kitcount, countCoolKitProcesses(kitcount));
// Confirm that the text is in the comment and not doc body.
// Click in the body.
@@ -363,7 +363,7 @@ UnitBase::TestResult UnitCursor::testInsertAnnotationCalc()
{
const char* testname = "insertAnnotationCalc ";
Poco::URI uri(helpers::getTestServerURI());
- std::shared_ptr<LOOLWebSocket> socket
+ std::shared_ptr<COOLWebSocket> socket
= helpers::loadDocAndGetSocket("setclientpart.ods", uri, testname);
// Insert comment.
diff --git a/test/UnitEachView.cpp b/test/UnitEachView.cpp
index 9fd07bdbeb..580da4fec9 100644
--- a/test/UnitEachView.cpp
+++ b/test/UnitEachView.cpp
@@ -20,7 +20,7 @@
// Include config.h last, so the test server URI is still HTTP, even in SSL builds.
#include <config.h>
-class LOOLWebSocket;
+class COOLWebSocket;
namespace
{
@@ -37,7 +37,7 @@ void testEachView(const std::string& doc, const std::string& type, const std::st
helpers::getDocumentPathAndURL(doc, documentPath, documentURL, testname);
int itView = 0;
- std::shared_ptr<LOOLWebSocket> socket = helpers::loadDocAndGetSocket(
+ std::shared_ptr<COOLWebSocket> socket = helpers::loadDocAndGetSocket(
Poco::URI(helpers::getTestServerURI()), documentURL, Poco::format(view, itView));
// Check document size
@@ -68,7 +68,7 @@ void testEachView(const std::string& doc, const std::string& type, const std::st
LOK_ASSERT_MESSAGE(Poco::format(error, itView, protocol), !response.empty());
// Connect and load 0..N Views, where N<=limit
- std::vector<std::shared_ptr<LOOLWebSocket>> views;
+ std::vector<std::shared_ptr<COOLWebSocket>> views;
static_assert(MAX_DOCUMENTS >= 2, "MAX_DOCUMENTS must be at least 2");
const int limit = std::min(4, MAX_DOCUMENTS - 1); // +1 connection above
for (itView = 0; itView < limit; ++itView)
diff --git a/test/UnitHTTP.cpp b/test/UnitHTTP.cpp
index 0731e9bf2e..4871b41ec0 100644
--- a/test/UnitHTTP.cpp
+++ b/test/UnitHTTP.cpp
@@ -122,7 +122,7 @@ public:
socket,
"POST /cool/convert-to/txt HTTP/1.1\r\n"
"Host: localhost:9980\r\n"
- "User-Agent: looltests/1.2.3\r\n"
+ "User-Agent: cooltests/1.2.3\r\n"
"Accept: */*\r\n"
"Expect: 100-continue\r\n"
"Transfer-Encoding: chunked\r\n"
diff --git a/test/UnitHTTP.hpp b/test/UnitHTTP.hpp
index 33b55ce93b..0dde381281 100644
--- a/test/UnitHTTP.hpp
+++ b/test/UnitHTTP.hpp
@@ -18,7 +18,7 @@
#include <Poco/Version.h>
#include "Common.hpp"
-#include <tools/LOOLWebSocket.hpp>
+#include <tools/COOLWebSocket.hpp>
using Poco::Net::SocketAddress;
using Poco::Net::HTTPServerParams;
@@ -122,7 +122,7 @@ namespace UnitHTTP
class UnitWebSocket
{
Poco::Net::HTTPClientSession* _session;
- LOOLWebSocket* _socket;
+ COOLWebSocket* _socket;
public:
/// Get a websocket connected for a given URL
@@ -135,7 +135,7 @@ public:
_session = UnitHTTP::createSession();
// FIXME: leaking the session - hey ho ... do we need a UnitSocket ?
- _socket = new LOOLWebSocket(*_session, request, response);
+ _socket = new COOLWebSocket(*_session, request, response);
} catch (const Poco::Exception &ex) {
std::cerr << "Exception creating websocket " << ex.displayText() << std::endl;
throw;
@@ -148,7 +148,7 @@ public:
delete _session;
}
- LOOLWebSocket* getLOOLWebSocket() const
+ COOLWebSocket* getCOOLWebSocket() const
{
return _socket;
}
diff --git a/test/UnitHosting.cpp b/test/UnitHosting.cpp
index 5246b801c1..a369c4b5a0 100644
--- a/test/UnitHosting.cpp
+++ b/test/UnitHosting.cpp
@@ -27,7 +27,7 @@
#include <Unit.hpp>
#include <helpers.hpp>
-class LOOLWebSocket;
+class COOLWebSocket;
/// Test suite for /hosting, etc.
class UnitHosting : public UnitWSD
diff --git a/test/UnitInsertDelete.cpp b/test/UnitInsertDelete.cpp
index 9b1c2aae57..debf7e2690 100644
--- a/test/UnitInsertDelete.cpp
+++ b/test/UnitInsertDelete.cpp
@@ -21,7 +21,7 @@
#include <Unit.hpp>
#include <helpers.hpp>
-class LOOLWebSocket;
+class COOLWebSocket;
namespace
{
@@ -101,7 +101,7 @@ UnitBase::TestResult UnitInsertDelete::testInsertDelete()
Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, documentURL);
Poco::URI uri(helpers::getTestServerURI());
Poco::Net::HTTPResponse httpResponse;
- std::shared_ptr<LOOLWebSocket> socket
+ std::shared_ptr<COOLWebSocket> socket
= helpers::connectLOKit(uri, request, httpResponse, testname);
helpers::sendTextFrame(socket, "load url=" + documentURL);
@@ -206,7 +206,7 @@ UnitBase::TestResult UnitInsertDelete::testPasteBlank()
{
// Load a document and make it empty, then paste nothing into it.
Poco::URI uri(helpers::getTestServerURI());
- std::shared_ptr<LOOLWebSocket> socket
+ std::shared_ptr<COOLWebSocket> socket
= helpers::loadDocAndGetSocket("hello.odt", uri, testname);
helpers::deleteAll(socket, testname);
@@ -234,9 +234,9 @@ UnitBase::TestResult UnitInsertDelete::testGetTextSelection()
helpers::getDocumentPathAndURL("hello.odt", documentPath, documentURL, testname);
Poco::URI uri(helpers::getTestServerURI());
- std::shared_ptr<LOOLWebSocket> socket
+ std::shared_ptr<COOLWebSocket> socket
= helpers::loadDocAndGetSocket(uri, documentURL, testname);
- std::shared_ptr<LOOLWebSocket> socket2
+ std::shared_ptr<COOLWebSocket> socket2
= helpers::loadDocAndGetSocket(uri, documentURL, testname);
static const std::string expected = "Hello world";
@@ -263,7 +263,7 @@ UnitBase::TestResult UnitInsertDelete::testCursorPosition()
helpers::getDocumentPathAndURL("Example.odt", docPath, docURL, testname);
Poco::URI uri(helpers::getTestServerURI());
- std::shared_ptr<LOOLWebSocket> socket0
+ std::shared_ptr<COOLWebSocket> socket0
= helpers::loadDocAndGetSocket(uri, docURL, testname);
// receive cursor position
@@ -279,7 +279,7 @@ UnitBase::TestResult UnitInsertDelete::testCursorPosition()
LOK_ASSERT_EQUAL(static_cast<size_t>(4), cursorTokens.size());
// Create second view
- std::shared_ptr<LOOLWebSocket> socket1
+ std::shared_ptr<COOLWebSocket> socket1
= helpers::loadDocAndGetSocket(uri, docURL, testname);
//receive view cursor position
diff --git a/test/UnitLargePaste.cpp b/test/UnitLargePaste.cpp
index 4607256317..3ad1f92e7a 100644
--- a/test/UnitLargePaste.cpp
+++ b/test/UnitLargePaste.cpp
@@ -17,7 +17,7 @@
#include <Util.hpp>
#include <helpers.hpp>
-class LOOLWebSocket;
+class COOLWebSocket;
/// Large paste testcase.
class UnitLargePaste : public UnitWSD
@@ -38,7 +38,7 @@ void UnitLargePaste::invokeWSDTest()
std::string documentPath;
std::string documentURL;
helpers::getDocumentPathAndURL("hello.odt", documentPath, documentURL, testname);
- std::shared_ptr<LOOLWebSocket> socket = helpers::loadDocAndGetSocket(
+ std::shared_ptr<COOLWebSocket> socket = helpers::loadDocAndGetSocket(
Poco::URI(helpers::getTestServerURI()), documentURL, testname);
helpers::sendTextFrame(socket, "uno .uno:SelectAll", testname);
diff --git a/test/UnitLoad.cpp b/test/UnitLoad.cpp
index 6d82e338ee..27288d0cb1 100644
--- a/test/UnitLoad.cpp
+++ b/test/UnitLoad.cpp
@@ -24,7 +24,7 @@
#include <helpers.hpp>
#include <net/WebSocketSession.hpp>
-class LOOLWebSocket;
+class COOLWebSocket;
namespace
{
@@ -37,7 +37,7 @@ void loadDoc(const std::string& documentURL, const std::string& testname)
Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, documentURL);
Poco::URI uri(helpers::getTestServerURI());
Poco::Net::HTTPResponse response;
- std::shared_ptr<LOOLWebSocket> socket
+ std::shared_ptr<COOLWebSocket> socket
= helpers::connectLOKit(uri, request, response, testname);
helpers::sendTextFrame(socket, "load url=" + documentURL, testname);
@@ -85,7 +85,7 @@ UnitBase::TestResult UnitLoad::testConnectNoLoad()
TST_LOG_NAME(testname1, "Connecting first to disconnect without loading.");
Poco::Net::HTTPResponse response;
Poco::URI uri(helpers::getTestServerURI());
- std::shared_ptr<LOOLWebSocket> socket
+ std::shared_ptr<COOLWebSocket> socket
= helpers::connectLOKit(uri, request, response, testname1);
LOK_ASSERT_MESSAGE("Failed to connect.", socket);
TST_LOG_NAME(testname1, "Disconnecting first.");
@@ -95,7 +95,7 @@ UnitBase::TestResult UnitLoad::testConnectNoLoad()
// Connect and load first view.
TST_LOG_NAME(testname2, "Connecting second to load first view.");
- std::shared_ptr<LOOLWebSocket> socket1
+ std::shared_ptr<COOLWebSocket> socket1
= helpers::connectLOKit(uri, request, response, testname2);
LOK_ASSERT_MESSAGE("Failed to connect.", socket1);
helpers::sendTextFrame(socket1, "load url=" + documentURL, testname2);
@@ -104,7 +104,7 @@ UnitBase::TestResult UnitLoad::testConnectNoLoad()
// Connect but don't load second view.
TST_LOG_NAME(testname3, "Connecting third to disconnect without loading.");
- std::shared_ptr<LOOLWebSocket> socket2
+ std::shared_ptr<COOLWebSocket> socket2
= helpers::connectLOKit(uri, request, response, testname3);
LOK_ASSERT_MESSAGE("Failed to connect.", socket2);
TST_LOG_NAME(testname3, "Disconnecting third.");
@@ -141,7 +141,7 @@ UnitBase::TestResult UnitLoad::testBadLoad()
Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, documentURL);
Poco::URI uri(helpers::getTestServerURI());
Poco::Net::HTTPResponse response;
- std::shared_ptr<LOOLWebSocket> socket
+ std::shared_ptr<COOLWebSocket> socket
= helpers::connectLOKit(uri, request, response, testname);
// Before loading request status.
@@ -164,7 +164,7 @@ UnitBase::TestResult UnitLoad::testExcelLoad()
{
// Load a document and get status.
Poco::URI uri(helpers::getTestServerURI());
- std::shared_ptr<LOOLWebSocket> socket
+ std::shared_ptr<COOLWebSocket> socket
= helpers::loadDocAndGetSocket("timeline.xlsx", uri, testname);
helpers::sendTextFrame(socket, "status", testname);
diff --git a/test/UnitLoadTorture.cpp b/test/UnitLoadTorture.cpp
index 8cc4736e52..284cd84aa2 100644
--- a/test/UnitLoadTorture.cpp
+++ b/test/UnitLoadTorture.cpp
@@ -20,7 +20,7 @@
#include <helpers.hpp>
#include <net/WebSocketSession.hpp>
-class LOOLWebSocket;
+class COOLWebSocket;
/// Load torture testcase.
class UnitLoadTorture : public UnitWSD
@@ -74,10 +74,10 @@ int UnitLoadTorture::loadTorture(const std::string& testname, const std::string&
// 20s is double of the default.
std::vector<char> message
= wsSession->waitForMessage("status:", std::chrono::seconds(20), testname + id + ' ');
- const std::string status = LOOLProtocol::getFirstLine(message);
+ const std::string status = COOLProtocol::getFirstLine(message);
int viewid = -1;
- LOOLProtocol::getTokenIntegerFromMessage(status, "viewid", viewid);
+ COOLProtocol::getTokenIntegerFromMessage(status, "viewid", viewid);
sum_view_ids += viewid;
++num_of_views;
--num_to_load;
diff --git a/test/UnitOAuth.cpp b/test/UnitOAuth.cpp
index 370340a264..9dd210e0fd 100644
--- a/test/UnitOAuth.cpp
+++ b/test/UnitOAuth.cpp
@@ -100,7 +100,7 @@ public:
else
initWebsocket("/wopi/files/1?access_header=Authorization: Basic basic==");
- helpers::sendTextFrame(*getWs()->getLOOLWebSocket(), "load url=" + getWopiSrc(), testName);
+ helpers::sendTextFrame(*getWs()->getCOOLWebSocket(), "load url=" + getWopiSrc(), testName);
SocketPoll::wakeupWorld();
if (_phase == Phase::LoadToken)
diff --git a/test/UnitPasswordProtected.cpp b/test/UnitPasswordProtected.cpp
index d2705346d0..63696a3bae 100644
--- a/test/UnitPasswordProtected.cpp
+++ b/test/UnitPasswordProtected.cpp
@@ -17,7 +17,7 @@
#include <Util.hpp>
#include <helpers.hpp>
-class LOOLWebSocket;
+class COOLWebSocket;
/// Password protected testcase.
class UnitPasswordProtected : public UnitWSD
@@ -44,7 +44,7 @@ UnitBase::TestResult UnitPasswordProtected::testPasswordProtectedDocumentWithout
Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, documentURL);
Poco::Net::HTTPResponse httpResponse;
- std::shared_ptr<LOOLWebSocket> socket = helpers::connectLOKit(
+ std::shared_ptr<COOLWebSocket> socket = helpers::connectLOKit(
Poco::URI(helpers::getTestServerURI()), request, httpResponse, testname);
// Send a load request without password first
@@ -56,8 +56,8 @@ UnitBase::TestResult UnitPasswordProtected::testPasswordProtectedDocumentWithout
std::string errorCommand;
std::string errorKind;
- LOOLProtocol::getTokenString(tokens[1], "cmd", errorCommand);
- LOOLProtocol::getTokenString(tokens[2], "kind", errorKind);
+ COOLProtocol::getTokenString(tokens[1], "cmd", errorCommand);
+ COOLProtocol::getTokenString(tokens[2], "kind", errorKind);
LOK_ASSERT_EQUAL(std::string("load"), errorCommand);
LOK_ASSERT_EQUAL(std::string("passwordrequired:to-view"), errorKind);
}
@@ -80,7 +80,7 @@ UnitBase::TestResult UnitPasswordProtected::testPasswordProtectedDocumentWithWro
Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, documentURL);
Poco::Net::HTTPResponse httpResponse;
- std::shared_ptr<LOOLWebSocket> socket = helpers::connectLOKit(
+ std::shared_ptr<COOLWebSocket> socket = helpers::connectLOKit(
Poco::URI(helpers::getTestServerURI()), request, httpResponse, testname);
// Send a load request with incorrect password
@@ -92,8 +92,8 @@ UnitBase::TestResult UnitPasswordProtected::testPasswordProtectedDocumentWithWro
std::string errorCommand;
std::string errorKind;
- LOOLProtocol::getTokenString(tokens[1], "cmd", errorCommand);
- LOOLProtocol::getTokenString(tokens[2], "kind", errorKind);
+ COOLProtocol::getTokenString(tokens[1], "cmd", errorCommand);
+ COOLProtocol::getTokenString(tokens[2], "kind", errorKind);
LOK_ASSERT_EQUAL(std::string("load"), errorCommand);
LOK_ASSERT_EQUAL(std::string("wrongpassword"), errorKind);
}
@@ -116,7 +116,7 @@ UnitBase::TestResult UnitPasswordProtected::testPasswordProtectedDocumentWithCor
Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, documentURL);
Poco::Net::HTTPResponse response;
- std::shared_ptr<LOOLWebSocket> socket = helpers::connectLOKit(
+ std::shared_ptr<COOLWebSocket> socket = helpers::connectLOKit(
Poco::URI(helpers::getTestServerURI()), request, response, testname);
// Send a load request with correct password
@@ -149,7 +149,7 @@ UnitBase::TestResult UnitPasswordProtected::testPasswordProtectedOOXMLDocument()
Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, documentURL);
Poco::Net::HTTPResponse response;
- std::shared_ptr<LOOLWebSocket> socket = helpers::connectLOKit(
+ std::shared_ptr<COOLWebSocket> socket = helpers::connectLOKit(
Poco::URI(helpers::getTestServerURI()), request, response, testname);
// Send a load request with correct password
@@ -177,7 +177,7 @@ UnitBase::TestResult UnitPasswordProtected::testPasswordProtectedBinaryMSOfficeD
Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, documentURL);
Poco::Net::HTTPResponse response;
- std::shared_ptr<LOOLWebSocket> socket = helpers::connectLOKit(
+ std::shared_ptr<COOLWebSocket> socket = helpers::connectLOKit(
Poco::URI(helpers::getTestServerURI()), request, response, testname);
// Send a load request with correct password
diff --git a/test/UnitPaste.cpp b/test/UnitPaste.cpp
index b82e702011..3dda9adf2b 100644
--- a/test/UnitPaste.cpp
+++ b/test/UnitPaste.cpp
@@ -17,7 +17,7 @@
#include <Util.hpp>
#include <helpers.hpp>
-class LOOLWebSocket;
+class COOLWebSocket;
/// Paste testcase.
class UnitPaste : public UnitWSD
@@ -34,7 +34,7 @@ void UnitPaste::invokeWSDTest()
std::string documentPath;
std::string documentURL;
helpers::getDocumentPathAndURL("hello.odt", documentPath, documentURL, testname);
- std::shared_ptr<LOOLWebSocket> socket = helpers::loadDocAndGetSocket(
+ std::shared_ptr<COOLWebSocket> socket = helpers::loadDocAndGetSocket(
Poco::URI(helpers::getTestServerURI()), documentURL, testname);
for (int i = 0; i < 5; ++i)
diff --git a/test/UnitPrefork.cpp b/test/UnitPrefork.cpp
index 12d4c02cc3..1971640317 100644
--- a/test/UnitPrefork.cpp
+++ b/test/UnitPrefork.cpp
@@ -8,7 +8,7 @@
#include <config.h>
#include <Unit.hpp>
-#include <wsd/LOOLWSD.hpp>
+#include <wsd/COOLWSD.hpp>
const int NumToPrefork = 20;
diff --git a/test/UnitRenderSearchResult.cpp b/test/UnitRenderSearchResult.cpp
index c69cf769f1..8b89879945 100644
--- a/test/UnitRenderSearchResult.cpp
+++ b/test/UnitRenderSearchResult.cpp
@@ -17,7 +17,7 @@
#include <Util.hpp>
#include <helpers.hpp>
-class LOOLWebSocket;
+class COOLWebSocket;
class UnitRenderSearchResult : public UnitWSD
{
@@ -35,7 +35,7 @@ void UnitRenderSearchResult::invokeWSDTest()
std::string documentURL;
helpers::getDocumentPathAndURL("RenderSearchResultTest.odt", documentPath, documentURL, testname);
- std::shared_ptr<LOOLWebSocket> socket = helpers::loadDocAndGetSocket(Poco::URI(helpers::getTestServerURI()), documentURL, testname);
+ std::shared_ptr<COOLWebSocket> socket = helpers::loadDocAndGetSocket(Poco::URI(helpers::getTestServerURI()), documentURL, testname);
helpers::sendTextFrame(socket, "rendersearchresult <indexing><paragraph node_type=\"writer\" index=\"19\"/></indexing>");
std::vector<char> responseMessage = helpers::getResponseMessage(socket, "rendersearchresult:", testname);
diff --git a/test/UnitRenderShape.cpp b/test/UnitRenderShape.cpp
index d38c8a72e7..b1aba8e917 100644
--- a/test/UnitRenderShape.cpp
+++ b/test/UnitRenderShape.cpp
@@ -17,7 +17,7 @@
#include <Util.hpp>
#include <helpers.hpp>
-class LOOLWebSocket;
+class COOLWebSocket;
namespace
{
@@ -85,7 +85,7 @@ UnitBase::TestResult UnitRenderShape::testRenderShapeSelectionImpress()
std::string documentPath, documentURL;
helpers::getDocumentPathAndURL("shapes.odp", documentPath, documentURL, testname);
- std::shared_ptr<LOOLWebSocket> socket = helpers::loadDocAndGetSocket(
+ std::shared_ptr<COOLWebSocket> socket = helpers::loadDocAndGetSocket(
Poco::URI(helpers::getTestServerURI()), documentURL, testname);
int major = 0;
@@ -128,7 +128,7 @@ UnitBase::TestResult UnitRenderShape::testRenderShapeSelectionWriterImage()
std::string documentPath, documentURL;
helpers::getDocumentPathAndURL("non-shape-image.odt", documentPath, documentURL, testname);
- std::shared_ptr<LOOLWebSocket> socket = helpers::loadDocAndGetSocket(
+ std::shared_ptr<COOLWebSocket> socket = helpers::loadDocAndGetSocket(
Poco::URI(helpers::getTestServerURI()), documentURL, testname);
// Select the shape with SHIFT + F4
diff --git a/test/UnitRenderingOptions.cpp b/test/UnitRenderingOptions.cpp
index 9c3d2e0d54..c7ce361593 100644
--- a/test/UnitRenderingOptions.cpp
+++ b/test/UnitRenderingOptions.cpp
@@ -17,7 +17,7 @@
#include <Util.hpp>
#include <helpers.hpp>
-class LOOLWebSocket;
+class COOLWebSocket;
/// Rendering options testcase.
class UnitRenderingOptions : public UnitWSD
@@ -42,7 +42,7 @@ void UnitRenderingOptions::invokeWSDTest()
Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, documentURL);
Poco::Net::HTTPResponse response;
- std::shared_ptr<LOOLWebSocket> socket = helpers::connectLOKit(
+ std::shared_ptr<COOLWebSocket> socket = helpers::connectLOKit(
Poco::URI(helpers::getTestServerURI()), request, response, testname);
helpers::sendTextFrame(socket, "load url=" + documentURL + " options=" + options);
diff --git a/test/UnitSession.cpp b/test/UnitSession.cpp
index 54dfe59059..c6808f9b84 100644
--- a/test/UnitSession.cpp
+++ b/test/UnitSession.cpp
@@ -24,7 +24,7 @@
#include <Util.hpp>
#include <helpers.hpp>
-class LOOLWebSocket;
+class COOLWebSocket;
namespace
{
@@ -107,27 +107,27 @@ UnitBase::TestResult UnitSession::testHandshake()
Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, documentURL);
std::unique_ptr<Poco::Net::HTTPClientSession> session(
helpers::createSession(Poco::URI(helpers::getTestServerURI())));
- LOOLWebSocket socket(*session, request, response);
+ COOLWebSocket socket(*session, request, response);
socket.setReceiveTimeout(0);
int flags = 0;
char buffer[1024] = { 0 };
int bytes = socket.receiveFrame(buffer, sizeof(buffer), flags);
- TST_LOG("Got " << LOOLWebSocket::getAbbreviatedFrameDump(buffer, bytes, flags));
+ TST_LOG("Got " << COOLWebSocket::getAbbreviatedFrameDump(buffer, bytes, flags));
LOK_ASSERT_MESSAGE(
"Expected 'statusindicator: find' response from the server but got nothing.",
bytes > 0);
LOK_ASSERT_EQUAL(std::string("statusindicator: find"), std::string(buffer, bytes));
bytes = socket.receiveFrame(buffer, sizeof(buffer), flags);
- TST_LOG("Got " << LOOLWebSocket::getAbbreviatedFrameDump(buffer, bytes, flags));
+ TST_LOG("Got " << COOLWebSocket::getAbbreviatedFrameDump(buffer, bytes, flags));
if (bytes > 0 && !std::strstr(buffer, "error:"))
{
LOK_ASSERT_EQUAL(std::string("statusindicator: connect"),
std::string(buffer, bytes));
bytes = socket.receiveFrame(buffer, sizeof(buffer), flags);
- TST_LOG("Got " << LOOLWebSocket::getAbbreviatedFrameDump(buffer, bytes, flags));
+ TST_LOG("Got " << COOLWebSocket::getAbbreviatedFrameDump(buffer, bytes, flags));
if (!std::strstr(buffer, "error:"))
{
LOK_ASSERT_EQUAL(std::string("statusindicator: ready"),
@@ -140,7 +140,7 @@ UnitBase::TestResult UnitSession::testHandshake()
// close frame message
bytes = socket.receiveFrame(buffer, sizeof(buffer), flags);
- TST_LOG("Got " << LOOLWebSocket::getAbbreviatedFrameDump(buffer, bytes, flags));
+ TST_LOG("Got " << COOLWebSocket::getAbbreviatedFrameDump(buffer, bytes, flags));
LOK_ASSERT((flags & Poco::Net::WebSocket::FRAME_OP_BITMASK)
== Poco::Net::WebSocket::FRAME_OP_CLOSE);
}
@@ -152,7 +152,7 @@ UnitBase::TestResult UnitSession::testHandshake()
// close frame message
bytes = socket.receiveFrame(buffer, sizeof(buffer), flags);
- TST_LOG("Got " << LOOLWebSocket::getAbbreviatedFrameDump(buffer, bytes, flags));
+ TST_LOG("Got " << COOLWebSocket::getAbbreviatedFrameDump(buffer, bytes, flags));
LOK_ASSERT((flags & Poco::Net::WebSocket::FRAME_OP_BITMASK)
== Poco::Net::WebSocket::FRAME_OP_CLOSE);
}
@@ -177,7 +177,7 @@ UnitBase::TestResult UnitSession::testSlideShow()
Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, documentURL);
Poco::Net::HTTPResponse httpResponse;
- std::shared_ptr<LOOLWebSocket> socket = helpers::connectLOKit(
+ std::shared_ptr<COOLWebSocket> socket = helpers::connectLOKit(
Poco::URI(helpers::getTestServerURI()), request, httpResponse, testname);
helpers::sendTextFrame(socket, "load url=" + documentURL, testname);
diff --git a/test/UnitStorage.cpp b/test/UnitStorage.cpp
index 8b6eef556a..85ab78fa3e 100644
--- a/test/UnitStorage.cpp
+++ b/test/UnitStorage.cpp
@@ -47,7 +47,7 @@ public:
assert(_ws.get());
int flags = 0, len;;
char reply[4096];
- while ((len = _ws->getLOOLWebSocket()->receiveFrame(reply, sizeof(reply) - 1, flags)) > 0)
+ while ((len = _ws->getCOOLWebSocket()->receiveFrame(reply, sizeof(reply) - 1, flags)) > 0)
{
reply[len] = '\0';
if (bExpectFailure &&
diff --git a/test/UnitTiffLoad.cpp b/test/UnitTiffLoad.cpp
index c48e774275..1717d3d309 100644
--- a/test/UnitTiffLoad.cpp
+++ b/test/UnitTiffLoad.cpp
@@ -17,7 +17,7 @@
#include <Util.hpp>
#include <helpers.hpp>
-class LOOLWebSocket;
+class COOLWebSocket;
/// TIFF load testcase.
class UnitTiffLoad : public UnitWSD
@@ -38,7 +38,7 @@ void UnitTiffLoad::invokeWSDTest()
std::string documentPath;
std::string documentURL;
helpers::getDocumentPathAndURL("tiff.odt", documentPath, documentURL, testname);
- std::shared_ptr<LOOLWebSocket> socket = helpers::loadDocAndGetSocket(
+ std::shared_ptr<COOLWebSocket> socket = helpers::loadDocAndGetSocket(
Poco::URI(helpers::getTestServerURI()), documentURL, testname);
// Select the image.
diff --git a/test/UnitTyping.cpp b/test/UnitTyping.cpp
index 3ef8754491..4a8e6d3c1f 100644
--- a/test/UnitTyping.cpp
+++ b/test/UnitTyping.cpp
@@ -17,7 +17,7 @@
#include <Unit.hpp>
#include <UnitHTTP.hpp>
#include <helpers.hpp>
-#include <LOOLWSD.hpp>
+#include <COOLWSD.hpp>
#include <wsd/TileDesc.hpp>
@@ -53,7 +53,7 @@ public:
TestResult testWriterTyping()
{
const char* testname = "writerCompositionTest ";
- std::string serverURL = LOOLWSD::getServerURL();
+ std::string serverURL = COOLWSD::getServerURL();
const Poco::URI uri(serverURL);
LOG_TRC("test writer typing");
@@ -63,7 +63,7 @@ public:
helpers::getDocumentPathAndURL(
"empty.odt", documentPath, documentURL, testname);
- std::shared_ptr<LOOLWebSocket> socket = helpers::loadDocAndGetSocket(uri, documentURL, testname);
+ std::shared_ptr<COOLWebSocket> socket = helpers::loadDocAndGetSocket(uri, documentURL, testname);
// We input two Bopomofo (Mandarin Phonetic Symbols) characters and a grave accent using
// textinput messages and then delete them and then input a fourth character. Apparently
@@ -225,7 +225,7 @@ public:
TestResult testCalcTyping()
{
const char* testname = "calcMultiViewEdit ";
- std::string serverURL = LOOLWSD::getServerURL();
+ std::string serverURL = COOLWSD::getServerURL();
const Poco::URI uri(serverURL);
// Load a doc with the cursor saved at a top row.
@@ -235,7 +235,7 @@ public:
const int numRender = 2;
const int numTyping = 6;
const int numSocket = numRender + numTyping;
- std::vector<std::shared_ptr<LOOLWebSocket>> sockets;
+ std::vector<std::shared_ptr<COOLWebSocket>> sockets;
LOG_TRC("Connecting first client to " << serverURL << " doc: " << documentURL);
sockets.push_back(helpers::loadDocAndGetSocket(uri, documentURL, testname));
@@ -243,7 +243,7 @@ public:
for (int i = 1; i < numSocket; ++i)
{
LOG_TRC("Connecting client " << i);
- std::shared_ptr<LOOLWebSocket> socket = helpers::loadDocAndGetSocket(uri, documentURL, testname);
+ std::shared_ptr<COOLWebSocket> socket = helpers::loadDocAndGetSocket(uri, documentURL, testname);
sockets.push_back(socket);
for (int j = 0; j < i * 3; ++j)
{
@@ -296,7 +296,7 @@ public:
for (int i = 0; i < numRender; ++i)
threads.emplace_back([&,i] {
std::mt19937 randDev(numRender * 257);
- std::shared_ptr<LOOLWebSocket> sock = sockets[numTyping + i];
+ std::shared_ptr<COOLWebSocket> sock = sockets[numTyping + i];
while (!started || liveTyping > 0)
{
std::ostringstream oss;
@@ -319,7 +319,7 @@ public:
{
threads.emplace_back([&,which] {
std::mt19937 randDev(which * 16);
- std::shared_ptr<LOOLWebSocket> sock = sockets[which];
+ std::shared_ptr<COOLWebSocket> sock = sockets[which];
liveTyping++;
started = true;
for (size_t i = 0; i < messages[which].size(); ++i)
diff --git a/test/UnitUNOCommand.cpp b/test/UnitUNOCommand.cpp
index 5ccdbea44c..9efa2a3f35 100644
--- a/test/UnitUNOCommand.cpp
+++ b/test/UnitUNOCommand.cpp
@@ -20,7 +20,7 @@
#include <Unit.hpp>
#include <helpers.hpp>
-class LOOLWebSocket;
+class COOLWebSocket;
namespace
{
@@ -30,7 +30,7 @@ void testStateChanged(const std::string& filename, std::set<std::string>& comman
Poco::RegularExpression reUno("\\.[a-zA-Z]*\\:[a-zA-Z]*\\=");
- std::shared_ptr<LOOLWebSocket> socket = helpers::loadDocAndGetSocket(filename, Poco::URI(helpers::getTestServerURI()), testname);
+ std::shared_ptr<COOLWebSocket> socket = helpers::loadDocAndGetSocket(filename, Poco::URI(helpers::getTestServerURI()), testname);
helpers::SocketProcessor(testname, socket,
[&](const std::string& msg)
{
diff --git a/test/UnitWOPI.cpp b/test/UnitWOPI.cpp
index 8fd2c5d29d..c6c34edb2a 100644
--- a/test/UnitWOPI.cpp
+++ b/test/UnitWOPI.cpp
@@ -63,10 +63,10 @@ public:
LOG_TST("assertPutFileRequest: SavingPhase::Unmodified");
// the document is not modified
- LOK_ASSERT_EQUAL(std::string("false"), request.get("X-LOOL-WOPI-IsModifiedByUser"));
+ LOK_ASSERT_EQUAL(std::string("false"), request.get("X-COOL-WOPI-IsModifiedByUser"));
// but the save action is an explicit user's request
- LOK_ASSERT_EQUAL(std::string("false"), request.get("X-LOOL-WOPI-IsAutosave"));
+ LOK_ASSERT_EQUAL(std::string("false"), request.get("X-COOL-WOPI-IsAutosave"));
_finishedSaveUnmodified = true;
}
@@ -75,14 +75,14 @@ public:
LOG_TST("assertPutFileRequest: SavingPhase::Modified");
// the document is modified
- LOK_ASSERT_EQUAL(std::string("true"), request.get("X-LOOL-WOPI-IsModifiedByUser"));
+ LOK_ASSERT_EQUAL(std::string("true"), request.get("X-COOL-WOPI-IsModifiedByUser"));
// and this test fakes that it's an autosave
- LOK_ASSERT_EQUAL(std::string("true"), request.get("X-LOOL-WOPI-IsAutosave"));
+ LOK_ASSERT_EQUAL(std::string("true"), request.get("X-COOL-WOPI-IsAutosave"));
// Check that we get the extended data.
LOK_ASSERT_EQUAL(std::string("CustomFlag=Custom Value;AnotherFlag=AnotherValue"),
- request.get("X-LOOL-WOPI-ExtendedData"));
+ request.get("X-COOL-WOPI-ExtendedData"));
_finishedSaveModified = true;
}
diff --git a/test/UnitWOPIAsyncUpload_Close.cpp b/test/UnitWOPIAsyncUpload_Close.cpp
index 84c6b37d25..3edee2a86c 100644
--- a/test/UnitWOPIAsyncUpload_Close.cpp
+++ b/test/UnitWOPIAsyncUpload_Close.cpp
@@ -56,10 +56,10 @@ public:
LOG_TST("WaitFirstPutFile => Close");
_phase = Phase::Close;
- LOK_ASSERT_EQUAL(std::string("true"), request.get("X-LOOL-WOPI-IsModifiedByUser"));
+ LOK_ASSERT_EQUAL(std::string("true"), request.get("X-COOL-WOPI-IsModifiedByUser"));
// We requested the save.
- LOK_ASSERT_EQUAL(std::string("false"), request.get("X-LOOL-WOPI-IsAutosave"));
+ LOK_ASSERT_EQUAL(std::string("false"), request.get("X-COOL-WOPI-IsAutosave"));
// Fail with error.
return Util::make_unique<http::Response>(http::StatusLine(404));
@@ -71,10 +71,10 @@ public:
_phase == Phase::WaitSecondPutFile);
// the document is modified
- LOK_ASSERT_EQUAL(std::string("true"), request.get("X-LOOL-WOPI-IsModifiedByUser"));
+ LOK_ASSERT_EQUAL(std::string("true"), request.get("X-COOL-WOPI-IsModifiedByUser"));
// Triggered while closing.
- LOK_ASSERT_EQUAL(std::string("false"), request.get("X-LOOL-WOPI-IsAutosave"));
+ LOK_ASSERT_EQUAL(std::string("false"), request.get("X-COOL-WOPI-IsAutosave"));
passTest("Document uploaded on closing as expected.");
diff --git a/test/UnitWOPIAsyncUpload_Modify.cpp b/test/UnitWOPIAsyncUpload_Modify.cpp
index 360137c038..1999ff6d9a 100644
--- a/test/UnitWOPIAsyncUpload_Modify.cpp
+++ b/test/UnitWOPIAsyncUpload_Modify.cpp
@@ -57,10 +57,10 @@ public:
LOG_TST("WaitFirstPutFile => Close");
_phase = Phase::Close;
- LOK_ASSERT_EQUAL(std::string("true"), request.get("X-LOOL-WOPI-IsModifiedByUser"));
+ LOK_ASSERT_EQUAL(std::string("true"), request.get("X-COOL-WOPI-IsModifiedByUser"));
// We requested the save.
- LOK_ASSERT_EQUAL(std::string("false"), request.get("X-LOOL-WOPI-IsAutosave"));
+ LOK_ASSERT_EQUAL(std::string("false"), request.get("X-COOL-WOPI-IsAutosave"));
// Fail with error.
LOG_TST("assertPutFileRequest: returning 404 to simulate PutFile failure");
@@ -74,10 +74,10 @@ public:
_phase == Phase::WaitSecondPutFile);
// the document is modified
- LOK_ASSERT_EQUAL(std::string("true"), request.get("X-LOOL-WOPI-IsModifiedByUser"));
+ LOK_ASSERT_EQUAL(std::string("true"), request.get("X-COOL-WOPI-IsModifiedByUser"));
// Triggered while closing.
- LOK_ASSERT_EQUAL(std::string("false"), request.get("X-LOOL-WOPI-IsAutosave"));
+ LOK_ASSERT_EQUAL(std::string("false"), request.get("X-COOL-WOPI-IsAutosave"));
passTest("Document uploaded on closing as expected.");
diff --git a/test/UnitWOPIAsyncUpload_ModifyClose.cpp b/test/UnitWOPIAsyncUpload_ModifyClose.cpp
index 0b889b9b99..3120f3ab99 100644
--- a/test/UnitWOPIAsyncUpload_ModifyClose.cpp
+++ b/test/UnitWOPIAsyncUpload_ModifyClose.cpp
@@ -51,9 +51,9 @@ public:
_phase = Phase::Polling;
// We requested the save.
- LOK_ASSERT_EQUAL(std::string("false"), request.get("X-LOOL-WOPI-IsAutosave"));
+ LOK_ASSERT_EQUAL(std::string("false"), request.get("X-COOL-WOPI-IsAutosave"));
- if (request.get("X-LOOL-WOPI-IsModifiedByUser") != "true")
+ if (request.get("X-COOL-WOPI-IsModifiedByUser") != "true")
{
// There is a race when closing the document right after modifying,
// so the modified flag may not be set, but there should be no data
diff --git a/test/UnitWOPIHttpHeaders.cpp b/test/UnitWOPIHttpHeaders.cpp
index 043629a00e..ed87a58cf8 100644
--- a/test/UnitWOPIHttpHeaders.cpp
+++ b/test/UnitWOPIHttpHeaders.cpp
@@ -96,7 +96,7 @@ public:
initWebsocket("/wopi/files/0?" + params);
- helpers::sendTextFrame(*getWs()->getLOOLWebSocket(), "load url=" + getWopiSrc(),
+ helpers::sendTextFrame(*getWs()->getCOOLWebSocket(), "load url=" + getWopiSrc(),
testName);
SocketPoll::wakeupWorld();
diff --git a/test/UnitWOPILoadEncoded.cpp b/test/UnitWOPILoadEncoded.cpp
index 41fb9ad7ca..e04db76056 100644
--- a/test/UnitWOPILoadEncoded.cpp
+++ b/test/UnitWOPILoadEncoded.cpp
@@ -40,7 +40,7 @@ public:
{
initWebsocket("/wopi/files/3?access_token=anything");
- helpers::sendTextFrame(*getWs()->getLOOLWebSocket(), "load url=" + getWopiSrc(), testName);
+ helpers::sendTextFrame(*getWs()->getCOOLWebSocket(), "load url=" + getWopiSrc(), testName);
SocketPoll::wakeupWorld();
_phase = Phase::CloseDoc;
@@ -48,7 +48,7 @@ public:
}
case Phase::CloseDoc:
{
- helpers::sendTextFrame(*getWs()->getLOOLWebSocket(), "closedocument", testName);
+ helpers::sendTextFrame(*getWs()->getCOOLWebSocket(), "closedocument", testName);
_phase = Phase::Polling;
break;
}
diff --git a/test/UnitWOPILock.cpp b/test/UnitWOPILock.cpp
index 635955f56a..27a1edef81 100644
--- a/test/UnitWOPILock.cpp
+++ b/test/UnitWOPILock.cpp
@@ -163,8 +163,8 @@ public:
_phase = Phase::LockDocument;
initWebsocket("/wopi/files/0?access_token=anything");
addWebSocket();
- helpers::sendTextFrame(*getWs()->getLOOLWebSocket(), "load url=" + getWopiSrc(), testName);
- helpers::sendTextFrame(*getWsAt(1)->getLOOLWebSocket(), "load url=" + getWopiSrc(), testName);
+ helpers::sendTextFrame(*getWs()->getCOOLWebSocket(), "load url=" + getWopiSrc(), testName);
+ helpers::sendTextFrame(*getWsAt(1)->getCOOLWebSocket(), "load url=" + getWopiSrc(), testName);
SocketPoll::wakeupWorld();
break;
}
diff --git a/test/UnitWOPIRenameFile.cpp b/test/UnitWOPIRenameFile.cpp
index ab707f544a..bf009e3f1a 100644
--- a/test/UnitWOPIRenameFile.cpp
+++ b/test/UnitWOPIRenameFile.cpp
@@ -63,13 +63,13 @@ public:
{
initWebsocket("/wopi/files/0?access_token=anything");
- helpers::sendTextFrame(*getWs()->getLOOLWebSocket(), "load url=" + getWopiSrc(), testName);
+ helpers::sendTextFrame(*getWs()->getCOOLWebSocket(), "load url=" + getWopiSrc(), testName);
_phase = Phase::RenameFile;
break;
}
case Phase::RenameFile:
{
- helpers::sendTextFrame(*getWs()->getLOOLWebSocket(), "renamefile filename=hello", testName);
+ helpers::sendTextFrame(*getWs()->getCOOLWebSocket(), "renamefile filename=hello", testName);
_phase = Phase::Polling;
break;
}
diff --git a/test/UnitWOPISaveAs.cpp b/test/UnitWOPISaveAs.cpp
index 3d2679e4f0..c306640c43 100644
--- a/test/UnitWOPISaveAs.cpp
+++ b/test/UnitWOPISaveAs.cpp
@@ -67,8 +67,8 @@ public:
{
initWebsocket("/wopi/files/0?access_token=anything");
- helpers::sendTextFrame(*getWs()->getLOOLWebSocket(), "load url=" + getWopiSrc(), testName);
- helpers::sendTextFrame(*getWs()->getLOOLWebSocket(), "saveas url=wopi:///jan/hole%C5%A1ovsk%C3%BD/hello%20world%251.pdf", testName);
+ helpers::sendTextFrame(*getWs()->getCOOLWebSocket(), "load url=" + getWopiSrc(), testName);
+ helpers::sendTextFrame(*getWs()->getCOOLWebSocket(), "saveas url=wopi:///jan/hole%C5%A1ovsk%C3%BD/hello%20world%251.pdf", testName);
SocketPoll::wakeupWorld();
_phase = Phase::Polling;
diff --git a/test/UnitWOPIWatermark.cpp b/test/UnitWOPIWatermark.cpp
index 366f8cab5b..d4e1b95b12 100644
--- a/test/UnitWOPIWatermark.cpp
+++ b/test/UnitWOPIWatermark.cpp
@@ -116,7 +116,7 @@ public:
{
initWebsocket("/wopi/files/5?access_token=anything");
- helpers::sendTextFrame(*getWs()->getLOOLWebSocket(), "load url=" + getWopiSrc(), testName);
+ helpers::sendTextFrame(*getWs()->getCOOLWebSocket(), "load url=" + getWopiSrc(), testName);
SocketPoll::wakeupWorld();
_phase = Phase::TileRequest;
@@ -129,8 +129,8 @@ public:
}
case Phase::TileRequest:
{
- helpers::sendTextFrame(*getWs()->getLOOLWebSocket(), "tilecombine nviewid=0 part=0 width=256 height=256 tileposx=0,3840 tileposy=0,0 tilewidth=3840 tileheight=3840", testName);
- std::string tile = helpers::getResponseString(*getWs()->getLOOLWebSocket(), "tile:", testName);
+ helpers::sendTextFrame(*getWs()->getCOOLWebSocket(), "tilecombine nviewid=0 part=0 width=256 height=256 tileposx=0,3840 tileposy=0,0 tilewidth=3840 tileheight=3840", testName);
+ std::string tile = helpers::getResponseString(*getWs()->getCOOLWebSocket(), "tile:", testName);
if(!tile.empty())
{
diff --git a/test/WhiteBoxTests.cpp b/test/WhiteBoxTests.cpp
index ea8581be41..5407b539ff 100644
--- a/test/WhiteBoxTests.cpp
+++ b/test/WhiteBoxTests.cpp
@@ -39,7 +39,7 @@ class WhiteBoxTests : public CPPUNIT_NS::TestFixture
{
CPPUNIT_TEST_SUITE(WhiteBoxTests);
- CPPUNIT_TEST(testLOOLProtocolFunctions);
+ CPPUNIT_TEST(testCOOLProtocolFunctions);
CPPUNIT_TEST(testSplitting);
CPPUNIT_TEST(testMessage);
CPPUNIT_TEST(testMessageAbbreviation);
@@ -76,7 +76,7 @@ class WhiteBoxTests : public CPPUNIT_NS::TestFixture
CPPUNIT_TEST_SUITE_END();
- void testLOOLProtocolFunctions();
+ void testCOOLProtocolFunctions();
void testSplitting();
void testMessage();
void testMessageAbbreviation();
@@ -112,44 +112,44 @@ class WhiteBoxTests : public CPPUNIT_NS::TestFixture
void testJsonUtilEscapeJSONValue();
};
-void WhiteBoxTests::testLOOLProtocolFunctions()
+void WhiteBoxTests::testCOOLProtocolFunctions()
{
int foo;
- LOK_ASSERT(LOOLProtocol::getTokenInteger("foo=42", "foo", foo));
+ LOK_ASSERT(COOLProtocol::getTokenInteger("foo=42", "foo", foo));
LOK_ASSERT_EQUAL(42, foo);
std::string bar;
- LOK_ASSERT(LOOLProtocol::getTokenString("bar=hello-sailor", "bar", bar));
+ LOK_ASSERT(COOLProtocol::getTokenString("bar=hello-sailor", "bar", bar));
LOK_ASSERT_EQUAL(std::string("hello-sailor"), bar);
- LOK_ASSERT(LOOLProtocol::getTokenString("bar=", "bar", bar));
+ LOK_ASSERT(COOLProtocol::getTokenString("bar=", "bar", bar));
LOK_ASSERT_EQUAL(std::string(""), bar);
int mumble;
std::map<std::string, int> map { { "hello", 1 }, { "goodbye", 2 }, { "adieu", 3 } };
- LOK_ASSERT(LOOLProtocol::getTokenKeyword("mumble=goodbye", "mumble", map, mumble));
+ LOK_ASSERT(COOLProtocol::getTokenKeyword("mumble=goodbye", "mumble", map, mumble));
LOK_ASSERT_EQUAL(2, mumble);
std::string message("hello x=1 y=2 foo=42 bar=hello-sailor mumble='goodbye' zip zap");
StringVector tokens(Util::tokenize(message));
- LOK_ASSERT(LOOLProtocol::getTokenInteger(tokens, "foo", foo));
+ LOK_ASSERT(COOLProtocol::getTokenInteger(tokens, "foo", foo));
LOK_ASSERT_EQUAL(42, foo);
- LOK_ASSERT(LOOLProtocol::getTokenString(tokens, "bar", bar));
+ LOK_ASSERT(COOLProtocol::getTokenString(tokens, "bar", bar));
LOK_ASSERT_EQUAL(std::string("hello-sailor"), bar);
- LOK_ASSERT(LOOLProtocol::getTokenKeyword(tokens, "mumble", map, mumble));
+ LOK_ASSERT(COOLProtocol::getTokenKeyword(tokens, "mumble", map, mumble));
LOK_ASSERT_EQUAL(2, mumble);
- LOK_ASSERT(LOOLProtocol::getTokenIntegerFromMessage(message, "foo", foo));
+ LOK_ASSERT(COOLProtocol::getTokenIntegerFromMessage(message, "foo", foo));
LOK_ASSERT_EQUAL(42, foo);
- LOK_ASSERT(LOOLProtocol::getTokenStringFromMessage(message, "bar", bar));
+ LOK_ASSERT(COOLProtocol::getTokenStringFromMessage(message, "bar", bar));
LOK_ASSERT_EQUAL(std::string("hello-sailor"), bar);
- LOK_ASSERT(LOOLProtocol::getTokenKeywordFromMessage(message, "mumble", map, mumble));
+ LOK_ASSERT(COOLProtocol::getTokenKeywordFromMessage(message, "mumble", map, mumble));
LOK_ASSERT_EQUAL(2, mumble);
LOK_ASSERT_EQUAL(static_cast<std::size_t>(1), Util::trimmed("A").size());
@@ -355,22 +355,22 @@ void WhiteBoxTests::testMessageAbbreviation()
LOK_ASSERT_EQUAL(std::string(), Util::getDelimitedInitialSubstring("abc", -1, '\n'));
LOK_ASSERT_EQUAL(std::string("ab"), Util::getDelimitedInitialSubstring("abc", 2, '\n'));
- LOK_ASSERT_EQUAL(std::string(), LOOLProtocol::getAbbreviatedMessage(nullptr, 5));
- LOK_ASSERT_EQUAL(std::string(), LOOLProtocol::getAbbreviatedMessage(nullptr, -1));
- LOK_ASSERT_EQUAL(std::string(), LOOLProtocol::getAbbreviatedMessage("abc", 0));
- LOK_ASSERT_EQUAL(std::string(), LOOLProtocol::getAbbreviatedMessage("abc", -1));
- LOK_ASSERT_EQUAL(std::string("ab"), LOOLProtocol::getAbbreviatedMessage("abc", 2));
+ LOK_ASSERT_EQUAL(std::string(), COOLProtocol::getAbbreviatedMessage(nullptr, 5));
+ LOK_ASSERT_EQUAL(std::string(), COOLProtocol::getAbbreviatedMessage(nullptr, -1));
+ LOK_ASSERT_EQUAL(std::string(), COOLProtocol::getAbbreviatedMessage("abc", 0));
+ LOK_ASSERT_EQUAL(std::string(), COOLProtocol::getAbbreviatedMessage("abc", -1));
+ LOK_ASSERT_EQUAL(std::string("ab"), COOLProtocol::getAbbreviatedMessage("abc", 2));
std::string s;
std::string abbr;
s = "abcdefg";
- LOK_ASSERT_EQUAL(s, LOOLProtocol::getAbbreviatedMessage(s));
+ LOK_ASSERT_EQUAL(s, COOLProtocol::getAbbreviatedMessage(s));
s = "1234567890123\n45678901234567890123456789012345678901234567890123";
abbr = "1234567890123...";
- LOK_ASSERT_EQUAL(abbr, LOOLProtocol::getAbbreviatedMessage(s.data(), s.size()));
- LOK_ASSERT_EQUAL(abbr, LOOLProtocol::getAbbreviatedMessage(s));
+ LOK_ASSERT_EQUAL(abbr, COOLProtocol::getAbbreviatedMessage(s.data(), s.size()));
+ LOK_ASSERT_EQUAL(abbr, COOLProtocol::getAbbreviatedMessage(s));
}
void WhiteBoxTests::testTokenizer()
@@ -463,21 +463,21 @@ void WhiteBoxTests::testTokenizer()
// Integer lists.
std::vector<int> ints;
- ints = LOOLProtocol::tokenizeInts(std::string("-1"));
+ ints = COOLProtocol::tokenizeInts(std::string("-1"));
LOK_ASSERT_EQUAL(static_cast<std::size_t>(1), ints.size());
LOK_ASSERT_EQUAL(-1, ints[0]);
- ints = LOOLProtocol::tokenizeInts(std::string("1,2,3,4"));
+ ints = COOLProtocol::tokenizeInts(std::string("1,2,3,4"));
LOK_ASSERT_EQUAL(static_cast<std::size_t>(4), ints.size());
LOK_ASSERT_EQUAL(1, ints[0]);
LOK_ASSERT_EQUAL(2, ints[1]);
LOK_ASSERT_EQUAL(3, ints[2]);
LOK_ASSERT_EQUAL(4, ints[3]);
- ints = LOOLProtocol::tokenizeInts("");
+ ints = COOLProtocol::tokenizeInts("");
LOK_ASSERT_EQUAL(static_cast<std::size_t>(0), ints.size());
- ints = LOOLProtocol::tokenizeInts(std::string(",,,"));
+ ints = COOLProtocol::tokenizeInts(std::string(",,,"));
LOK_ASSERT_EQUAL(static_cast<std::size_t>(0), ints.size());
}
diff --git a/test/WopiTestServer.hpp b/test/WopiTestServer.hpp
index 8a9642a04a..a97684f143 100644
--- a/test/WopiTestServer.hpp
+++ b/test/WopiTestServer.hpp
@@ -25,7 +25,7 @@
class WopiTestServer : public UnitWSD
{
- enum class LOOLStatusCode
+ enum class COOLStatusCode
{
DocChanged = 1010
};
@@ -256,7 +256,7 @@ protected:
{
LOG_TST("Fake wopi host request, handling PutFile: " << uriReq.getPath());
- std::string wopiTimestamp = request.get("X-LOOL-WOPI-Timestamp", std::string());
+ std::string wopiTimestamp = request.get("X-COOL-WOPI-Timestamp", std::string());
if (!wopiTimestamp.empty())
{
@@ -265,8 +265,8 @@ protected:
{
http::Response httpResponse(http::StatusLine(409));
httpResponse.setBody(
- "{\"LOOLStatusCode\":" +
- std::to_string(static_cast<int>(LOOLStatusCode::DocChanged)) + '}');
+ "{\"COOLStatusCode\":" +
+ std::to_string(static_cast<int>(COOLStatusCode::DocChanged)) + '}');
socket->sendAndShutdown(httpResponse);
return true;
}
@@ -315,7 +315,7 @@ protected:
do \
{ \
LOG_TST(": Sending: " << MSG); \
- helpers::sendTextFrame(*getWs()->getLOOLWebSocket(), MSG, getTestname()); \
+ helpers::sendTextFrame(*getWs()->getCOOLWebSocket(), MSG, getTestname()); \
} while (false)
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/test/countloolkits.hpp b/test/countcoolkits.hpp
index b08ff45806..af3fc880c3 100644
--- a/test/countloolkits.hpp
+++ b/test/countcoolkits.hpp
@@ -21,12 +21,12 @@
#include "test.hpp"
#include "helpers.hpp"
-static int countLoolKitProcesses(const int expected,
+static int countCoolKitProcesses(const int expected,
std::chrono::milliseconds timeoutMs
= std::chrono::milliseconds(COMMAND_TIMEOUT_MS * 8))
{
- const auto testname = "countLoolKitProcesses ";
- TST_LOG_BEGIN("Waiting until loolkit processes are exactly " << expected << ". Loolkits: ");
+ const auto testname = "countCoolKitProcesses ";
+ TST_LOG_BEGIN("Waiting until coolkit processes are exactly " << expected << ". Coolkits: ");
// This does not need to depend on any constant from Common.hpp.
// The shorter the better (the quicker the test runs).
@@ -34,7 +34,7 @@ static int countLoolKitProcesses(const int expected,
// This has to cause waiting for at least COMMAND_TIMEOUT_MS. Tolerate more for safety.
const std::size_t repeat = (timeoutMs.count() / sleepMs);
- int count = getLoolKitProcessCount();
+ int count = getCoolKitProcessCount();
for (std::size_t i = 0; i < repeat; ++i)
{
TST_LOG_APPEND(count << ' ');
@@ -46,7 +46,7 @@ static int countLoolKitProcesses(const int expected,
// Give polls in the cool processes time to time out etc
std::this_thread::sleep_for(std::chrono::milliseconds(sleepMs));
- const int newCount = getLoolKitProcessCount();
+ const int newCount = getCoolKitProcessCount();
if (count != newCount)
{
// Allow more time until the number settles.
@@ -82,28 +82,28 @@ static int countLoolKitProcesses(const int expected,
// and reuse it. As it stands now, it is per
// translation unit, which isn't desirable if
// (in the non-ideal event that) it's not 1,
-// it will cause testNoExtraLoolKitsLeft to
+// it will cause testNoExtraCoolKitsLeft to
// wait unnecessarily and fail.
-static int InitialLoolKitCount = 1;
+static int InitialCoolKitCount = 1;
static std::chrono::steady_clock::time_point TestStartTime;
-static void testCountHowManyLoolkits()
+static void testCountHowManyCoolkits()
{
- const char testname[] = "countHowManyLoolkits ";
+ const char testname[] = "countHowManyCoolkits ";
TestStartTime = std::chrono::steady_clock::now();
- InitialLoolKitCount = countLoolKitProcesses(InitialLoolKitCount);
- TST_LOG("Initial loolkit count is " << InitialLoolKitCount);
- LOK_ASSERT(InitialLoolKitCount > 0);
+ InitialCoolKitCount = countCoolKitProcesses(InitialCoolKitCount);
+ TST_LOG("Initial coolkit count is " << InitialCoolKitCount);
+ LOK_ASSERT(InitialCoolKitCount > 0);
TestStartTime = std::chrono::steady_clock::now();
}
-static void testNoExtraLoolKitsLeft()
+static void testNoExtraCoolKitsLeft()
{
- const char testname[] = "noExtraLoolKitsLeft ";
- const int countNow = countLoolKitProcesses(InitialLoolKitCount);
- LOK_ASSERT_EQUAL(InitialLoolKitCount, countNow);
+ const char testname[] = "noExtraCoolKitsLeft ";
+ const int countNow = countCoolKitProcesses(InitialCoolKitCount);
+ LOK_ASSERT_EQUAL(InitialCoolKitCount, countNow);
const auto duration = (std::chrono::steady_clock::now() - TestStartTime);
const auto durationMs = std::chrono::duration_cast<std::chrono::milliseconds>(duration);
diff --git a/test/helpers.hpp b/test/helpers.hpp
index 266af1079f..9dc1e17809 100644
--- a/test/helpers.hpp
+++ b/test/helpers.hpp
@@ -28,7 +28,7 @@
#include <Common.hpp>
#include "Socket.hpp"
#include "common/FileUtil.hpp"
-#include <tools/LOOLWebSocket.hpp>
+#include <tools/COOLWebSocket.hpp>
#include <common/ConfigUtil.hpp>
#include <common/Util.hpp>
#include <net/WebSocketSession.hpp>
@@ -127,10 +127,10 @@ inline void getDocumentPathAndURL(const std::string& docFilename, std::string& d
}
inline
-void sendTextFrame(LOOLWebSocket& socket, const std::string& string, const std::string& testname)
+void sendTextFrame(COOLWebSocket& socket, const std::string& string, const std::string& testname)
{
#ifndef FUZZER
- TST_LOG("Sending " << string.size() << " bytes: " << LOOLProtocol::getAbbreviatedMessage(string));
+ TST_LOG("Sending " << string.size() << " bytes: " << COOLProtocol::getAbbreviatedMessage(string));
#else
(void) testname;
#endif
@@ -138,7 +138,7 @@ void sendTextFrame(LOOLWebSocket& socket, const std::string& string, const std::
}
inline
-void sendTextFrame(const std::shared_ptr<LOOLWebSocket>& socket, const std::string& string, const std::string& name = "")
+void sendTextFrame(const std::shared_ptr<COOLWebSocket>& socket, const std::string& string, const std::string& name = "")
{
sendTextFrame(*socket, string, name);
}
@@ -148,7 +148,7 @@ inline void sendTextFrame(const std::shared_ptr<http::WebSocketSession>& ws,
{
#ifndef FUZZER
TST_LOG("Sending " << string.size()
- << " bytes: " << LOOLProtocol::getAbbreviatedMessage(string));
+ << " bytes: " << COOLProtocol::getAbbreviatedMessage(string));
#else
(void)testname;
#endif
@@ -328,7 +328,7 @@ inline std::string const& getTestServerURI()
}
inline
-int getErrorCode(LOOLWebSocket& ws, std::string& message, const std::string& testname)
+int getErrorCode(COOLWebSocket& ws, std::string& message, const std::string& testname)
{
int flags = 0;
int bytes = 0;
@@ -347,7 +347,7 @@ int getErrorCode(LOOLWebSocket& ws, std::string& message, const std::string& tes
if (bytes > 0)
{
- TST_LOG("Got Close Frame: " << LOOLWebSocket::getAbbreviatedFrameDump(buffer.begin(), bytes,
+ TST_LOG("Got Close Frame: " << COOLWebSocket::getAbbreviatedFrameDump(buffer.begin(), bytes,
flags));
Poco::MemoryBinaryReader reader(buffer, Poco::BinaryReader::NETWORK_BYTE_ORDER);
reader >> statusCode;
@@ -362,13 +362,13 @@ int getErrorCode(LOOLWebSocket& ws, std::string& message, const std::string& tes
}
inline
-int getErrorCode(const std::shared_ptr<LOOLWebSocket>& ws, std::string& message, const std::string& testname)
+int getErrorCode(const std::shared_ptr<COOLWebSocket>& ws, std::string& message, const std::string& testname)
{
return getErrorCode(*ws, message, testname);
}
inline std::vector<char>
-getResponseMessage(LOOLWebSocket& ws, const std::string& prefix, const std::string& testname,
+getResponseMessage(COOLWebSocket& ws, const std::string& prefix, const std::string& testname,
const std::chrono::milliseconds timeoutMs = std::chrono::seconds(10))
{
try
@@ -393,13 +393,13 @@ getResponseMessage(LOOLWebSocket& ws, const std::string& prefix, const std::stri
response.resize(READ_BUFFER_SIZE * 8);
const int bytes = ws.receiveFrame(response.data(), response.size(), flags, testname);
response.resize(std::max(bytes, 0));
- const auto message = LOOLProtocol::getFirstLine(response);
+ const auto message = COOLProtocol::getFirstLine(response);
if (bytes > 0 && (flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != Poco::Net::WebSocket::FRAME_OP_CLOSE)
{
- if (LOOLProtocol::matchPrefix(prefix, message))
+ if (COOLProtocol::matchPrefix(prefix, message))
{
TST_LOG('[' << prefix << "] Matched " <<
- LOOLWebSocket::getAbbreviatedFrameDump(response.data(), bytes, flags));
+ COOLWebSocket::getAbbreviatedFrameDump(response.data(), bytes, flags));
return response;
}
}
@@ -417,13 +417,13 @@ getResponseMessage(LOOLWebSocket& ws, const std::string& prefix, const std::stri
if ((flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != Poco::Net::WebSocket::FRAME_OP_CLOSE)
{
// Don't ignore errors.
- if (LOOLProtocol::matchPrefix("error:", message))
+ if (COOLProtocol::matchPrefix("error:", message))
{
throw std::runtime_error(message);
}
TST_LOG('[' << prefix << "] Ignored " <<
- LOOLWebSocket::getAbbreviatedFrameDump(response.data(), bytes, flags));
+ COOLWebSocket::getAbbreviatedFrameDump(response.data(), bytes, flags));
}
}
}
@@ -476,7 +476,7 @@ inline int countMessages(const std::shared_ptr<http::WebSocketSession>& ws,
return count;
}
-inline std::vector<char> getResponseMessage(const std::shared_ptr<LOOLWebSocket>& ws,
+inline std::vector<char> getResponseMessage(const std::shared_ptr<COOLWebSocket>& ws,
const std::string& prefix, const std::string& testname,
const std::chrono::milliseconds timeoutMs
= std::chrono::seconds(10))
@@ -511,7 +511,7 @@ std::string assertNotInResponse(T& ws, const std::string& prefix, const std::str
return res;
}
-inline int countMessages(LOOLWebSocket& ws, const std::string& prefix, const std::string& testname,
+inline int countMessages(COOLWebSocket& ws, const std::string& prefix, const std::string& testname,
const std::chrono::milliseconds timeoutMs = std::chrono::seconds(10))
{
int count = 0;
@@ -521,7 +521,7 @@ inline int countMessages(LOOLWebSocket& ws, const std::string& prefix, const std
return count;
}
-inline int countMessages(const std::shared_ptr<LOOLWebSocket>& ws, const std::string& prefix,
+inline int countMessages(const std::shared_ptr<COOLWebSocket>& ws, const std::string& prefix,
const std::string& testname,
const std::chrono::milliseconds timeoutMs = std::chrono::seconds(10))
{
@@ -529,7 +529,7 @@ inline int countMessages(const std::shared_ptr<LOOLWebSocket>& ws, const std::st
}
inline
-bool isDocumentLoaded(LOOLWebSocket& ws, const std::string& testname, bool isView = true)
+bool isDocumentLoaded(COOLWebSocket& ws, const std::string& testname, bool isView = true)
{
const std::string prefix = isView ? "status:" : "statusindicatorfinish:";
std::chrono::seconds timeout(60);
@@ -539,14 +539,14 @@ bool isDocumentLoaded(LOOLWebSocket& ws, const std::string& testname, bool isVie
#endif
#endif
const auto message = getResponseString(ws, prefix, testname, timeout);
- bool success = LOOLProtocol::matchPrefix(prefix, message);
+ bool success = COOLProtocol::matchPrefix(prefix, message);
if (!success)
TST_LOG("ERR: Timed out loading document after " << timeout);
return success;
}
inline
-bool isDocumentLoaded(std::shared_ptr<LOOLWebSocket>& ws, const std::string& testname, bool isView = true)
+bool isDocumentLoaded(std::shared_ptr<COOLWebSocket>& ws, const std::string& testname, bool isView = true)
{
return isDocumentLoaded(*ws, testname, isView);
}
@@ -558,7 +558,7 @@ inline bool isDocumentLoaded(const std::shared_ptr<http::WebSocketSession>& ws,
constexpr auto timeout = std::chrono::seconds(20); // Allow 20 secs to load
const std::string message = getResponseString(ws, prefix, testname, timeout);
- const bool success = LOOLProtocol::matchPrefix(prefix, message);
+ const bool success = COOLProtocol::matchPrefix(prefix, message);
if (!success)
TST_LOG("ERROR: Timed out loading document. Did not get [" << prefix << "] in time.");
return success;
@@ -569,7 +569,7 @@ inline bool isDocumentLoaded(const std::shared_ptr<http::WebSocketSession>& ws,
// The result, it is mostly time outs to get messages in the unit test and it could fail.
// connectLOKit ensures the websocket is connected to a kit process.
inline
-std::shared_ptr<LOOLWebSocket>
+std::shared_ptr<COOLWebSocket>
connectLOKit(const Poco::URI& uri,
Poco::Net::HTTPRequest& request,
Poco::Net::HTTPResponse& response,
@@ -585,7 +585,7 @@ connectLOKit(const Poco::URI& uri,
std::unique_ptr<Poco::Net::HTTPClientSession> session(createSession(uri));
TST_LOG("Connection to " << uri.toString() << " is "
<< (session->secure() ? "secure" : "plain"));
- auto ws = std::make_shared<LOOLWebSocket>(*session, request, response);
+ auto ws = std::make_shared<COOLWebSocket>(*session, request, response);
const char* expected_response = "statusindicator: ready";
@@ -661,14 +661,14 @@ inline std::shared_ptr<http::WebSocketSession> connectLOKit(std::shared_ptr<Sock
}
inline
-std::shared_ptr<LOOLWebSocket> loadDocAndGetSocket(const Poco::URI& uri, const std::string& documentURL, const std::string& testname, bool isView = true, bool isAssert = true)
+std::shared_ptr<COOLWebSocket> loadDocAndGetSocket(const Poco::URI& uri, const std::string& documentURL, const std::string& testname, bool isView = true, bool isAssert = true)
{
try
{
// Load a document and get its status.
Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, documentURL);
Poco::Net::HTTPResponse response;
- std::shared_ptr<LOOLWebSocket> socket = connectLOKit(uri, request, response, testname);
+ std::shared_ptr<COOLWebSocket> socket = connectLOKit(uri, request, response, testname);
sendTextFrame(socket, "load url=" + documentURL, testname);
bool isLoaded = isDocumentLoaded(*socket, testname, isView);
@@ -692,7 +692,7 @@ std::shared_ptr<LOOLWebSocket> loadDocAndGetSocket(const Poco::URI& uri, const s
}
inline
-std::shared_ptr<LOOLWebSocket> loadDocAndGetSocket(const std::string& docFilename, const Poco::URI& uri, const std::string& testname, bool isView = true, bool isAssert = true)
+std::shared_ptr<COOLWebSocket> loadDocAndGetSocket(const std::string& docFilename, const Poco::URI& uri, const std::string& testname, bool isView = true, bool isAssert = true)
{
try
{
@@ -767,7 +767,7 @@ loadDocAndGetSession(std::shared_ptr<SocketPoll> socketPoll, const std::string&
}
inline void SocketProcessor(const std::string& testname,
- const std::shared_ptr<LOOLWebSocket>& socket,
+ const std::shared_ptr<COOLWebSocket>& socket,
const std::function<bool(const std::string& msg)>& handler,
const std::chrono::milliseconds timeoutMs = std::chrono::seconds(10))
{
@@ -786,7 +786,7 @@ inline void SocketProcessor(const std::string& testname,
}
n = socket->receiveFrame(buffer, sizeof(buffer), flags, testname);
- TST_LOG("Got " << LOOLWebSocket::getAbbreviatedFrameDump(buffer, n, flags));
+ TST_LOG("Got " << COOLWebSocket::getAbbreviatedFrameDump(buffer, n, flags));
if (n > 0 && (flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != Poco::Net::WebSocket::FRAME_OP_CLOSE)
{
if (!handler(std::string(buffer, n)))
@@ -838,17 +838,17 @@ inline std::vector<char> getTileMessage(const std::shared_ptr<http::WebSocketSes
}
inline
-std::vector<char> getTileMessage(LOOLWebSocket& ws, const std::string& testname)
+std::vector<char> getTileMessage(COOLWebSocket& ws, const std::string& testname)
{
return getResponseMessage(ws, "tile", testname);
}
inline
-std::vector<char> assertTileMessage(LOOLWebSocket& ws, const std::string& testname)
+std::vector<char> assertTileMessage(COOLWebSocket& ws, const std::string& testname)
{
const std::vector<char> response = getTileMessage(ws, testname);
- const std::string firstLine = LOOLProtocol::getFirstLine(response);
+ const std::string firstLine = COOLProtocol::getFirstLine(response);
StringVector tileTokens(Util::tokenize(firstLine, ' '));
LOK_ASSERT_EQUAL(std::string("tile:"), tileTokens[0]);
LOK_ASSERT_EQUAL(std::string("part="), tileTokens[1].substr(0, std::string("part=").size()));
@@ -863,7 +863,7 @@ std::vector<char> assertTileMessage(LOOLWebSocket& ws, const std::string& testna
}
inline
-std::vector<char> assertTileMessage(const std::shared_ptr<LOOLWebSocket>& ws, const std::string& testname)
+std::vector<char> assertTileMessage(const std::shared_ptr<COOLWebSocket>& ws, const std::string& testname)
{
return assertTileMessage(*ws, testname);
}
@@ -902,25 +902,25 @@ inline int getCharKey(char ch, SpecialKey specialKeys)
return result | specialKeys;
}
-inline void sendKeyEvent(std::shared_ptr<LOOLWebSocket>& socket, const char* type, int chr, int key, const std::string& testname)
+inline void sendKeyEvent(std::shared_ptr<COOLWebSocket>& socket, const char* type, int chr, int key, const std::string& testname)
{
std::ostringstream ssIn;
ssIn << "key type=" << type << " char=" << chr << " key=" << key;
sendTextFrame(socket, ssIn.str(), testname);
}
-inline void sendKeyPress(std::shared_ptr<LOOLWebSocket>& socket, int chr, int key, const std::string& testname)
+inline void sendKeyPress(std::shared_ptr<COOLWebSocket>& socket, int chr, int key, const std::string& testname)
{
sendKeyEvent(socket, "input", chr, key, testname);
sendKeyEvent(socket, "up", chr, key, testname);
}
-inline void sendChar(std::shared_ptr<LOOLWebSocket>& socket, char ch, SpecialKey specialKeys, const std::string& testname)
+inline void sendChar(std::shared_ptr<COOLWebSocket>& socket, char ch, SpecialKey specialKeys, const std::string& testname)
{
sendKeyPress(socket, getCharChar(ch, specialKeys), getCharKey(ch, specialKeys), testname);
}
-inline void sendText(std::shared_ptr<LOOLWebSocket>& socket, const std::string& text, const std::string& testname)
+inline void sendText(std::shared_ptr<COOLWebSocket>& socket, const std::string& text, const std::string& testname)
{
for (char ch : text)
{
@@ -962,7 +962,7 @@ inline void saveTileAs(const std::vector<char> &tileResponse,
const std::string &filename,
const std::string &testname)
{
- const std::string firstLine = LOOLProtocol::getFirstLine(tileResponse);
+ const std::string firstLine = COOLProtocol::getFirstLine(tileResponse);
std::vector<char> res(tileResponse.begin() + firstLine.size() + 1, tileResponse.end());
std::stringstream streamRes;
std::copy(res.begin(), res.end(), std::ostream_iterator<char>(streamRes));
@@ -972,7 +972,7 @@ inline void saveTileAs(const std::vector<char> &tileResponse,
TST_LOG("Saved [" << firstLine << "] to [" << filename << ']');
}
-inline std::vector<char> getTileAndSave(std::shared_ptr<LOOLWebSocket>& socket,
+inline std::vector<char> getTileAndSave(std::shared_ptr<COOLWebSocket>& socket,
const std::string& req,
const std::string& filename,
const std::string& testname)
@@ -983,7 +983,7 @@ inline std::vector<char> getTileAndSave(std::shared_ptr<LOOLWebSocket>& socket,
const std::vector<char> tile = getResponseMessage(socket, "tile:", testname);
TST_LOG(" Tile PNG size: " << tile.size());
- const std::string firstLine = LOOLProtocol::getFirstLine(tile);
+ const std::string firstLine = COOLProtocol::getFirstLine(tile);
std::vector<char> res(tile.begin() + firstLine.size() + 1, tile.end());
std::stringstream streamRes;
std::copy(res.begin(), res.end(), std::ostream_iterator<char>(streamRes));
@@ -994,14 +994,14 @@ inline std::vector<char> getTileAndSave(std::shared_ptr<LOOLWebSocket>& socket,
return res;
}
-inline void getServerVersion(LOOLWebSocket& socket,
+inline void getServerVersion(COOLWebSocket& socket,
int& major, int& minor,
const std::string& testname)
{
const std::string clientVersion = "coolclient 0.1";
sendTextFrame(socket, clientVersion, testname);
std::vector<char> loVersion = getResponseMessage(socket, "lokitversion", testname);
- std::string line = LOOLProtocol::getFirstLine(loVersion.data(), loVersion.size());
+ std::string line = COOLProtocol::getFirstLine(loVersion.data(), loVersion.size());
line = line.substr(strlen("lokitversion "));
Poco::JSON::Parser parser;
Poco::Dynamic::Var loVersionVar = parser.parse(line);
@@ -1021,7 +1021,7 @@ inline void getServerVersion(LOOLWebSocket& socket,
TST_LOG("Client [" << major << '.' << minor << "].");
}
-inline void getServerVersion(std::shared_ptr<LOOLWebSocket>& socket,
+inline void getServerVersion(std::shared_ptr<COOLWebSocket>& socket,
int& major, int& minor,
const std::string& testname)
{
@@ -1054,7 +1054,7 @@ inline bool svgMatch(const char *testname, const std::vector<char> &response, co
}
/// Select all and wait for the text selection update.
-inline void selectAll(const std::shared_ptr<LOOLWebSocket>& socket, const std::string& testname, int repeat = COMMAND_RETRY_COUNT)
+inline void selectAll(const std::shared_ptr<COOLWebSocket>& socket, const std::string& testname, int repeat = COMMAND_RETRY_COUNT)
{
for (int i = 0; i < repeat; ++i)
{
@@ -1152,7 +1152,7 @@ inline std::string getAllText(const std::shared_ptr<http::WebSocketSession>& soc
}
/// Delete all and wait for the text selection update.
-inline void deleteAll(const std::shared_ptr<LOOLWebSocket>& socket, const std::string& testname, int repeat = COMMAND_RETRY_COUNT)
+inline void deleteAll(const std::shared_ptr<COOLWebSocket>& socket, const std::string& testname, int repeat = COMMAND_RETRY_COUNT)
{
selectAll(socket, testname);
@@ -1164,7 +1164,7 @@ inline void deleteAll(const std::shared_ptr<LOOLWebSocket>& socket, const std::s
}
}
-inline std::string getAllText(const std::shared_ptr<LOOLWebSocket>& socket,
+inline std::string getAllText(const std::shared_ptr<COOLWebSocket>& socket,
const std::string& testname,
const std::string& expected = std::string(),
int retry = COMMAND_RETRY_COUNT)
diff --git a/test/httpcrashtest.cpp b/test/httpcrashtest.cpp
index 0b4ee8b3f0..a62039869e 100644
--- a/test/httpcrashtest.cpp
+++ b/test/httpcrashtest.cpp
@@ -35,11 +35,11 @@
#include <Protocol.hpp>
#include <test.hpp>
#include <helpers.hpp>
-#include <countloolkits.hpp>
+#include <countcoolkits.hpp>
using namespace helpers;
-/// Tests the HTTP WebSocket API of loolwsd. The server has to be started manually before running this test.
+/// Tests the HTTP WebSocket API of coolwsd. The server has to be started manually before running this test.
class HTTPCrashTest : public CPPUNIT_NS::TestFixture
{
const Poco::URI _uri;
@@ -89,7 +89,7 @@ public:
void setUp()
{
resetTestStartTime();
- testCountHowManyLoolkits();
+ testCountHowManyCoolkits();
resetTestStartTime();
_socketPoll->startThread();
}
@@ -98,7 +98,7 @@ public:
{
_socketPoll->joinThread();
resetTestStartTime();
- testNoExtraLoolKitsLeft();
+ testNoExtraCoolKitsLeft();
resetTestStartTime();
}
};
@@ -111,7 +111,7 @@ void HTTPCrashTest::testBarren()
try
{
killLoKitProcesses();
- countLoolKitProcesses(0);
+ countCoolKitProcesses(0);
TST_LOG("Loading after kill.");
@@ -145,10 +145,10 @@ void HTTPCrashTest::testCrashKit()
TST_LOG("Allowing time for kits to spawn and connect to wsd to get cleanly killed");
std::this_thread::sleep_for(std::chrono::seconds(1));
- TST_LOG("Killing loolkit instances.");
+ TST_LOG("Killing coolkit instances.");
killLoKitProcesses();
- countLoolKitProcesses(0, std::chrono::seconds(1));
+ countCoolKitProcesses(0, std::chrono::seconds(1));
TST_LOG("Reading the error code from the socket.");
//FIXME: implement in WebSocketSession.
@@ -180,10 +180,10 @@ void HTTPCrashTest::testRecoverAfterKitCrash()
TST_LOG("Allowing time for kits to spawn and connect to wsd to get cleanly killed");
std::this_thread::sleep_for(std::chrono::seconds(1));
- TST_LOG("Killing loolkit instances.");
+ TST_LOG("Killing coolkit instances.");
killLoKitProcesses();
- countLoolKitProcesses(0, std::chrono::seconds(1));
+ countCoolKitProcesses(0, std::chrono::seconds(1));
// We expect the client connection to close.
TST_LOG("Reconnect after kill.");
@@ -234,9 +234,9 @@ void HTTPCrashTest::testCrashForkit()
LOK_ASSERT_MESSAGE("Expected successful disconnection of the WebSocket",
socket->waitForDisconnection(std::chrono::seconds(5)));
- TST_LOG("Killing loolkit.");
+ TST_LOG("Killing coolkit.");
killLoKitProcesses();
- countLoolKitProcesses(0);
+ countCoolKitProcesses(0);
TST_LOG("Communicating after kill.");
socket = loadDocAndGetSession(_socketPoll, "empty.odt", _uri, testname);
socket->asyncShutdown();
@@ -265,7 +265,7 @@ static void killPids(const std::set<pid_t> &pids, const std::string& testname)
void HTTPCrashTest::killLoKitProcesses()
{
killPids(getKitPids(), "killLoKitProcesses ");
- InitialLoolKitCount = 1; // non-intuitive but it will arrive soon.
+ InitialCoolKitCount = 1; // non-intuitive but it will arrive soon.
}
void HTTPCrashTest::killForkitProcess()
diff --git a/test/httpwstest.cpp b/test/httpwstest.cpp
index b715ee1774..e5fa79ce25 100644
--- a/test/httpwstest.cpp
+++ b/test/httpwstest.cpp
@@ -26,12 +26,12 @@
#include <Protocol.hpp>
#include "lokassert.hpp"
-#include <countloolkits.hpp>
+#include <countcoolkits.hpp>
#include <helpers.hpp>
using namespace helpers;
-/// Tests the HTTP WebSocket API of loolwsd. The server has to be started manually before running this test.
+/// Tests the HTTP WebSocket API of coolwsd. The server has to be started manually before running this test.
class HTTPWSTest : public CPPUNIT_NS::TestFixture
{
const Poco::URI _uri;
@@ -82,7 +82,7 @@ public:
void setUp()
{
resetTestStartTime();
- testCountHowManyLoolkits();
+ testCountHowManyCoolkits();
resetTestStartTime();
_socketPoll->startThread();
}
@@ -91,7 +91,7 @@ public:
{
_socketPoll->joinThread();
resetTestStartTime();
- testNoExtraLoolKitsLeft();
+ testNoExtraCoolKitsLeft();
resetTestStartTime();
}
};
@@ -130,7 +130,7 @@ void HTTPWSTest::testSaveOnDisconnect()
// the socket is closed, when the doc is not even modified yet.
getResponseMessage(socket1, "statechanged", testname);
- kitcount = getLoolKitProcessCount();
+ kitcount = getCoolKitProcessCount();
// Shutdown abruptly.
TST_LOG("Closing connection after pasting.");
@@ -149,7 +149,7 @@ void HTTPWSTest::testSaveOnDisconnect()
}
// Allow time to save and destroy before we connect again.
- testNoExtraLoolKitsLeft();
+ testNoExtraCoolKitsLeft();
TST_LOG("Loading again.");
try
{
@@ -158,7 +158,7 @@ void HTTPWSTest::testSaveOnDisconnect()
= loadDocAndGetSession(_socketPoll, _uri, documentURL, testname + "3 ");
// Should have no new instances.
- LOK_ASSERT_EQUAL(kitcount, countLoolKitProcesses(kitcount));
+ LOK_ASSERT_EQUAL(kitcount, countCoolKitProcesses(kitcount));
// Check if the document contains the pasted text.
const std::string selection = getAllText(socket, testname, text);
@@ -209,7 +209,7 @@ void HTTPWSTest::testSavePassiveOnDisconnect()
// the socket is closed, when the doc is not even modified yet.
getResponseMessage(socket1, "statechanged", testname);
- kitcount = getLoolKitProcessCount();
+ kitcount = getCoolKitProcessCount();
// Shutdown abruptly.
TST_LOG("Closing connection after pasting.");
@@ -227,7 +227,7 @@ void HTTPWSTest::testSavePassiveOnDisconnect()
}
// Allow time to save and destroy before we connect again.
- testNoExtraLoolKitsLeft();
+ testNoExtraCoolKitsLeft();
TST_LOG("Loading again.");
try
{
@@ -237,7 +237,7 @@ void HTTPWSTest::testSavePassiveOnDisconnect()
getResponseMessage(socket, "textselection", testname);
// Should have no new instances.
- LOK_ASSERT_EQUAL(kitcount, countLoolKitProcesses(kitcount));
+ LOK_ASSERT_EQUAL(kitcount, countCoolKitProcesses(kitcount));
// Check if the document contains the pasted text.
const std::string selection = getAllText(socket, testname);
@@ -273,7 +273,7 @@ void HTTPWSTest::testReloadWhileDisconnecting()
// the socket is closed, when the doc is not even modified yet.
getResponseMessage(socket, "statechanged", testname);
- const int kitcount = getLoolKitProcessCount();
+ const int kitcount = getCoolKitProcessCount();
// Shutdown abruptly.
TST_LOG("Closing connection after pasting.");
@@ -286,7 +286,7 @@ void HTTPWSTest::testReloadWhileDisconnecting()
socket = loadDocAndGetSession(_socketPoll, _uri, documentURL, testname);
// Should have no new instances.
- LOK_ASSERT_EQUAL(kitcount, countLoolKitProcesses(kitcount));
+ LOK_ASSERT_EQUAL(kitcount, countCoolKitProcesses(kitcount));
// Check if the document contains the pasted text.
const std::string expected = "aaa bbb ccc";
@@ -328,7 +328,7 @@ void HTTPWSTest::testInactiveClient()
sendTextFrame(socket2, "useractive", "inactiveClient-2 ");
SocketProcessor("Second ", socket2, [&](const std::string& msg)
{
- const auto token = LOOLProtocol::getFirstToken(msg);
+ const auto token = COOLProtocol::getFirstToken(msg);
// 'window:' is e.g. 'window: {"id":"4","action":"invalidate","rectangle":"0, 0,
// 0, 0"}', which is probably fine, given that other invalidations are also
// expected.
diff --git a/test/integration-http-server.cpp b/test/integration-http-server.cpp
index 81c8842bec..9ef4633458 100644
--- a/test/integration-http-server.cpp
+++ b/test/integration-http-server.cpp
@@ -26,11 +26,11 @@
#include <Common.hpp>
#include <common/FileUtil.hpp>
-#include <countloolkits.hpp>
+#include <countcoolkits.hpp>
#include <helpers.hpp>
#include <memory>
-/// Tests the HTTP GET API of loolwsd.
+/// Tests the HTTP GET API of coolwsd.
class HTTPServerTest : public CPPUNIT_NS::TestFixture
{
const Poco::URI _uri;
@@ -91,18 +91,18 @@ public:
void setUp()
{
helpers::resetTestStartTime();
- testCountHowManyLoolkits();
+ testCountHowManyCoolkits();
helpers::resetTestStartTime();
}
void tearDown()
{
helpers::resetTestStartTime();
- testNoExtraLoolKitsLeft();
+ testNoExtraCoolKitsLeft();
helpers::resetTestStartTime();
}
- // A server URI which was not added to loolwsd.xml as post_allow IP or a wopi storage host
+ // A server URI which was not added to coolwsd.xml as post_allow IP or a wopi storage host
Poco::URI getNotAllowedTestServerURI()
{
static std::string serverURI(
@@ -134,7 +134,7 @@ void HTTPServerTest::testCoolGet()
const std::string html = httpResponse->getBody();
LOK_ASSERT(html.find(param["access_token"]) != std::string::npos);
LOK_ASSERT(html.find(_uri.getHost()) != std::string::npos);
- LOK_ASSERT(html.find(std::string(LOOLWSD_VERSION_HASH)) != std::string::npos);
+ LOK_ASSERT(html.find(std::string(COOLWSD_VERSION_HASH)) != std::string::npos);
}
void HTTPServerTest::testCoolPost()
diff --git a/test/run_unit.sh.in b/test/run_unit.sh.in
index 7582b68209..b60de15d73 100755
--- a/test/run_unit.sh.in
+++ b/test/run_unit.sh.in
@@ -66,7 +66,7 @@ echo " $cmd_line"
# drop .la suffix
tst=`echo $tst | sed "s/\.la//"`;
-export LOOL_LOGLEVEL=trace
+export COOL_LOGLEVEL=trace
if test "z$enable_debug" != "ztrue"; then
echo ""
diff --git a/test/test.cpp b/test/test.cpp
index a8edd73bc4..0893c3b181 100644
--- a/test/test.cpp
+++ b/test/test.cpp
@@ -32,7 +32,7 @@
#include <helpers.hpp>
#include <Unit.hpp>
-#include <wsd/LOOLWSD.hpp>
+#include <wsd/COOLWSD.hpp>
#if ENABLE_SSL
#include <Ssl.hpp>
#include <SslSocket.hpp>
@@ -78,7 +78,7 @@ static bool IsDebugrun = false;
int main(int argc, char** argv)
{
bool verbose = false;
- std::string cert_path = "/etc/loolwsd/";
+ std::string cert_path = "/etc/coolwsd/";
for (int i = 1; i < argc; ++i)
{
const std::string arg(argv[i]);
@@ -292,20 +292,20 @@ bool runClientTests(bool standalone, bool verbose)
std::set<pid_t> getKitPids()
{
- return LOOLWSD::getKitPids();
+ return COOLWSD::getKitPids();
}
/// Get the PID of the forkit
std::set<pid_t> getForKitPids()
{
std::set<pid_t> pids;
- if (LOOLWSD::ForKitProcId >= 0)
- pids.emplace(LOOLWSD::ForKitProcId);
+ if (COOLWSD::ForKitProcId >= 0)
+ pids.emplace(COOLWSD::ForKitProcId);
return pids;
}
-/// How many live loolkit processes do we have ?
-int getLoolKitProcessCount()
+/// How many live coolkit processes do we have ?
+int getCoolKitProcessCount()
{
return getKitPids().size();
}
diff --git a/test/test.hpp b/test/test.hpp
index 92ff184f44..5d77c52fd3 100644
--- a/test/test.hpp
+++ b/test/test.hpp
@@ -31,7 +31,7 @@ std::set<pid_t> getForKitPids();
/// Which port should we connect to get to WSD.
int getClientPort();
-/// How many live loolkit processes do we have ?
-int getLoolKitProcessCount();
+/// How many live coolkit processes do we have ?
+int getCoolKitProcessCount();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */