Commit graph

423 commits

Author SHA1 Message Date
Pranav Kant
8ab4682a71 loolwsd: Fix handling of CPPUNIT_TEST_NAME in external test-suite
Doing a plain CPPUNIT_TEST_NAME='somettest' make check will
result in executing all the tests in external test suite. This is
a problem when one wants to execute only internal tests (unit-*
ones) as test harness first executes those followed by all of the
tests in external test-suites.

Lets execute all the tests only when no CPPUNIT_TEST_NAME is
provided, and ignore when it is provided but no match is found.

Change-Id: I7e40b6f3124e6965a86cfb6395d246df3b5c17ba
2016-10-17 21:21:54 +05:30
Pranav Kant
be1e49715c loolwsd: Bring this test back to life
There doesn't seem to be any failure on this test anymore.
Consecutive 20 runs of this test gives no failure, so lets enable
it again.

Change-Id: I77ddd1c36d18162bdc75fd24d51c1a2df22f749d
2016-10-17 18:34:22 +05:30
Tor Lillqvist
9ced5ffdd5 Log how we are actually exiting the test when calling exitTest()
unit-admin fails every time for me at the moment. Make it at least a
bit easier to figure out what is going on.
2016-10-17 13:42:02 +03:00
Tor Lillqvist
fdb16a5d52 Add comment to hopefully avoid others being confused like I was 2016-10-17 12:44:58 +03:00
Ashod Nakashian
72fb908086 loolwsd: limit test documents and connections to the config
...if configured with limits.

Change-Id: Ic148f725c58485ea88f62ddf7b4ac47b3b43ff04
Reviewed-on: https://gerrit.libreoffice.org/29951
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-16 22:14:30 +00:00
Ashod Nakashian
5ba6ce1a33 loolwsd: fix and cleanup HTTPWSError unittests
Change-Id: Ib730c8b3c1eac56bd24c97b62bc12060e437205f
Reviewed-on: https://gerrit.libreoffice.org/29950
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-16 22:11:58 +00:00
Ashod Nakashian
f113d9c9c7 loolwsd: fix and improve kit crash unittest
Change-Id: Icd50faab8c8453d8df39253b75d887d315bda6d1
Reviewed-on: https://gerrit.libreoffice.org/29949
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-16 22:11:39 +00:00
Pranav Kant
edfd3266f8 loolwsd: Reuse storage object; kill superfluous WOPI calls
This reduces the number of fileinfo calls made to storage. These calls can
be expensive in storage such as WOPI where loolwsd needs to
interact with another server to get the file information. Use the
same storage object once created so that fileinfo can be
cached and returned quickly for subsequent such calls.

3 GetFileInfo WOPI calls are now merged into 1.

Change-Id: I56c3d23d3d6d7dc3a4b42433f51304dac28a12e8
2016-10-14 17:18:58 +05:30
Henry Castro
a0a87276f9 loolwsd: fix media type 2016-10-13 16:54:27 -04:00
Miklos Vajna
4104e341f5 Remove unused using declarations
And a few other minor fixes. No need to create an std::string object
when a char number is enough, nor need to copy an object when passing it
by reference is enough.

Change-Id: I3d6aba20ffce781532ea77fe079ce64378db6e12
2016-10-13 08:20:04 +02:00
Henry Castro
bd5e138aa9 loolwsd: fix error message localization 2016-10-12 12:44:44 -04:00
Tor Lillqvist
9fee650f43 Use std::getenv() consistently 2016-10-12 11:47:26 +03:00
Henry Castro
c3c8235561 Revert "loolwsd: test: .uno:AutoSum"
This is no longer need it, because the unit test
was already added to sc/qa/unit/tiledrendering/tiledrendering.cxx

This reverts commit 9b1087e000.
2016-10-11 08:26:02 -04:00
Tor Lillqvist
9ff9452e4c It's 'error:', in lower case
Clearly this if branch has never been reached.
2016-10-11 13:05:17 +03:00
Henry Castro
c62344db81 loolwsd: websocket shutdown cleanup 2016-10-10 22:28:56 -04:00
Ashod Nakashian
366e0e21d5 loolwsd: support timeout on MessageQueue get
Change-Id: Iaad39aaa06c59cdacdd4a864599ef6a4a12976f8
Reviewed-on: https://gerrit.libreoffice.org/29648
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-10 06:29:50 +00:00
Ashod Nakashian
128cd73154 loolwsd: send child messages to client via unified wsd-kit WS
Change-Id: I237120e5a81a2e6d8772a2b6f1e98b1ba567f97e
Reviewed-on: https://gerrit.libreoffice.org/29647
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-10 06:29:32 +00:00
Ashod Nakashian
0f2f49823e loolwsd: unittest cleanup
Change-Id: I90e4fa7d5377b7ecf427c87ce068efdb4bffe933
Reviewed-on: https://gerrit.libreoffice.org/29645
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-10 06:28:06 +00:00
Ashod Nakashian
46aec10c3c loolwsd: cleanup of isDocumentLoaded
Change-Id: I28321bda3000b443aff4603ad438183fa6cfb2f9
Reviewed-on: https://gerrit.libreoffice.org/29644
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-10 06:27:22 +00:00
Ashod Nakashian
d7799d21a8 loolwsd: cleanup of LoolKit process counter
Change-Id: I7d8bec2634b1c838cd10a8bef928ea22c2d2f549
Reviewed-on: https://gerrit.libreoffice.org/29643
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-10 06:26:59 +00:00
Ashod Nakashian
48733fdfb1 loolwsd: unittest cleanup
Change-Id: Ia7c5f54f6737e2d8a7fc7062b5bc27ea8291bb0a
Reviewed-on: https://gerrit.libreoffice.org/29642
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-10 06:26:27 +00:00
Ashod Nakashian
a86bd6a8be loolwsd: unittest cleanup
Change-Id: I0d0bba86904ffe3f6b6c2d13de135ef957f75333
Reviewed-on: https://gerrit.libreoffice.org/29641
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-10 06:25:49 +00:00
Ashod Nakashian
0f4ccd8429 loolwsd: remove unnecessary unittest helpers
Change-Id: I85962c2c96c99a8132aa015670521dd5f6166097
Reviewed-on: https://gerrit.libreoffice.org/29640
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-10 06:25:18 +00:00
Ashod Nakashian
78356dabf4 loolwsd: unittest cleanup
Change-Id: I02e44eae87e81bda883dec66d133675ad2973203
Reviewed-on: https://gerrit.libreoffice.org/29639
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-10 06:24:51 +00:00
Ashod Nakashian
73632d43fd loolwsd: unittest cleanup
Change-Id: Ie3bf745414fee4deb067b482ae463d6c4e08b01e
Reviewed-on: https://gerrit.libreoffice.org/29638
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-10 06:24:30 +00:00
Ashod Nakashian
f7327115de loolwsd: allow for delimiter in LOOLProtocol parsers
Change-Id: I9c7e503aed067dfe36953552237941e7c1841457
Reviewed-on: https://gerrit.libreoffice.org/29633
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-10 06:18:18 +00:00
Ashod Nakashian
0ec7b0e889 loolwsd: unittest cleanup
Change-Id: Id1816656bda88086779fad73b7e18fecf8892e41
Reviewed-on: https://gerrit.libreoffice.org/29631
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-10 06:16:17 +00:00
Ashod Nakashian
3f690113fb loolwsd: unittest invalidatetiles for Writer
Writer really has a single part for rendering
purposes, 0. This new unittest validates that
if we edit a page that isn't the first, part
in invalidatetiles will still be 0, and not
the page number of something else.

Change-Id: Idb5d14c2365cc0f73b76ee47223815ddf611f8ce
Reviewed-on: https://gerrit.libreoffice.org/29607
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-08 04:43:36 +00:00
Ashod Nakashian
a18c404f29 loolwsd: log test name from more helpers
Change-Id: I51240cf6dc3d2df3ed4b73f8a00dff968653de98
Reviewed-on: https://gerrit.libreoffice.org/29606
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-08 04:42:37 +00:00
Henry Castro
9b1087e000 loolwsd: test: .uno:AutoSum 2016-10-06 14:22:18 -04:00
Tor Lillqvist
d7cabad884 We don't care that much about the distinction of TEXT vs BINARY frames
We shouldn't assert such details.

protocol.txt says:

    The WebSocket distinction between 'text' and 'binary' frames has
    no meaning for us for messages that don't contain additional
    binary data; such messages can be either 'binary' or 'text' from
    the WebSocket point of view even if we require them (the single
    line) to be UTF-8. In other words, an implementation is free to
    send such a single-line message as a WebSocket 'binary' frame, and
    the receiving implementation must treat that equally as if it was
    a 'text' frame.
