summaryrefslogtreecommitdiff
path: root/test/UnitOAuth.cpp
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2017-09-27 20:13:16 +0200
committerJan Holesovsky <kendy@collabora.com>2017-09-27 23:53:40 +0200
commitf2ef8d02fa56f74dc010c3a036e599f74fe7b180 (patch)
treebf8372443a78eed3af75de6bce6dece91bd3d1e2 /test/UnitOAuth.cpp
parent043528f8396fc8e5699628ece33ab7b95372e53a (diff)
Speed-up the WOPI tests.
Change-Id: Ib61c5b90703e4266dbad935cd632b8be50a4ac44 Reviewed-on: https://gerrit.libreoffice.org/42880 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'test/UnitOAuth.cpp')
-rw-r--r--test/UnitOAuth.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/test/UnitOAuth.cpp b/test/UnitOAuth.cpp
index dcd2de651..f88a4b555 100644
--- a/test/UnitOAuth.cpp
+++ b/test/UnitOAuth.cpp
@@ -26,7 +26,7 @@ class UnitOAuth : public WopiTestServer
{
LoadToken, // loading the document with Bearer token
LoadHeader, // loading the document with Basic auth
- Finish // assert all went fine and finish
+ Polling // just wait for the results
} _phase;
bool _finishedToken;
@@ -82,6 +82,9 @@ public:
assertRequest(request, 1);
_finishedHeader = true;
}
+
+ if (_finishedToken && _finishedHeader)
+ exitTest(TestResult::Ok);
}
void assertPutFileRequest(const Poco::Net::HTTPRequest& /*request*/) override
@@ -104,17 +107,17 @@ public:
initWebsocket("/wopi/files/1?access_header=Authorization: Basic basic==");
helpers::sendTextFrame(*_ws->getLOOLWebSocket(), "load url=" + _wopiSrc, testName);
+ SocketPoll::wakeupWorld();
if (_phase == Phase::LoadToken)
_phase = Phase::LoadHeader;
else
- _phase = Phase::Finish;
+ _phase = Phase::Polling;
break;
}
- case Phase::Finish:
+ case Phase::Polling:
{
- CPPUNIT_ASSERT(_finishedToken && _finishedHeader);
- exitTest(TestResult::Ok);
+ // just wait for the results
break;
}
}