Commit graph

240 commits

Author SHA1 Message Date
Ashod Nakashian
ff6f49c598 wsd: more string split tests
Change-Id: Idd6e99954b11238eaf64e11e7969d0aee1612557
Reviewed-on: https://gerrit.libreoffice.org/57648
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
(cherry picked from commit f64e0fba92ad80776572255951b2e0d76bc76e73)
2018-10-16 20:12:23 -04:00
Ashod Nakashian
b6333ada8d wsd: anonymization improvements and unittests
Also support anonymization of downloadas documents
and renaming of documents.

Reviewed-on: https://gerrit.libreoffice.org/57541
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit 78248a542c9ca31bf9ad4cad9b55d78690384395)

Change-Id: I81a80e6290217659987d73f625e5f0fb81cb7ef2
2018-10-16 20:12:23 -04:00
Ashod Nakashian
053161b3f5 wsd: move string utilities into Util
Reviewed-on: https://gerrit.libreoffice.org/57539
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit fb2671c4145edd4d4e359f0dcf5cc84835487cd4)

Change-Id: Idc578dff4e8ee5e48c1b7780d3feb2d21c6a9b13
2018-10-16 20:12:23 -04:00
Ashod Nakashian
6c18aa7e88 kit: anonymize usernames and filenames in Kit
Change-Id: Id7928136db71ded7bf6b1a5e8e387db7251f8a35
2018-10-16 20:12:23 -04:00
Ashod Nakashian
03f58b9a9a wsd: disable tile caching when TileCachePersistent is false
Change-Id: I660438d478ab6d1ef60575b5f63b71c8b86bab4f
2018-10-12 17:43:31 +02:00
Michael Meeks
8211bef32f Hide other view cursors on zoom.
Change-Id: I9e953f841b5c526b499f9170aef9b2682011947e
2018-10-09 21:48:17 +01:00
Tamás Zolnai
f16a868226 Reduce the running time of testWireIDFilteringOnWSDSide
Change-Id: I1c7e576aaa1af938380a2de33b1512b31ef6ca75
2018-10-01 18:36:50 +02:00
Tamás Zolnai
4512d4090f Reduce the running time of these this test
Change-Id: Iaf72007309e8e2aca09a01e7d1637f2875f3e564
2018-10-01 18:29:20 +02:00
Tamás Zolnai
ac2cd92d25 Upper limit of sent out versions of the same tile
We try to decrease the network usage with avoiding sending out
to much tiles to the client. When we already sent out two versions
of the same tile without having the tileprocessed message from the
client we delay sending out the next version to avoid spamming tiles
on the network.

Change-Id: Ia47cd7c0d3fb829f6777f0c3265970433591df19
2018-09-29 09:27:06 +02:00
Tamás Zolnai
a1e2acd5ef Better to have a smaller tiles-on-fly limit
It's good if this limit big enough to send all the tiles of the
current visible area at once, so the tiles arrive at the same
time to the client by zoom or scroll. Now this value is set to a bit
bigger so if we have a small amount of tiles before zoom / scroll we'll
still see the same on the client side.

Change-Id: I8e28dbf6197fe2f683fe9528e9a32c15a191b20e
2018-09-29 09:27:06 +02:00
Tamás Zolnai
9683f53a9c Filter out tiles by wired on wsd side too
Some times tiles with the same wireID survives the wireID
filtering in kit, so we should do that in wsd too.
The issue is with the tilesBeingRendered construction. First when
one tile is filtered out on kit side the client remains subcribed
to the tile, since wsd does not know filtering happened.
Second via the tilesBeingRendered object more clients can be subcribed
to the same tile and so when one client request a new version of this
tile (with an old wireID) the rendered tile is sent to all subscribed
clients even if the other clients has up-to-date tiles.

Change-Id: I4ca6b7a83a5d6979a9f924d766a71aba5e5362c7
2018-09-29 09:27:06 +02:00
Tamás Zolnai
a1a0bf3718 Don't send tiles which was changed outside of the visible area
Since this commit:
9473908d45
We can avoid that, because the tiles will be invalidated
on the client side and when the client visible area changes
the invalidated tiles are requested anyway.

Change-Id: I272e3b4b87380ae574c16a2b480dbc8caabf4b32
2018-09-29 09:27:06 +02:00
Tamás Zolnai
5260eae05f Avoid rendering / sending the same tile twice
When we're doing the prerendering we also need to register
a tileBeingRendered object, so we know that the given tile
will arrive soon. In earlier version of the code, rendering
and sending of the tile was not separated in time, but now it is,
so we need create a tileBeingRendered object even if we don't
subscribe the client to it yet.

Change-Id: I1374c22e5ffebe1d6fcc6e37261ddcedeb9066ec
2018-09-29 09:27:06 +02:00
Tor Lillqvist
87b85ff8f0 Be consistent in how we name "interface" abstract classes
We already use a suffix "Interface" for SocketHandlerInterface, so
rename IDocumentManager to DocumentManagerInterface.