2016-10-06 11:32:22 +03:00
Tor Lillqvist
7a3111632b Prefer string literals to pointless variables 2016-10-06 11:29:52 +03:00
Ashod Nakashian
c9349886c2 loolwsd: unittest cleanup
Change-Id: Ie5eca4a3d656b308932ead005788845d5ddf81fb
Reviewed-on: https://gerrit.libreoffice.org/29548
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-06 05:57:48 +00:00
Ashod Nakashian
d681d9b8d4 loolwsd: testGraphicInvalidate cleanup
Change-Id: I933aceb2873d393a93b942ccb13ab544aca4db9d
Reviewed-on: https://gerrit.libreoffice.org/29547
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-06 05:57:02 +00:00
Ashod Nakashian
ae2c5ba92b loolwsd: unittest cleanup
Change-Id: I4d7ff79a0d1c0993dfaf36d02df9adc46901a02c
Reviewed-on: https://gerrit.libreoffice.org/29546
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-06 05:56:30 +00:00
Ashod Nakashian
c542fde244 loolwsd: factor out getViewIds and broadcasting
This minimizes unlocking and relocking
on the LOK Document.

Change-Id: Ibe5045c82008df907dc329c1530cb50138b0c211
Reviewed-on: https://gerrit.libreoffice.org/29545
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-06 05:54:54 +00:00
Michael Meeks
e04cde4107 Avoid the returnValue hook - when not needed. 2016-10-05 23:24:23 +01:00
Michael Meeks
8a8323d0a0 More UnitPrefork cleanup.
Log data to std::cerr - so it goes to the log files.
Dump PSS / Dirty per child process for comparison.
Copy the child socket array before operating on it to fix a crash.
Add debug to ensure we are getting each child's true size.
2016-10-05 23:17:33 +01:00
Michael Meeks
d3daa2d9d9 Mend UnitPrefork.
Count pre-forked processes more correctly.
Use Unit's returnValue implementation to fix failure exit codes.
Accept new loolwsd.log socket as being authentic.
2016-10-05 22:38:07 +01:00
Pranav Kant
198b41676f loolwsd: new viewinfo message test
Change-Id: Icf9c74006bf6ee15864a266fef5aa49003ca1a70
2016-10-05 18:48:53 +05:30
Jan Holesovsky
a1e9c1eb42 Handle the Impress slide previews with low priority + unit test.
After processing a tile request for a slide preview, move the rest of them to
the end of the queue, so that other events are processed before we render the
next preview.

Change-Id: I82aa411406d6731b1c0bf3b849780220b5e68110
2016-10-04 14:25:52 +02:00
Tor Lillqvist
7a2a1b1b99 Add another FIXME rant 2016-10-04 11:04:36 +03:00
Tor Lillqvist
dba94a9c03 Avoid annoying line wrapping of cppunit output 2016-10-04 11:04:22 +03:00
Tor Lillqvist
f9a6ed93d5 Add FIXME rant 2016-10-04 09:21:20 +03:00
Ashod Nakashian
dba4d84010 loolwsd: new per-part tile invalidation unittest
Change-Id: I70c1b3d339bdd6dc017b3e09132e32ea0a2133ec
Reviewed-on: https://gerrit.libreoffice.org/29469
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-03 05:34:26 +00:00
Ashod Nakashian
23f7560bf1 loolwsd: fix and enable tile invalidation test for Calc
Change-Id: I105857026507ff3dedd798f66bcebcc111e6c072
Reviewed-on: https://gerrit.libreoffice.org/29468
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-10-03 05:33:45 +00:00
Andras Timar
e1e703c727 loolwsd: do not install 'unittest' binary
(cherry picked from commit 60834bfcec39755eebe73fe6a2d272e3a5ae59aa)
2016-10-02 19:01:28 +02:00
Henry Castro
2a6a5eab2e loolwsd: error message is localizable 2016-10-01 11:35:19 -04:00
Jan Holesovsky
f101b2b7cb Check we get views prioritized according to when the cursor was updated.
Fails with any of e5adf272b8,
d9c90e30fd or
4e7ba53a2b reverted.

Change-Id: I5a9384f20ae1f64e29509ec568670e29c3c4eb94
2016-09-30 22:22:23 +02:00
Miklos Vajna
d0abdee6d5 Move HTTPWSTest::testEmptyCellCursor() to WhiteBoxTests
Which is a unit test, so should be faster.

Change-Id: Id5c2ed705576a1467756ac8dba6e5e434b56f725
2016-09-30 15:52:08 +02:00