Commit graph

85 commits

Author SHA1 Message Date
Ashod Nakashian
6a3242ce96 wsd: no tabs
Change-Id: I0537f7437328cb758e691d8e0ddc12d78da11f6a
Reviewed-on: https://gerrit.libreoffice.org/34353
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-10 10:47:37 +01:00
Andras Timar
738792d5ff use key.pem from source directory for unit tests 2017-02-28 22:54:03 +01:00
Ashod Nakashian
6cd1d511be wsd: avoid segfault when handling invalid paste command
The payload of paste can't have length 0.

Now we silently skip such cases, although perhaps we
should be more strict and disconnect the offending
client.

Change-Id: Iaa2e7373277f9e7d85209aec56a2f8ee0ef7e801
Reviewed-on: https://gerrit.libreoffice.org/34112
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-10 07:02:26 +00:00
Jan Holesovsky
5873d15c62 fuzzer: Use the dummy LOK implementation when fuzzing.
Now it is possible to use:

  ./loolwsd_fuzzer --config-file=loolwsd.xml --o:storage.filesystem[@allow]=true --o:logging.level=fatal --fuzz=/tmp/looltrace

Ie. no need to specify the LibreOffice install location.  Ideally worth
disabling the logging output too, to gain higher performance.

Change-Id: I4fa5f275cd4f4a52fe2cd07e658cea726f6f31c2
2017-02-08 11:54:50 +01:00
Jan Holesovsky
964ae25ccf fuzzer: Factor out the replay functionality to a separate file.
Change-Id: Ief946b1703ef1ca0b17de3467dce66b4c3da2601
2017-02-08 08:35:13 +01:00
Pranav Kant
53bdbce4c1 Disable these tiled comment rendering related tests
We have enabled LOK_FEATURE_NO_TILED_ANNOTATIONS flag already
in Kit.cpp, which means these tests, which assume comments are
rendered as tiles, are no longer relevant, so lets disable them
for now. Surely sometime in future they would completely be
removed and replaced by new tests that assume comments are *not*
rendered in tiles and rather are added/modified/removed by using
comments API. See LOK_CALLBACK_COMMENT for details.

Change-Id: I48b7a0a0aa116d164a3654618ab0e95252d29cf3
2017-02-04 22:33:35 +05:30
Ashod Nakashian
b9a7e1ef03 wsd: improved test and cosmetics
Change-Id: I25a0a27c12394f41af8e021b72627b1c0537a166
Reviewed-on: https://gerrit.libreoffice.org/33862
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-03 07:08:43 +00:00
Ashod Nakashian
e325bc2978 wsd: ensure test doc is closed before reloading
This reduces the chance for random test failures.

Change-Id: I961a502d57a3cb4946b3b7febc6e6b03e7f36aa1
Reviewed-on: https://gerrit.libreoffice.org/33858
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-03 07:05:23 +00:00
Ashod Nakashian
016a85b643 wsd: allow testing higher MAX_DOCUMENTS and MAX_CONNECTIONS
Change-Id: I678af51871c2b145ce91c1646315a00ea1ac60fa
Reviewed-on: https://gerrit.libreoffice.org/33676
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-30 02:11:47 +00:00
Ashod Nakashian
c2d8e7bb4c wsd: unittest max views
Change-Id: I832e2d3e004001c271089382c5e1241b07572eb7
Reviewed-on: https://gerrit.libreoffice.org/33675
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-30 02:11:30 +00:00
Ashod Nakashian
1ba7c0209a wsd: cosmetics
Change-Id: I58a9e579e228d7b4a1e1b5686988aeff8da9922f
Reviewed-on: https://gerrit.libreoffice.org/33674
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-30 02:11:13 +00:00
Ashod Nakashian
9a8fe7054a wsd: more time to count lool processes
In unittests we need to count the
number of lool processes. This can
take a long time depending on how many
they are and if they are exiting or
new ones being created.

New logic is to reset the timeout
when the numbers are changing until
it settles on either the expected
(when we return), or some other value.

