From 3b04b606eb0826e604cbbe3302715d931d27ba34 Mon Sep 17 00:00:00 2001 From: Ashod Nakashian Date: Mon, 4 Jul 2022 20:08:10 -0400 Subject: [PATCH] wsd: test: modernize UnitWOPISaveAS Change-Id: I56fffb5908dbefea73a10ccded1aa46d321cfcf3 Signed-off-by: Ashod Nakashian --- test/UnitWOPISaveAs.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/test/UnitWOPISaveAs.cpp b/test/UnitWOPISaveAs.cpp index cfcedf5b2..5e01120d6 100644 --- a/test/UnitWOPISaveAs.cpp +++ b/test/UnitWOPISaveAs.cpp @@ -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: