Commit graph

2551 commits

Author SHA1 Message Date
Ashod Nakashian
e2cf1a5b52 loolwsd: always send status before other messages
Except for loading progress messages (statusindicator).

Change-Id: I42f79167c3ff953fc4e283854468cd7e8bd54bc3
Reviewed-on: https://gerrit.libreoffice.org/24474
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-29 01:08:08 +00:00
Ashod Nakashian
f44660aa99 loolwsd: unittest cleanups
Change-Id: Ib9b915c7ca2df03afba7f4e1fb37b8fff846a474
Reviewed-on: https://gerrit.libreoffice.org/24473
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-29 01:07:30 +00:00
Ashod Nakashian
2efaa6e06b loolwsd: save documents when timestamp is within 10 seconds
Due to filesystem timestamp precision and other factors
we assume a timestamp match within 10 seconds to mean
the document has been recently saved and store it.

A document has to have an older than 10 seconds
modified timestamp compared to our last timestamp
to be deemed unchanged in the interim and skipped
from storing again.

Change-Id: I39b4bf64b221ba30dc7b818a330e779a2d0ecbd4
Reviewed-on: https://gerrit.libreoffice.org/24472
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-29 01:06:57 +00:00
Ashod Nakashian
1dd88e68ea loolwsd: shortened some long identifiers
Change-Id: I87809f5ad2a6d8f546cf3abaf646672d2d8168dc
Reviewed-on: https://gerrit.libreoffice.org/24471
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-29 01:05:45 +00:00
Ashod Nakashian
7ff5be1f70 loolwsd: document rendering options should be set once
When loading a document first we set the rendering
options. Beyond that, the document is shared and
we shouldn't change the rendering options.

Change-Id: I0d2ac6fc43553b8395111ba2b8a3cc2796d2f0a4
Reviewed-on: https://gerrit.libreoffice.org/24470
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-29 01:04:43 +00:00
Ashod Nakashian
466ffc25db Use [] around messages as they are more readable than ''
Change-Id: Id172bb03e8fa9dd148612d756d4a74fc501ea95c
Reviewed-on: https://gerrit.libreoffice.org/24469
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-28 22:20:40 +00:00
Ashod Nakashian
cf54d0d87e loolwsd: test helpers and more code sharing
Change-Id: I87e4ad23f9c2761a7a2acab4139b458696e07e64
Reviewed-on: https://gerrit.libreoffice.org/24468
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-28 22:20:10 +00:00
Henry Castro
49e6eb287b loolwsd: test: fix wrong file name 2016-04-28 14:01:28 -04:00
Jan Holesovsky
407b41afb9 Decrease verbosity of this the http server test.
And also check that we've had a hit in loleaflet.html.
2016-04-28 18:35:22 +02:00
Jan Holesovsky
28b7aee356 No need for a standalone httptestutils.hpp any more. 2016-04-28 18:17:37 +02:00
Jan Holesovsky
8e266391f1 Merge the http get and post tests into one file, and reduce copy/paste. 2016-04-28 18:08:07 +02:00
Jan Holesovsky
f283b045a9 The http tests are actually integration tests, not unit tests. 2016-04-28 17:45:18 +02:00
Andras Timar
c00f3535fa silence po2json.py 2016-04-28 14:48:49 +02:00
Pranav Kant
3a42330b05 bccu#1755: Fix 'Cancel' button on password dialog
Change-Id: Icbfd129fa839ac7af868cc2d857fc280ae1ff681
2016-04-28 17:56:02 +05:30
Jan Holesovsky
7d2aaa8910 Log the exact test file that has been used. 2016-04-28 12:35:56 +02:00
Miklos Vajna
30d90d6b96 loolwsd: using range-based loops is more readable here
Change-Id: I9533c74dbcd6622a01b21096109edc3b27e797e3
2016-04-28 08:44:01 +02:00
Tor Lillqvist
2dde26c2ff Add rant 2016-04-28 09:28:54 +03:00
Henry Castro
6378016586 loolwsd: test: add testClientPartCalc 2016-04-27 16:48:30 -04:00
Andras Timar
2993db466c add all private IPv4 address ranges as allowed (for docker, for example) 2016-04-27 22:25:06 +02:00
Henry Castro
6c50fa323e loleaflet: progress bar: use socket state 2016-04-27 15:14:11 -04:00
Henry Castro
daa3d69f9e loolwsd: test: update 2016-04-27 14:30:19 -04:00
Henry Castro
c3e7d9b6ba loleaflet: do not use setclientpart when received "status:" 2016-04-27 13:58:20 -04:00
Henry Castro
33eff1fe31 loolwsd: test: add testClientPartImpress 2016-04-27 13:51:23 -04:00
Henry Castro
200c6a9281 loolwsd: rework setclientpart 2016-04-27 13:47:58 -04:00
Miklos Vajna
78308db763 loolwsd: remaining 'unnecessary copy' fixes
Change-Id: I138e8473a002a15aae7752136950bb905a21fb1f
2016-04-27 14:58:33 +02:00
Andras Timar
c11b4a2823 rpm spec file fixes (openSUSE dependencies, add 'lool' user in %pre) 2016-04-27 14:32:37 +02:00
Tor Lillqvist
ee7f8c158a Actually we want to check only for it starting with the expected string
As this assert fails at the moment (it did even before my previous
commit), I can't be 100% sure it is correct now. So sue me. Or revert
both my changes.
2016-04-27 14:19:01 +03:00
Tor Lillqvist
8480cad8ee Use CPPUNIT_ASSERT_EQUAL
It is useful to see the expected and actual values when the assertion
fails.
2016-04-27 14:08:34 +03:00
Pranav Kant
cc0814df04 loleaflet: Prevent intermixing of multiple timeouts
Clear a timeout before setting it.

Change-Id: Ic808962b880a4c18b24e2f603dc1d351d65419ed
2016-04-27 14:02:37 +05:30
Pranav Kant
f26900399d bccu#1745: Fix Calc blinking due to popup message
Use w2overlay instead of w2popup. The former adjusts itself in
the visible screen region and fixes, and does not introduce any
additional scrollbars for the lifetime of the popup message.

The w2overlay gets removed with mouse events. So instead of
'mousedown' events originally, use 'mouseup', so that there is no
succeeding mouse events to switch the overlay off.

Also point the overlay pointer towards the button, not the label.

Change-Id: Ic6c22fecc2e32075c27b6f4647373c28d2f635ae
2016-04-27 13:50:39 +05:30
Pranav Kant
2913691ed2 bccu#1747: Show tab div only for spreadsheets
Change-Id: I95fcb12d35c94f8640859cfb75c90d81ad21e1af
2016-04-27 12:36:31 +05:30
Tor Lillqvist
2743ce5f7c Revert "I don't think we want the hello-world.odt to be modified without noticing"
Ah, I was confused.

This reverts commit f6d0730379.
2016-04-27 09:53:31 +03:00
Tor Lillqvist
0d198eb0ec The loadtest program went away a while ago already 2016-04-27 09:51:31 +03:00
Tor Lillqvist
f6d0730379 I don't think we want the hello-world.odt to be modified without noticing 2016-04-27 09:51:04 +03:00
Pranav Kant
0e3e5e023e loleaflet: Fix AltGr on Windows
On Windows, AltGr events are treated as Alt + Ctrl. Use the
'location' property to distinguish from plain Alt + Ctrl.
It is not present in 'keypress' event, so use
the previous invocation of Alt + Ctrl to detect whether AltGr was
used or not.

Change-Id: Id6b64b6fc0a5300ea5362880536d3b926eb0acce
Reviewed-on: https://gerrit.libreoffice.org/24400
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Reviewed-by: pranavk <pranavk@collabora.com>
2016-04-27 05:47:53 +00:00
Ashod Nakashian
ffc873895d loolwsd: logs
Change-Id: Ic7632824c32d66eaf7d496e0824a57ebbef986f5
Reviewed-on: https://gerrit.libreoffice.org/24421
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-27 03:50:56 +00:00
Ashod Nakashian
e6a6b296ea loolwsd: avoid communicating with clients under shared lock
DocumentBroker is a central document management object.
Using it to communicate with clients leaves it open
to the whims of slow connections. When its lock
is help for a long time, all clients stall, giving
users a very poor experience.