Naming "interface" classes with an "I" prefix is C# and COM style.
Sure, that is a convention as good as any other, but let's try to be
consistent within this rather small code-base.

Change-Id: I9c356df327debd780f23ed2b2e6d6e630328861e
2018-09-12 19:27:23 +03:00
Tamás Zolnai
1e0b4928ad Remove this printing line used only for debugging
Change-Id: I482adcac61cf2fa4bec4fb02feec0e23370a3e45
2018-09-03 16:54:12 +02:00
Tamás Zolnai
8085b112dc Add some test for the new tile rendering code
Change-Id: I92e925740e67a62cd69e8c8135484c10d74dabc8
2018-08-30 18:43:43 +02:00
Miklos Vajna
9a4626ae0d test: no need to copy testname 2018-08-27 09:10:10 +02:00
Tamás Zolnai
1001f083f1 Remove this test, it just dumps the result instead of assert on that
Change-Id: Id9976d98bbd30cb38cee86b1ff45b96922065d11
2018-08-16 16:02:20 +02:00
Miklos Vajna
9ed7c1065c common, kit, test, wsd: these parameters are copied for each invocation ...
... but passing by const ref is enough
2018-08-13 09:26:15 +02:00
Tamás Zolnai
4d1ffab941 Disable testCancelTilesMultiView
It's seems unstable. After canceltiles wsd still can send tiles
if they already in the senderqueue.

Change-Id: I28f669aa18dfbfee1d9d242bd1ee3d0490f06c68
2018-08-03 13:50:40 +02:00
Tamás Zolnai
33a0cb1ee7 Fix failing unit tests after latency changes
With the new code, wsd is waiting for tileprocessed messages
if the upper limit of tiles-on-fly limit is reached. To avoid that
send canceltiles message.

Change-Id: Iadf16c834f12d14000d630078882dfa8e11a99a0
2018-07-19 14:19:07 +02:00
Tor Lillqvist
3b4269a301 Use Util::symbolicErrno()
I think the general policy should be to always log errno using both
Util::symbolicErrno() and std::strerror(), never log a naked errno.
But only in cases where we know that it is highly likely that it is
the most recent system call that has failed, so errno makes sense.

Change-Id: I4a1fb31e375ea949e7da17687464361efe7c1761
2018-07-11 13:05:22 +03:00
Michael Meeks
7e6e81eb46 Implement client websocket masking.
Disable this for easy strace debugging and a bit of perf. to the forkit.

Change-Id: Ia330582817481410d26df50db5eb42b4692ad01c
2018-06-15 14:54:19 +01:00
Andras Timar
1fd5dbd787 Do not use the word 'Error' here (tinderbox)
Change-Id: If5bbfceb624974801ffb84e52e6aa1b7e599a7ae
2018-06-15 15:14:14 +02:00
Andras Timar
bf0e286cc9 Use absolute path to load unitlibs
I had a scenario when they were not found (tinderbox).

Change-Id: I48f40b62f74a1ffbab64ad9a9b677f8cf66a1232
2018-06-15 08:34:06 +02:00
Michael Meeks
ac0f61adad Count kits better for crash testing.
Change-Id: Icf04d4124e2b538886c8568358e94d00baeefeb4
2018-05-18 15:55:57 +01:00
Michael Meeks
ed87891d28 Make PNG tile tests more robust.
Change-Id: Id7afcfe9b29b2d5544e296b13f04c195d35655b5
2018-05-18 14:32:50 +01:00
Michael Meeks
fde34f6e17 Better debugging of tests.
Change-Id: If3b3d2ad862526238bee3c092389c8cc266b24e6
2018-05-18 15:16:40 +02:00
Jan Holesovsky
98ed24257b Move the functionality from connectToMonitor() to SocketPoll.
Change-Id: Iab2ac09638323f5e59f7a2ea0d880f52989ad64d
2018-05-18 15:16:40 +02:00
Michael Meeks
98bb6f420b Make slideshow unit test more verbose.
Change-Id: I8c9764d86962e93155421ce47f48689eb826533a
2018-05-14 12:03:17 +01:00
Andras Timar
04feab241f use local tile cache directory for tests
Change-Id: I4c66a45df93bee22131c5950029cffa863d397b0
Reviewed-on: https://gerrit.libreoffice.org/54028
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2018-05-09 15:29:28 +02:00
Henry Castro
329b3518e7 wsd:test: use TDOC preprocessing symbol
Change-Id: Ib00fc7c9fe7ebfd308b330d430e8f2449e5da7cd
2018-04-29 20:27:14 -04:00
Tamás Zolnai
ffd7151443 Writer: View jumps to cursor position even if it is moved by an other view.
Need to get the viewid which moved our visible cursor, so we can check
whether it positioned changed by the owner of the cursor or not.

Change-Id: Ie7b1fafc8d8f11fba0c0b0d5f02d755e15284514
Reviewed-on: https://gerrit.libreoffice.org/52571
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2018-04-10 17:00:21 +02:00
Michael Meeks
50a28669aa Disable limit tests for now.
Broken by 96292dc873

