summaryrefslogtreecommitdiff
path: root/test/UnitWOPI.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/UnitWOPI.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/UnitWOPI.cpp')
-rw-r--r--test/UnitWOPI.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/test/UnitWOPI.cpp b/test/UnitWOPI.cpp
index a1c7cbdaa..59f6282e4 100644
--- a/test/UnitWOPI.cpp
+++ b/test/UnitWOPI.cpp
@@ -24,7 +24,7 @@ class UnitWOPI : public WopiTestServer
LoadAndSave,
Modify,
SaveModified,
- Finish
+ Polling
} _phase;
enum class SavingPhase
@@ -66,6 +66,9 @@ public:
CPPUNIT_ASSERT_EQUAL(std::string("true"), request.get("X-LOOL-WOPI-IsModifiedByUser"));
_finishedSaveModified = true;
}
+
+ if (_finishedSaveUnmodified && _finishedSaveModified)
+ exitTest(TestResult::Ok);
}
void invokeTest() override
@@ -83,6 +86,7 @@ public:
_phase = Phase::Modify;
_savingPhase = SavingPhase::Unmodified;
+ SocketPoll::wakeupWorld();
break;
}
case Phase::Modify:
@@ -97,14 +101,13 @@ public:
{
helpers::sendTextFrame(*_ws->getLOOLWebSocket(), "save dontTerminateEdit=0 dontSaveIfUnmodified=0", testName);
- _phase = Phase::Finish;
+ _phase = Phase::Polling;
_savingPhase = SavingPhase::Modified;
break;
}
- case Phase::Finish:
+ case Phase::Polling:
{
- CPPUNIT_ASSERT(_finishedSaveUnmodified && _finishedSaveModified);
- exitTest(TestResult::Ok);
+ // just wait for the results
break;
}
}