The culprit in this case was takeEditLock, which
sent to all clients the new edit lock state.
To avoid this, DocumentBroker now sends this
state to the children (via a loopback socket,)
which process messages in a separate process and
each on its own queue thread. The children then
in turn echo this edit lock state back to the
clients. This communication back is done on the
prisoner socket thread, which doesn't lock or
stall any shared objects or threads.

Change-Id: I475f6b3ecac9ae2a689bd30f43d416871aa0e384
Reviewed-on: https://gerrit.libreoffice.org/24420
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-27 03:50:22 +00:00
Pranav Kant
80c48ff579 loleaflet: Fix an obvious typo
Change-Id: Id31d44539f78d8747595340c9bf231bbee262231
2016-04-26 19:59:35 +05:30
Ashod Nakashian
5cfc7b6580 loolwsd: logging and cosmetics
Change-Id: Idb2cdc22555d237a162b58cacbfd1986f8bc7656
Reviewed-on: https://gerrit.libreoffice.org/24383
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-26 10:41:41 +00:00
Ashod Nakashian
d07a582469 loolwsd: merged autoSave and waitSave
This makes for amore compact API and avoids
a race between issuing the save and waiting for it.

Also added force flag and autoSave now checks the
modified state of the document. If a document is
not modified, nor save forced, autoSave checks
the last activity on the document and only
if there is any since last save does it issue
a save command.

Change-Id: I962e36df18d7edf5f658992e97b5def5f6247dc3
Reviewed-on: https://gerrit.libreoffice.org/24382
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-26 10:40:35 +00:00
Ashod Nakashian
d4aa547d3c loolwsd: avoid persisting excessively
When multiple users have a document open,
save notficiations are broadcast to all.
Each session then tries to store the document
to the Storage when only the first should suffice.

A new file modified-time member tracks the file's
timestamp and only persists when it changes,
thereby avoid excessive stores.

Change-Id: I138f1aa812963a2120a1fcac763dfacccc542c1a
Reviewed-on: https://gerrit.libreoffice.org/24381
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-26 10:40:07 +00:00
Jan Holesovsky
f5abfcde68 Improve test to be able to see the message directly.
The test was unreliable, but any change there made it reliable, so not sure
yet what was the root cause - but at least this should help seeing the
brokeness once it appears again.
2016-04-26 11:54:20 +02:00
Jan Holesovsky
2f561802b3 The branding files do not have to be present, skip them.
Clean up tons of copy'n'paste when at that...
2016-04-26 11:32:01 +02:00
Andras Timar
5dec73b182 fix more package names on SUSE 2016-04-26 10:16:19 +02:00
Andras Timar
97453617e8 fix libatk package name 2016-04-26 10:01:08 +02:00
Miklos Vajna
25fa9653b8 Storage: avoid unnecessary copy-construct
Change-Id: I592adb26590f8957e01ed55a4ba9a976a3aac246
2016-04-26 09:35:01 +02:00
Tor Lillqvist
42dcd6ea99 Why log a string that we even expect to be junk?
WebSocket::receiveFrame() does not null-terminate the buffer even when
it successfully reads something into it, even less when it
doesn't. (Why would it, as it is perferctly fine to transmit WebSocket
(binary) frames that contain zero bytes.) So the 'received' string was
always full of random bytes.
2016-04-26 08:20:59 +03:00
Henry Castro
47917fb8c9 loolwsd: test: add testLinks 2016-04-25 21:40:24 -04:00
Henry Castro
7317345a2b loolwsd: test: add testScripts 2016-04-25 21:01:46 -04:00
Henry Castro
8ea127407b loolwsd: test: replace std::regex 2016-04-25 18:07:55 -04:00