Commit graph

34 commits

Author SHA1 Message Date
Ashod Nakashian
fcb0f8557a wsd: test: killpoco for UnitCopyPaste
Change-Id: I655e29619b110fce23881dab29828ecb7966890e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-08-02 09:24:46 -04:00
Ashod Nakashian
52f2600cf9 wsd: test: embue all tests with a name and unify logs
Now the remaining tests that didn't have a name
get one and the logs are unified between old-
and new-style tests. Mostly.

This makes sure that all logs and assertions
properly log the test name and make test
failures easier to debug and fix.

Change-Id: Id159ffacc81642a6ec594c5143498408adab67cf
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-17 18:52:48 -05:00
Andras Timar
f07ff8c7e0 rename: remaining lool->cool changes
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ib7d4e804bebe52dead8d53b0e0bbaed0f08bf3d0
2021-11-18 14:14:11 +01:00
Ashod Nakashian
17cdf3766d wsd: test: improve the stability of UnitCopyPaste
The .uno:Copy command has to get executed before
we can read the clipboard. Since .uno commands
are executed asynchronously, it possible to
invoke getClipboard before having the data
copied into it, thereby failing the test.

Here we wait for the first sign that the
.uno commands have been executed, although
we can't know if they have finished or not.

This improves the test reliability significantly.

Change-Id: I7da1e4a32092c05dfb533571ea50d5edbc07f554
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-27 08:09:49 -04:00
Ashod Nakashian
f20b1f3899 wsd: test: better logging in copy/paste
Change-Id: Ia9561f6603b79336b908fade40d49465c2288a4b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-27 08:09:49 -04:00
Ashod Nakashian
b47c81e7a8 wsd: improved WebSocketSession interface
SocketPoll is captured as weak_ptr into
WebSocketSession and a much better shutdown
support is now available. The new logic
can do async-shutdown after flushing and
will do sync-shutdown if SocketPoll is
no longer around.

Change-Id: Ia206cab58a13f20f7aeb3a6d8c57afee731c8231
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-27 08:09:49 -04:00
Ashod Nakashian
0f94eb261c wsd: test: killpoco in UnitCopyPaste
Change-Id: I2657a095e0a9d79b678c826db46b9c69d9aac056
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-27 08:09:49 -04:00
Ashod Nakashian
37e6ed0a51 wsd: test: dump clipboard state in test to the log
Change-Id: I337703d899ef6e85a9a0960d4cce8c174fc2f2f6
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-12 09:06:38 -04:00
Ashod Nakashian
9a2acf2558 wsd: test: better loggin in UnitCopyPaste
Change-Id: Idf684249b87b9b73d21fd6ee101364bf49ae7a5d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
5c6cd3aaec wsd: test: properly include config.h in the tests
When config.h is not included, the build
configuration is missing from the translation
unit in question. This affects ENABLE_SSL,
for one.

Also, HttpRequest.hpp depends on LOOLWSD_VERSION,
which is defined in config.h.

The config.h header must be included in all
trasnlation-units, and must be the first include.
This is to avoid conflicts and/or mismatching
binaries built with different compile-time values.

We also statically assert if LOOLWSD_VERSION
is not defined, to help the error message.

Change-Id: Ic4b45de879f3360a07e9507fdf04abfa4cec6a71
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-02 12:43:39 -04:00
Ashod Nakashian
65f71a2efb wsd: better logging of hex data dumps
And guard http data dumping with debug directives.

Change-Id: I22a725ba49bfb0399a27889ce9732dfe061e2563
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-13 19:34:02 -05:00
Ashod Nakashian
5467a7f7ef wsd: simplify and document dumpHex
Change-Id: I636dd6548b0712a72dfc162eb7381e3e7ac18b5a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-13 19:34:02 -05:00
Ashod Nakashian
95bb52d945 wsd: test: better logging
Change-Id: I3d17afb2e76f1d4b2b27182a6419482801342e8c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-08 22:49:53 -05:00
Ashod Nakashian
43eaf4d8df wsd: test: better exception handling in UnitCopyPaste
invokeWSDTest is called in an exception-safe scope
and logs errors before failing tests. No need to
have the same logic here.

Also improve the exception handling and reporting
in the fetchClipboardAssert helper.

Change-Id: I306aedc3f50f93bf8a5448f1d098e5ce884ceb37
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-08 22:49:53 -05:00
Ashod Nakashian
6e88701702 wsd: test: assert when failing copy-paste test
The assertion will include much more info than
simply flagging for failure, which helps in
troubleshooting failures.