Change-Id: Ia8fcc7ef60586ebec6d8a280174b4dd2eae0ccc4
Reviewed-on: https://gerrit.libreoffice.org/33672
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-30 02:08:39 +00:00
Ashod Nakashian
3816b0c8eb wsd: faster and more informative tile tests
Change-Id: Ifcd179600ca1b019f43a86eaf0fd11a5d8a6177a
Reviewed-on: https://gerrit.libreoffice.org/33667
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-30 02:03:54 +00:00
Jan Holesovsky
da93cd416b Temporarily disable, these tests are affected by the order of invalidates.
Change-Id: Icd08629315417f3ca8f2c5560271a12c62309956
2017-01-27 19:17:42 +01:00
Jan Holesovsky
c44f7b8a76 Revert "loolwsd: improved MessageQueue"
Now we don't get a situation where there would be a tremendous amount of
invalidates & tile render requests piled in the queue, so we can do it
deterministic again.

The only thing that could potentially pile in the queue are the keypresses
events sent from the clients, but that is a different problem anyway.

This reverts commit c326228774.

Change-Id: I98e199eab0187bf5f47ce322ac1b1b2e3b976b85
2017-01-26 11:49:29 +01:00
Jan Holesovsky
3c9f4e1e1f Deduplicate & remove obsolete invalidations from the queue.
There's no point in trying to paint something we know will be obsolete anyway.

Change-Id: I14f61f389b114f2cda1f97e5223b31fa2f01b06c
2017-01-26 11:49:29 +01:00
Ashod Nakashian
f1de0d0481 wsd: MessagePayload -> Message
Change-Id: Ie65f7c707785dbbf85a2f98abf082fbc3ee7a64b
Reviewed-on: https://gerrit.libreoffice.org/33428
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-23 05:47:03 +00:00
Ashod Nakashian
6b17f96318 wsd: refactor MessagePayload into own file
Change-Id: Ifc0d2abd2e94d4a1b58915664fb0545dca6e96cc
Reviewed-on: https://gerrit.libreoffice.org/33427
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-23 05:45:23 +00:00
Ashod Nakashian
16eb196820 wsd: each Message object now has a unique ID for logging purposes
Change-Id: I5f3c3afec57f3d9336e0994a1d87421281028d79
Reviewed-on: https://gerrit.libreoffice.org/33426
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-23 05:42:34 +00:00
Ashod Nakashian
0f73bd9bf2 wsd: improved testConnectNoLoad
Change-Id: I8eff5b4862067444c8623582dc4f3baa585f164e
Reviewed-on: https://gerrit.libreoffice.org/33425
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-23 05:41:46 +00:00
Tor Lillqvist
32b92dcd91 Bin default values for parameters that were defaulted at just one call site
Change-Id: I965b0be1ad4f706a06d06d5c6c3f940c1b3cc33c
2017-01-16 14:05:10 +02:00
Tor Lillqvist
2f900a3a1d Skip unit-oob.la for now as loading it fails with an undefined symbol
Which is not odd, as it seems to be a forkit process that tries to load
unit-oob.so, and the symbol in question,
UnitWSD::testHandleRequest(UnitWSD::TestRequest,
UnitHTTPServerRequest&, UnitHTTPServerResponse&), is in LOOWSD.cpp.
Oh well. Whatever.

Change-Id: I0e0409b7247acdcd00e830d6fa63e73f27ea6c3a
2017-01-16 11:23:58 +02:00
Ashod Nakashian
42b11e21af wsd: unittest for document load failure validation
Change-Id: I798fa411ab0fcefa6ae1d85e69d8d77f5ca5c919
Reviewed-on: https://gerrit.libreoffice.org/33142
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-16 06:27:00 +00:00
Ashod Nakashian
2be0d16e7b wsd: improved crash kit test
Change-Id: Iddc056383aa37bfe278d4f4003b56696b8f2bf13
Reviewed-on: https://gerrit.libreoffice.org/33118
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-16 01:48:43 +00:00
Ashod Nakashian
8cbf478bfe wsd: improved getErrorCode
Change-Id: I89b36b5e69cbbe05ac7b1730633d695bc5185823
Reviewed-on: https://gerrit.libreoffice.org/33117
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-16 01:45:03 +00:00
Ashod Nakashian
0e5a75c46b wsd: exit the kit only when no more sessions exist
Change-Id: I26cd8876fd564f537dac4fb1748aee5b4dbdff04
Reviewed-on: https://gerrit.libreoffice.org/33114
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-16 01:43:08 +00:00
Tor Lillqvist
bc19f90dd4 Don't send a tile that hasn't changed even if client asks for it
The server tells the client the hash of each tile it sends (calculated
from the contents of the tile, not its PNG encoding). When the client
asks for a tile to be refreshed, it tells the server what the hash of
the existing tile is. If the server notices that the tile contents
hasn't actually changed, it doesn't PNG encode it and doesn't send it
to the client.