Change-Id: I954a06e5b964f522901c8a778c6bc0510208a3a2
2018-03-28 16:38:10 +01:00
Andras Timar
c3afdf32e4 add png files for DeltaTests::testDeltaSequence to dist tarball
Change-Id: Ib8007ce17e71e7a343dc3572364788e6f2c3efa2
2018-03-07 13:48:56 +01:00
Ashod Nakashian
5befd0803a wsd: improved wopi info parsing
Better logging during wopi info parsing,
especially upon failures.
Refactored the code from Storage.cpp into
JsonUtil.hpp.
Minor optimizations.

Add unit-tests for the parsing logic.

Change-Id: Ifebc3f6b7030a6c7b3b399786633f6b5e8737478
Reviewed-on: https://gerrit.libreoffice.org/49927
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-02-23 16:54:39 +01:00
Samuel Mehrbrodt
543cec6546 Add example documents for Impress and Calc
Change-Id: I54980b7224f2fab6883720c58c6aa377b0ec9339
Reviewed-on: https://gerrit.libreoffice.org/50189
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-02-23 09:57:49 +01:00
Ashod Nakashian
2562d8919a ut: log the test name for easier traceability
Change-Id: Icbcbb36857b748c2ac2d0d36a5c4c23609f5453a
Reviewed-on: https://gerrit.libreoffice.org/49568
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-02-11 19:22:14 +01:00
Ashod Nakashian
7be98efd93 ut: log timestamp to track timeouts better
And improve the logging support in unit-tests to
help troubleshoot issues faster and more accurately.
Also makes the code more readable (hopefully).

Change-Id: I4f8aafb5245e2f774b03231591a74544f9ec84aa
Reviewed-on: https://gerrit.libreoffice.org/48645
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-02-11 19:21:15 +01:00
Ashod Nakashian
31130989ed ut: fix HTTPWSTest::testLoadTortureODP
Change-Id: Ibe3bd98c1cd68da962cc8d93b837597fb7167f45
Reviewed-on: https://gerrit.libreoffice.org/48644
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-02-11 19:18:38 +01:00
Pranav Kant
40a56e31dd Unbreak some wopi tests; use fractional fractional iso8601
And we read the "LastModifiedTime" from the JSON payload in PutFile
response, not from the headers. Change that so that wsd now reads the
correct time.

Change-Id: Ic930ef4cfb2744367d04ba460fa1cbeb045b7356
2018-02-09 01:14:18 +05:30
Pranav Kant
39f11ab4f7 document conflict: unit test
Change-Id: I4ea310fe5adb198bc7b5e083f6bd4b0431c0cdef
2018-02-09 00:22:57 +05:30
Pranav Kant
cb0d652899 Try to act like a wopi test server bit more realistically
Change-Id: If10a65a3e7740a752057f63072f1ada1be3552e7
2018-02-09 00:22:57 +05:30
Pranav Kant
5bd4d67818 versionrestore: unit test; checks if wsd saves a modified document
See comment for more details

Change-Id: If79537c4ca61926f06015ad6827a473d18a2a79f
2018-02-08 19:57:20 +05:30
Pranav Kant
4aa496e913 Unused variable
Change-Id: Ice363f65d2ce3af818cf28396449b6d0402d6fc7
2018-02-08 17:43:54 +05:30
Pranav Kant
ad1da235d3 IME support
Dialogs still need to be adapted to this. Only works for documents as of
now.

Change-Id: I0fb1114e279a9e563943f3f65dd5a577523e9841
2018-02-08 14:16:34 +05:30
Pranav Kant
5476774af1 wsd: Use a close request flag to break out of doc broker poll thread
... instead of directly stop()ing it. The close request approach also
makes sure that outgoing document is saved to storage.

Change-Id: I44f61db00dbd326dec80f59f4a2cbb617048aa94
Reviewed-on: https://gerrit.libreoffice.org/49122
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-02-07 14:30:33 +01:00
Miklos Vajna
4bcfdbb5b3 test: spell out non-trivial autos to improve readability
Change-Id: Ie3b4b961c50ab61ef63380c4724a0f00e8f960d2
2018-02-07 10:18:12 +01:00
Ashod Nakashian
c06376cc1d wsd: cleanup logging and remove unused helpers
Now all logging is done after checking if the
level in question is enabled or not (thanks to
the macros LOG_XXX), which saves unnecessary
conversions and stringification when said level
is disabled.

Change-Id: Icde31e067f60269563896f04f8b0d65643720766
Reviewed-on: https://gerrit.libreoffice.org/47885
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2018-01-19 00:33:40 +01:00
Tor Lillqvist
217636ed44 Drop meaningless "loolnb" word from a comment, drop two related #if 0 blocks
"loolnb" used to mean the concept of using non-blocking sockets back
when that was experimental proof-of-concept work in progress, but that
work has been merged in long ago and there is no neeed for the term
any longer.

Change-Id: I4c49b625fe8be8892b82115eaaa47bcba0f29500
Reviewed-on: https://gerrit.libreoffice.org/47699
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2018-01-10 13:01:26 +01:00