Change-Id: I6bd649e5334a90e9feaf0d72347790088f70c1b3
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-01 21:50:18 -05:00
Ashod Nakashian
ff68273549 wsd: test: logging in copy-paste test instead of cerr
Change-Id: Ia80721179c37ef159cb0c8206ba13f650ad03244
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-01 21:50:18 -05:00
Ashod Nakashian
96c9e03b88 wsd: test: catch and fail WSD tests when exceptions are thrown
Change-Id: Ifaabb6387d86c5a80e00cd5de34093520a1e9d66
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2020-12-28 12:04:53 -04:00
Ayhan Yalçınsoy
42c56919b3 Remove Poco/TimeStamp.h left-over part-2
Change-Id: I2d5ce91cab57fb0806f4edb7045207cf32de99bb
Signed-off-by: Ayhan Yalçınsoy <ayhanyalcinsoy@pisilinux.org>
2020-10-27 11:56:51 +03:00
Andras Timar
0002fdfd6c fix license headers
Change-Id: I8623770b32d278a45357dc7f757fabfadd2b4af7
2020-10-01 11:56:43 +02:00
Ashod Nakashian
4a57654d88 wsd: avoid unnecessary string ops
Change-Id: Ia5a6f2d7a260edaf8bb294693be12a434a2c30fe
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96376
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2020-06-23 06:41:58 +02:00
Ashod Nakashian
224ef08c7f wsd: single-char string literals -> char
More readable and typically more efficient.

Change-Id: I9bd5bfc91f4ac255bb8ae0987708fb8b56b398f8
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95285
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2020-06-02 01:31:26 +02:00
Pranam Lashkari
d7bc9ff2e4 killpoco: removed StringTokenizer from test directory
removed use of Poco::StringTokenizer from the test directory using LOOLProtocol::tokenize and std::vecor<std::string>

Change-Id: I20fc2e0ef0d0d8fc959fee7972aa095f2581c181
Reviewed-on: https://gerrit.libreoffice.org/82565
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-11-13 09:20:25 +01:00
Michael Meeks
9e791fb0d4 clipboard: persist selections for a while after a view closes.
re-factor ClientSession state to be a simpler state machine.
Have a nice disconnect / disconnected handshake on view close.

Change-Id: Ie933cc5c7dfab46c66f4d38a4d75c459aa1cff87
2019-08-05 22:21:54 -04:00
Michael Meeks
b3415abea0 clipboard: test two separate views' clipboards.
Change-Id: Ie6f2eeb1f1dd3c762cca847f4c77a5cd7d39f70a
2019-08-05 21:36:49 -04:00
Michael Meeks
095edb28e2 Adapt to new 'getClipboard' API - works on clipboard not selection.
Vital for a working 'cut'.

Change-Id: I980a4d65ef14eb922343d1d321177a9b3e1629f3
2019-08-05 21:28:09 -04:00
Michael Meeks
13469e8b00 clipboard - set it with a post now.
Change-Id: I6b9234988185984335408da502f479ccda8a95a7
2019-08-05 21:18:44 -04:00
Michael Meeks
15af6cf042 clipboard: test for set-clipboard endpoint (disabled).
Change-Id: I3bc31dfb231aaacc01ddd717b39abdebd26a76bb
2019-08-05 21:18:36 -04:00
Michael Meeks
4347883c65 clipboard: add more unit tests.
Change-Id: Id1841935927e451e6aa15489c303dd9f01ac21b4
2019-08-05 21:18:31 -04:00
Michael Meeks
149b861975 clipboard: a more helpful calc test.
Change-Id: Ibe0e583a2019e7bc5968dd8f73cf4e4a07d363b2
2019-08-05 21:18:27 -04:00
Michael Meeks
ba4907b791 clipboard: factor out parsing, and add checks in unit test.
Change-Id: I8c23b10769293b07cc94fdc0d6110e9d540a16b9
2019-08-05 21:18:20 -04:00
Michael Meeks
9726ce6f77 Various copy/paste fixes, unit test passing, parsing of result.
Change-Id: I9168853dd011e86896c3bd474a4d05ee82c0e336
2019-08-05 21:18:12 -04:00
Michael Meeks
c7956349f6 More work getting the unit test closer to passing.
Change-Id: If2ec0d5465a84e11dec1f5c5b9839a369b393784
2019-08-05 21:16:37 -04:00
Michael Meeks
245e509413 clipboard: start of rotating clipboard key management.
Change-Id: I8caab267ec5391e2cd7cb20907fa080111cc70dd
2019-08-05 21:16:37 -04:00
Michael Meeks
c36da1cd97 Implement getClipboard and start of a unit test.
includes Change-Id: I47d38f9285c855dcc6fbeeb73d35f22a46a30c05

Change-Id: I60b84bef1cf832ec5c191d664afd90a080b7ffbc
2019-08-05 20:25:49 -04:00