The intent is that this will reduce load on the server and also avoid
unnecessary tile traffic.

Change-Id: Ia06ca68655ea984ed4319f24f4470afda322eccf
2017-01-11 23:25:21 +02:00
Tor Lillqvist
29fc49acf2 Bump the message first line abbreviation limit to 500 characters
If we are logging a message, we want to see the first line of it in
its entirety if possible. Especially now with more parameters being
added to tile messages, 120 was not enough to see the added
interesting ones.

Bin the silly test that used knowledge of what the limit is. We should
not test a coindidental arbitrary number that is not a documented part
of an API. If we want to test the default abbreviation functionality,
we need to at least make that default limit (now 500) public in
Protocol.hpp.

Change-Id: Iea59ba46e8331e2a839c792146f123fed9df2b82
2017-01-11 23:25:21 +02:00
Tomaž Vajngerl
d24fb462d7 Test password protected OOXML and Binary MSO documents
Change-Id: Ie871ea72f2670bcb23c25697bb669128ded851d9
2017-01-10 12:44:20 +01:00
Ashod Nakashian
f861a9e1a7 wsd: new unittest for multiview tiles when disconnecting
When there are many views requesting tiles,
disconnecting any should not cancel tiles
for other views.

Change-Id: I6029432c4b9ab931811dcb3b03b0441b413a9971
Reviewed-on: https://gerrit.libreoffice.org/32872
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-09 06:27:43 +00:00
Ashod Nakashian
a775f5e585 wsd: split testStateUnoCommand one for each app
Change-Id: I4f6275e289c1a64a05df5b5e4c2708b8ab5b3f83
Reviewed-on: https://gerrit.libreoffice.org/32871
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-09 06:26:30 +00:00
Ashod Nakashian
b8949715e8 wsd: split testGraphicViewSelection one for each app
Change-Id: I8da3470d4ad9cd666bb4cd18cb8d66a0f6b0c8cb
Reviewed-on: https://gerrit.libreoffice.org/32870
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-09 06:25:27 +00:00
Ashod Nakashian
92ac46e5f1 wsd: no need to render all tiles of all parts in unittests
Change-Id: I4d2eadf64f0c86e4b83af2f25a772f4b88d6a987
Reviewed-on: https://gerrit.libreoffice.org/32869
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-09 06:24:20 +00:00
Ashod Nakashian
e232ffcdf9 wsd: log unittest duration
Change-Id: I12ed5b3bb776e0dc562dfdddb1d6ffc7f0aedf31
Reviewed-on: https://gerrit.libreoffice.org/32868
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-09 06:23:23 +00:00
Ashod Nakashian
bd65ed2f88 wsd: testInsertAnnotationWriter made more stable
Change-Id: I72a531118054b055a997e50168cbd503ea25b9c8
Reviewed-on: https://gerrit.libreoffice.org/32867
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-09 06:22:43 +00:00
Ashod Nakashian
2a57df3018 wsd: log the test name in unittests
Change-Id: I2e83699f80ad35c475452b90fa20b46e4e95f450
Reviewed-on: https://gerrit.libreoffice.org/32866
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-09 06:21:58 +00:00
Ashod Nakashian
93c66eeb9b wsd: fixup tileInvalidatePartImpress
Since the Impress slides use large fonts, we end up
overflowing the part bounds with this test.

Luckily the top row of text has smaller font, and
more vertical space within the slide, so now
we edit the top-left textbox and this test
doesn't fail anymore (tested 50 times) when
it failed ~1 in 4 previously.

Change-Id: I13d8cc4462d48b128578a9d3fdde90a79c607c4b
Reviewed-on: https://gerrit.libreoffice.org/32862
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-09 06:19:35 +00:00
Ashod Nakashian
4e9e019564 wsd: refactor/dedup the lokit process counting tests
Change-Id: Iebf7756c6a5c2bc581a0ade4fe13fad752eb7d20
Reviewed-on: https://gerrit.libreoffice.org/32861
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-09 06:18:43 +00:00
Ashod Nakashian
4580ed4e27 wsd: prefix the test docs with the test name
This makes debugging much easier as one can
readily match WSD logs with a given test.

Change-Id: I8f2c83d67189038699af3f24dee205bc7efb5c28
Reviewed-on: https://gerrit.libreoffice.org/32860
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-09 06:17:43 +00:00
Ashod Nakashian
496fbda659 wsd: cleanup ColumnRowSize and OptimalResize unittests
Change-Id: I1e4681aeb0ac51df34ca585ddecd53cad47f3fda
Reviewed-on: https://gerrit.libreoffice.org/32859
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-09 06:17:19 +00:00
Ashod Nakashian
e6ee7c2756 wsd: MAX_DOCUMENT is now always defined as positive
Change-Id: I06018eeaab88bb3ede896bf7d74e1a7ce6f84325
Reviewed-on: https://gerrit.libreoffice.org/32857
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-09 06:15:11 +00:00
Ashod Nakashian
dfcada64b8 wsd: tilecombine now includes the versions of the tiles
Previously tilecombine had its own version, which is
nonesensical, since it's not really a tile.

Now it passes the version to the tiles when
parsing and serializes version per-tile.

Change-Id: I5db8d94880431e3d2a40b6787c6fe51a05771305
Reviewed-on: https://gerrit.libreoffice.org/32633
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-09 06:09:05 +00:00
Tor Lillqvist
a36d4b0fc3 Reanme png namespace to Png for consistency
As far as I see, we tend to use the same namespace name as the
basename of the corresponding include file, and this stuff is defined
in a file called Png.hpp.

Change-Id: Id859e13e94568abd9f1d5b4ef3bfbbb0c156db11
2017-01-04 13:35:26 +02:00
Ashod Nakashian
73cdebc60c wsd: fixup alert all users unittest
Change-Id: I8d9c7581ed2ae42e180301c38a8775cb8dcb396a
Reviewed-on: https://gerrit.libreoffice.org/32716
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-04 04:33:17 +00:00
Ashod Nakashian
e665a20565 wsd: fixup max documents unittest
Change-Id: Ie61abcf5ce486463de3556522e2c726926ee4039
Reviewed-on: https://gerrit.libreoffice.org/32714
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-04 04:31:33 +00:00
Ashod Nakashian
606f85db87 wsd: fixup max connections unittest
Change-Id: I107dadb973554b21f20211c8316cec7139953f47
Reviewed-on: https://gerrit.libreoffice.org/32713
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-04 04:31:00 +00:00
Tor Lillqvist
f94d4c789d 'Handshake' is one word
Change-Id: Ibef905cc42a74052738a71bd4743431e30b863d1
2017-01-02 13:29:09 +02:00
Ashod Nakashian
6f6f308895 wsd: more robust canceltiles unittest
Change-Id: I0a71bbb84ff4ca3233d8a78a7c4b3718ec0ad382
Reviewed-on: https://gerrit.libreoffice.org/32634
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-02 06:19:44 +00:00
Ashod Nakashian
7dad1c5f6a wsd: more forgiving canceltiles unittests
canceltiles is not guaranteed to prevent
tiles from getting sent back to the client.

There is an obvious race between receiving
tile requets and cancelling them.

This reduces failures by repeating the
unittest when there is spurious failure.

Change-Id: Icf299e2212e175dc4c0cbc1d2f91c37725f2b261
Reviewed-on: https://gerrit.libreoffice.org/32631
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-02 06:17:21 +00:00
Ashod Nakashian
94b2262e27 wsd: don't test for pathological Poco behavior in our unittests
Change-Id: Ia7122eacce836aab5bef29c16529cbed16856be8
Reviewed-on: https://gerrit.libreoffice.org/32625
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-02 06:12:42 +00:00