Commit graph

408 commits

Author SHA1 Message Date
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
Miklos Vajna
38577b74fd Refactor to be able to unit-test Document::ViewCallback()
Change-Id: If07eb89e5d2f45737a8af10803511ab2ee3a07b3
2016-09-30 15:42:50 +02:00
Tor Lillqvist
3cabf7c9c1 testCalcEditRendering is not working so bypass it for now 2016-09-30 14:06:13 +03:00
Jan Holesovsky
bf80260a28 Let the make fail when the unittest fails.
Change-Id: I66a7e82b864f1c13c1c145c27f019b832c38bb62
2016-09-30 10:53:22 +02:00
Jan Holesovsky
0b5fa973da Run unit tests (that don't require loolwsd) during the build time.
Change-Id: I2b1ea4fb5e6dcd8e4eb5f3890507f541c1457b39
2016-09-30 10:43:51 +02:00
Miklos Vajna
8c2446d15b Revert "httpwstest: add tolerance, so that testCursorPosition actually passes"
This reverts commit 3629113e59. This
workaround is no longer needed, now that core.git
b32b6c09d190effbe29389a87a80df36007d2e99 (sw lok: disable pixel
alignment of cursor logic values, 2016-09-29) fixed the root cause.

Change-Id: I208e18517158cf55b143d1018ad0fd933db3accf
2016-09-30 10:20:57 +02:00
Henry Castro
6f7d67a204 loolwsd: control frames must have a payload of 125 bytes 2016-09-29 17:36:43 -04:00
Pranav Kant
d5f8c5b2e6 Change main websocket url for consistency with other urls
From
/lool/ws/docurl
to
/lool/docurl/ws

The main purpose behind changing this and other related urls is
to help in load-balancing. The first two parts of the URL can now
be used in a hash-based load-balancing algorithm which decides which
slave gets to serve the requests. Requests such as insertfile,
downloadas need to end up in the same slave in which document was opened.
/lool/docurl/ i.e first two parts of the URL are constant for all
the requests that should be served by a single slave.

Change-Id: Ibc605ca1251957b8b32b376cf19b78f6178fadfa
2016-09-30 00:50:57 +05:30
Pranav Kant
8330341a8a Include docurl in document download requests
From
/lool/jailid/randomdir/filename
to
/lool/docurl/jailid/randomdir/filename

Change-Id: I4d58e733768c62f2951ecfdcfcb604d99772862d
2016-09-30 00:33:58 +05:30
Jan Holesovsky
c8a97eb300 Move testTileQueue from WhiteBoxTests to TileQueueTests.
Change-Id: Ib592c425d595e1d3449092bd0b9008c1b857274a
2016-09-29 20:32:25 +02:00
Jan Holesovsky
ae179b8bce Move the TileQueue tests that do not require loolwsd to a separate file.
Change-Id: Iaac51e891a5c34cebc95d7631c95c84ed8aad80e
2016-09-29 20:04:05 +02:00
Henry Castro
78b2fae7e9 loolwsd: test: update max connections 2016-09-28 18:16:09 -04:00
Tor Lillqvist
96e6ad7502 Re-think disk full handling
Instead of trying to inform the sysadmin (which we did not yet try to
do in any meaningful way), inform all connected clients (even those
editing other documents).

We use 'error: cmd=internal kind=diskfull' as the message to the
clients. The loleaflet code needs to be updated to handle that
carefully by displaying a very prominent message that tells the user
that all bets are off.

Also add a unit test for the functionality.

Document the new protocol details.

The code for this alert functionalty became a bit less elegant than I
like because of the way we include Util.cpp in the unit test 'test'
program.

Still need to add code to check for disk full in more places, not just
when saving a cached tile or font. Probably we should even actually
check for disk space on the file system(s) we use getting alarmingly
low, not just check for file writing operations that fail. Later.
2016-09-29 00:23:14 +03:00
Henry Castro
0729a38277 loolwsd: restore MAX_CONNECTIONS
Let's do another unit test with http request connections
2016-09-28 17:03:36 -04:00
Henry Castro
5e19aa635e loolwsd: test: connections and documents 2016-09-28 16:04:51 -04:00
Ashod Nakashian
0e03ac54e6 loolwsd: unittest fixes
Change-Id: I77f7b225c444ca0bc352de4b45b0ead4ad454714
Reviewed-on: https://gerrit.libreoffice.org/29361
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-28 13:28:31 +00:00