diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2017-01-20 16:34:44 -0500 |
---|---|---|
committer | Ashod Nakashian <ashnakash@gmail.com> | 2017-01-23 05:41:46 +0000 |
commit | 0f73bd9bf2afba5f6a24aa5d0127be553ee55c02 (patch) | |
tree | e52cc1b6376ec20b3d6712cc7a099817941bb675 | |
parent | b497fcfac54d10ca67c0906f59a6b69f0940310e (diff) |
wsd: improved testConnectNoLoad
Change-Id: I8eff5b4862067444c8623582dc4f3baa585f164e
Reviewed-on: https://gerrit.libreoffice.org/33425
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
-rw-r--r-- | test/helpers.hpp | 2 | ||||
-rw-r--r-- | test/httpwstest.cpp | 19 |
2 files changed, 15 insertions, 6 deletions
diff --git a/test/helpers.hpp b/test/helpers.hpp index 4dd8f86a6..cc8205e42 100644 --- a/test/helpers.hpp +++ b/test/helpers.hpp @@ -176,7 +176,7 @@ int getErrorCode(LOOLWebSocket& ws, std::string& message, const std::string& tes bytes = ws.receiveFrame(buffer.begin(), READ_BUFFER_SIZE, flags); std::cerr << testname << "Got " << LOOLProtocol::getAbbreviatedFrameDump(buffer.begin(), bytes, flags) << std::endl; } - while (bytes > 0 && (flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != Poco::Net::WebSocket::FRAME_OP_CLOSE); + while (bytes != 0 && (flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != Poco::Net::WebSocket::FRAME_OP_CLOSE); if (bytes > 0) { diff --git a/test/httpwstest.cpp b/test/httpwstest.cpp index 32635d17b..ff48454e5 100644 --- a/test/httpwstest.cpp +++ b/test/httpwstest.cpp @@ -360,26 +360,35 @@ void HTTPWSTest::loadDoc(const std::string& documentURL, const std::string& test void HTTPWSTest::testConnectNoLoad() { + const auto testname1 = "connectNoLoad-1 "; + const auto testname2 = "connectNoLoad-2 "; + const auto testname3 = "connectNoLoad-3 "; + std::string documentPath, documentURL; getDocumentPathAndURL("hello.odt", documentPath, documentURL); Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, documentURL); - auto socket = connectLOKit(_uri, request, _response); + std::cerr << testname1 << "Connecting." << std::endl; + auto socket = connectLOKit(_uri, request, _response, testname1); CPPUNIT_ASSERT_MESSAGE("Failed to connect.", socket); + std::cerr << testname1 << "Disconnecting." << std::endl; socket.reset(); // Connect and load first view. - auto socket1 = connectLOKit(_uri, request, _response); + std::cerr << testname2 << "Connecting." << std::endl; + auto socket1 = connectLOKit(_uri, request, _response, testname2); CPPUNIT_ASSERT_MESSAGE("Failed to connect.", socket1); - sendTextFrame(socket1, "load url=" + documentURL); + sendTextFrame(socket1, "load url=" + documentURL, testname2); CPPUNIT_ASSERT_MESSAGE("cannot load the document " + documentURL, isDocumentLoaded(socket1)); // Connect but don't load second view. - auto socket2 = connectLOKit(_uri, request, _response); + std::cerr << testname3 << "Connecting." << std::endl; + auto socket2 = connectLOKit(_uri, request, _response, testname3); CPPUNIT_ASSERT_MESSAGE("Failed to connect.", socket2); + std::cerr << testname3 << "Disconnecting." << std::endl; socket2.reset(); - sendTextFrame(socket1, "status"); + sendTextFrame(socket1, "status", testname2); assertResponseString(socket1, "status:"); } |