wsd: test: modernize UnitWOPISaveAS

Change-Id: I56fffb5908dbefea73a10ccded1aa46d321cfcf3
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This commit is contained in:
Ashod Nakashian 2022-07-04 20:08:10 -04:00 committed by Michael Meeks
parent 176c37eaa6
commit 3b04b606eb

View file

@ -17,11 +17,7 @@
class UnitWOPISaveAs : public WopiTestServer
{
enum class Phase
{
LoadAndSaveAs,
Polling
} _phase;
STATE_ENUM(Phase, LoadAndSaveAs, Polling) _phase;
public:
UnitWOPISaveAs()
@ -60,19 +56,16 @@ public:
void invokeWSDTest() override
{
constexpr char testName[] = "UnitWOPISaveAs";
switch (_phase)
{
case Phase::LoadAndSaveAs:
{
initWebsocket("/wopi/files/0?access_token=anything");
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();
TRANSITION_STATE(_phase, Phase::Polling);
_phase = Phase::Polling;
WSD_CMD("load url=" + getWopiSrc());
WSD_CMD("saveas url=wopi:///jan/hole%C5%A1ovsk%C3%BD/hello%20world%251.pdf");
break;
}
case Phase::Polling: