Commit graph

279 commits

Author SHA1 Message Date
Pranav Kant
e6e9236a6a unit-admin: Enable a test
testRmDocNotify was disabled earlier as it seemed to fail
intermittently. Hopefully, refactoring in
78876b011d2c3da972ef456a6da2cac08cb0d7d6 and
4360d31c9e8a3a099d869a9dfd0e2db8a0c03a52 should fix this one too.

Change-Id: I542ca27fab7eb4dfa8ed4a55a7f2eada63e7b96c
2016-07-18 12:03:27 +05:30
Pranav Kant
732c54313d loolwsd: Get rid of superfluous long list of fonts in test output
They make it difficult and annoying to analyze the test logs.

Change-Id: If970ab8296206e7462fe205a9b40cdf26a1eb37f
2016-07-14 10:59:36 +05:30
Pranav Kant
0f506fcbb0 Some more admin test cleaning
Change-Id: I3cea5b6fefcb7b4e6209c63e6b3e232b9db50a7b
2016-07-14 01:08:46 +05:30
Pranav Kant
4530bfdb0a loolwsd: Fix Admin unit test
Admin notify messages are emitted when websocket connection is
established, not when 'load' message is sent.

And, some minor cleaning.

Change-Id: If52a77c10c3af64dcca8d6c10868b3d46f48c774
2016-07-14 01:08:39 +05:30
Miklos Vajna
990108d243 test: make check insist on a log file for skipped tests 2016-07-11 09:22:47 +02:00
Miklos Vajna
9304c4152d HTTPWSTest: disable failing test on LO >= 5.2 for now 2016-07-11 09:22:47 +02:00
Henry Castro
adf4369237 loolwsd: test: state changed UNO commands 2016-07-10 14:28:28 -04:00
Miklos Vajna
3df68f3869 loolwsd: support CPPUNIT_TEST_NAME, similarly to core.git 2016-07-08 09:04:28 +02:00
Ashod Nakashian
64741ebb87 loolwsd: dump calc tile for debugging purposes
Change-Id: Ie2d92026fb77a4f94d6434ec25fc10695118971e
Reviewed-on: https://gerrit.libreoffice.org/27022
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-07-07 20:27:34 +00:00
Ashod Nakashian
2c4efeb5f3 loolwsd: fix PreFork test
We could have up to 3 pipes and we should tollerate them
when testing for leaking FDs and pipes.

The 3rd is probably a file redirection.

Change-Id: I913072307646e62e1802587c9142b2eb8c9dd7bb
Reviewed-on: https://gerrit.libreoffice.org/27021
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-07-07 20:27:18 +00:00
Ashod Nakashian
bb9168096d loolwsd: test fixes
Change-Id: I927bab6c88c72247a7bf6fb73ae56e1ebc51cdbd
Reviewed-on: https://gerrit.libreoffice.org/26993
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-07-07 03:50:16 +00:00
Ashod Nakashian
42f857efe0 loolwsd: cleanup of testTileInvalidateCalc
Change-Id: Ic15d12f0b203244b3de1b80e97866f134efd82f7
Reviewed-on: https://gerrit.libreoffice.org/26992
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-07-07 03:49:31 +00:00
Ashod Nakashian
0eba4a17f8 loolwsd: remove unnecessary wait for invalidatetiles in tests
Change-Id: Ica79b995ef14fbf7d57e9ef435c87a84d854d5b8
Reviewed-on: https://gerrit.libreoffice.org/26991
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-07-07 03:49:07 +00:00
Ashod Nakashian
370c21f4b5 loolwsd: fix testTileInvalidateWriter
Change-Id: I701c348cbfe55f850bb2180b400020d1b1b01f31
Reviewed-on: https://gerrit.libreoffice.org/26989
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-07-07 03:35:43 +00:00
Ashod Nakashian
e8cd9e35d3 bccu#1909 - loolwsd command line options vs. config file and package upgrades
Unit tests updated with new command-line arguments.

Change-Id: I1a391255c44d4d22b8304129634ef7d16b606bce
Reviewed-on: https://gerrit.libreoffice.org/26683
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-06-26 20:45:12 +00:00
Mike Kaganski
47a17fa8d0 testCloseAfterClose: don't hang on bytes==0 && flags==0
At least in some versions of Poco (namely, 1.7.3),
WebSocketImpl::receiveBytes may return both bytes and flags equal
to zero. It makes the HTTPWSTest::testCloseAfterClose() loop
exit condition to never happen, thus test hangs.

According to WebSoket.h, "A return value of 0 means that the peer
has shut down or closed the connection".
Thus, this modification makes this loop robust.

Change-Id: I5dd4f30936dd8246c966f094f2fdae9a45b89ff9
Reviewed-on: https://gerrit.libreoffice.org/26547
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-06-21 23:07:35 +00:00
Ashod Nakashian
d1d9ec6168 loolwsd: max_concurrency setting added
Change-Id: Iae3789d26ed2e1aba3806a6f99511fa6c7097988
Reviewed-on: https://gerrit.libreoffice.org/26449
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-06-17 23:59:47 +00:00
Ashod Nakashian
bf66f7a908 loolwsd: Calc tile rendering test with editing
Change-Id: Ib02a079bf1e4e90c7dfb65b6038b3ca1423a673c
Reviewed-on: https://gerrit.libreoffice.org/26448
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-06-17 23:56:26 +00:00
Miklos Vajna
75db2dd33b loolwsd: disable unit-fonts for now as it's unstable 2016-06-16 13:45:20 +02:00
Miklos Vajna
3c32bc1724 LOOLKit: fix loss of callback during initializeForRendering()
Impress deletes the current view and creates a new one during that call,
so make sure at the end our registered callback is not lost. With this,
the order matches how it's done in gtktiledviewer.

This fixes the HTTPWSTest::testInsertDelete() test when per-view
callbacks are enabled.

Also remove the assert from TileCacheTests::testTileInvalidateWriter()
that would assume something is invalidated right after load: the hope is
that it's possible to load a document without invalidating anything...
:-)
2016-06-16 12:15:11 +02:00
Miklos Vajna
70f5b914f6 TileCacheTests: assert before possible nullptr deref / div by zero 2016-06-15 18:04:57 +02:00
Miklos Vajna
9ac53ef5f5 TileCacheTests: disable testTileInvalidateCalc for now
It fails for me and Ashod as well.
2016-06-15 15:30:37 +02:00
Mike Kaganski
9ef285cc33 loolwsd unit test: invalidate tiles while typing
This test simulates characters and combined characters being
typed to loolwsd, and verifies that each causes tile(s)
invaliations

Change-Id: I670659de3a9eb71e94c366c96e69e6efd4338c38
Reviewed-on: https://gerrit.libreoffice.org/24928
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-06-14 22:20:36 +00:00
Pranav Kant
257b95f01f bccu#1871: Add url prefix, lool, to post requests
All post requests will now have to be prefixed with /lool/

This is necessary to ease proxy url redirection setup.

Change-Id: I04fbc211879722f6433cb9eb17786f394187a1b9
Reviewed-on: https://gerrit.libreoffice.org/26091
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2016-06-09 11:22:05 +00:00
Pranav Kant
8cc367638f bccu#1871: Add url prefix to websocket urls
Normal websocket connections are now :
/lool/ws/filename

Admin websocket is now :
/lool/adminws/

Change-Id: If39382cb852d89ed0394adbd7fe168fe4767a075
Reviewed-on: https://gerrit.libreoffice.org/26029
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2016-06-08 14:06:20 +00:00
Miklos Vajna
f209773f0a loolwsd: fix naming style of static members
README suggests not using an initial underscore for those. Rename the
few cases which don't respect this recommendation.

Change-Id: If36a36da9374597f6b9090e7f81a1b3fb2f23647
2016-06-07 09:18:49 +02:00
Ashod Nakashian
3b6009fa56 loolwsd: fixed testLoad12ods
Change-Id: Iec0bb481da7af71b210463613617a7272209bfb3
Reviewed-on: https://gerrit.libreoffice.org/25947
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-06-06 01:55:18 +00:00
Pranav Kant
3042580873 loolwsd: Increase timeout for admin test
... to 60 seconds. This one contains a lot of sub-tests. Further,
loolwsd shutdown is consuming approx. 15 seconds out of this
limit. The default 30 seconds, hence, is not enough for this one.

Change-Id: I0c29c92f6be0140cb62b58dacb57392e264d7f30
2016-06-01 21:58:07 +05:30
Pranav Kant
4c053e864f loolwsd: unit-admin: More debug info
Change-Id: I0a529915ab9383ce05a76b8291651663324c8fe8
2016-06-01 14:57:35 +05:30
Pranav Kant
b58801c6b0 loolwsd: unit-admin, log when test passes
Change-Id: I9714a8dc57b22ecff3ef4a421192d08a8f3f10e1
2016-06-01 14:57:35 +05:30
Henry Castro
58580a45ce loolwsd: test: update unit test getPartHashCodes 2016-05-30 20:26:40 -04:00
Henry Castro
39fe4e5580 loolwsd: test: add testFontList 2016-05-25 19:57:35 -04:00
Ashod Nakashian
dd4d2b026b loolwsd: test comment editing in Writer
Change-Id: I8449556960dedc2c66547016172acce688098cb3
(cherry picked from commit e96140b745283c0ae5e466001e0cf89cf945a398)
Reviewed-on: https://gerrit.libreoffice.org/25391
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-24 03:31:50 +00:00
Ashod Nakashian
d2ff39d296 loolwsd: test InsertAnnotation in Writer and Calc
Change-Id: I0f1b30467c3877316dc7c3122f04f3055b28cdd2
Reviewed-on: https://gerrit.libreoffice.org/25390
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-24 03:31:23 +00:00
Miklos Vajna
ffc8e591ee UnitPrefork: fix -Werror,-Winconsistent-missing-override
Change-Id: I16780cb0a15b662f735ee5ea17a4991e4bf460de
2016-05-23 09:07:52 +02:00
Ashod Nakashian
dcfa259b4e loolwsd: formatting
Change-Id: Id71a073c026ddea484fcb7da7d674109f3778c7c
Reviewed-on: https://gerrit.libreoffice.org/25346
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-23 01:57:56 +00:00
Ashod Nakashian
157386e3bc loolwsd: process tiles under the cursor with priority
Change-Id: I7993ee049c5c0835cae588ff54163f135c4f8b02
Reviewed-on: https://gerrit.libreoffice.org/25345
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-23 01:57:16 +00:00
Ashod Nakashian
6e54fd05f9 loolwsd: merge saveTile and notifyAndRemoveSubscribers
Change-Id: I8282604c02a9fd1a7a1e2a5df29e2f84fca151a6
Reviewed-on: https://gerrit.libreoffice.org/25344
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-23 01:54:55 +00:00
Ashod Nakashian
ecaf45f9d3 loolwsd: tests should request tiles after invalidatetile
Change-Id: I32637d7e34a80577e99b764705bddf104df0278a
Reviewed-on: https://gerrit.libreoffice.org/25342
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-23 01:53:00 +00:00
Ashod Nakashian
65ed424199 loolwsd: new tile performance test
Change-Id: I08d477ec5f04de9f82c49263f35ebbf38a968f31
Reviewed-on: https://gerrit.libreoffice.org/25335
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-23 01:44:36 +00:00
Ashod Nakashian
5d9140c3bb loolwsd: simplify checkBlackTiles test
Black tiles are returned when rendering fails.
This happened due to bccu#1610 where internally
core collected cell info on the first 1024 rows
only. Anything beyond that always failed.

This limitation is now removed using dynamic
array to collect the cell info.

Regardless, the test here needs only check that
the last tile (really, anything beyond the 1024th row)
doesn't return a black tile.

This single tile still takes over 10 seconds to render,
which is the other issue that Core suffers from when
collecting cell info on a huge tab.

Change-Id: I7a1a5b7c2b2ed2cc4399160e096be5e57895af77
Reviewed-on: https://gerrit.libreoffice.org/25333
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-23 01:39:20 +00:00
Henry Castro
22db071689 loolwsd: test: add checkBlackTiles 2016-05-22 19:53:24 -04:00
Henry Castro
166edb66eb loolwsd: test: move getDocSize to helpers 2016-05-22 18:52:36 -04:00
Ashod Nakashian
44a0e5785e loolwsd: cout -> cerr
Change-Id: I80ee313621ce093d75f2c331f3fef6125a187a42
Reviewed-on: https://gerrit.libreoffice.org/25263
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-21 15:53:11 +00:00
Ashod Nakashian
fae850189d loolwsd: include cleanup and organization
A source file (.cpp) must include its own header first.
This insures that the header is self-contained and
doesn't depend on arbitrary (and accidental) includes
before it to compile.

Furthermore, system headers should go next, followed by
C then C++ headers, then libraries (Poco, etc) and, finally,
project headers come last.

This makes sure that headers and included in the same dependency
order to avoid side-effects. For example, Poco should never rely on
anything from our project in the same way that a C header should
never rely on anything in C++, Poco, or project headers.

Also, includes ought to be sorted where possible, to improve
readability and avoid accidental duplicates (of which there
were a few).

Change-Id: I62cc1343e4a091d69195e37ed659dba20cfcb1ef
Reviewed-on: https://gerrit.libreoffice.org/25262
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-21 15:52:54 +00:00
Ashod Nakashian
9347adc66f loolwsd: UnitPrefork can't use the more recent child
Change-Id: I6f60761498e61d9ceb48bc5f9a41967152293590
Reviewed-on: https://gerrit.libreoffice.org/25246
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-21 03:47:39 +00:00
Ashod Nakashian
5a0162f95c loolwsd: cleanup and improvements to UnitPrefork
Change-Id: I15394fa9199f0d2489a184d4c07602da02cbab64
Reviewed-on: https://gerrit.libreoffice.org/25245
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-21 03:43:45 +00:00
Ashod Nakashian
958f6ffcbd loolwsd: fix UnitPrefork deadlock/corruption
Reading from the socket in the test is not
thread-safe, and was causing all sorts of
problems.

The new code adds a test API and reads the
incoming data through it and not directly
from the socket. In addition, the read is
synchronized.

Change-Id: Id13821a40a59e32fd8a14f733a47306aee42ada8
Reviewed-on: https://gerrit.libreoffice.org/25244
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-21 03:43:15 +00:00
Ashod Nakashian
d18bca992c loolwsd: use TileDesc instead of explicit values
Change-Id: I56ba6c4e63a495500093e7353477175d40152d11
Reviewed-on: https://gerrit.libreoffice.org/25020
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-15 23:00:43 +00:00
Ashod Nakashian
cfe414cc8a loolwsd: simplified duplicate code with utility
Change-Id: I2b9d88a78e73065d65b1722d363e8492f80438c9
Reviewed-on: https://gerrit.libreoffice.org/25017
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-15 22:54:51 +00:00