diff options
author | Jan Holesovsky <kendy@collabora.com> | 2017-09-27 19:57:22 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2017-09-27 23:53:20 +0200 |
commit | 043528f8396fc8e5699628ece33ab7b95372e53a (patch) | |
tree | 4b80b5f7b5861c565d6a89afb873c1f144a84533 /test/UnitWOPI.cpp | |
parent | 67ebb9a48ed3131749858b070ec4d3c81906530a (diff) |
WopiTestServer: Share more code.
Change-Id: Ied539169f96608adb7095682bd8f0b7a70d28491
Reviewed-on: https://gerrit.libreoffice.org/42879
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'test/UnitWOPI.cpp')
-rw-r--r-- | test/UnitWOPI.cpp | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/test/UnitWOPI.cpp b/test/UnitWOPI.cpp index fade8d0f6..a1c7cbdaa 100644 --- a/test/UnitWOPI.cpp +++ b/test/UnitWOPI.cpp @@ -36,8 +36,6 @@ class UnitWOPI : public WopiTestServer bool _finishedSaveUnmodified; bool _finishedSaveModified; - std::unique_ptr<UnitWebSocket> _ws; - public: UnitWOPI() : _phase(Phase::LoadAndSave), @@ -78,17 +76,9 @@ public: { case Phase::LoadAndSave: { - Poco::URI wopiURL(helpers::getTestServerURI() + "/wopi/files/0?access_token=anything"); - std::string wopiSrc; - Poco::URI::encode(wopiURL.toString(), ":/?", wopiSrc); - Poco::URI loolUri(helpers::getTestServerURI()); - - LOG_INF("Connecting to the fake WOPI server: /lool/" << wopiSrc << "/ws"); - - _ws.reset(new UnitWebSocket("/lool/" + wopiSrc + "/ws")); - assert(_ws.get()); + initWebsocket("/wopi/files/0?access_token=anything"); - helpers::sendTextFrame(*_ws->getLOOLWebSocket(), "load url=" + wopiSrc, testName); + helpers::sendTextFrame(*_ws->getLOOLWebSocket(), "load url=" + _wopiSrc, testName); helpers::sendTextFrame(*_ws->getLOOLWebSocket(), "save dontTerminateEdit=1 dontSaveIfUnmodified=0", testName); _phase = Phase::Modify; |