Commit graph

14111 commits

Author SHA1 Message Date
Ashod Nakashian
355850e7e7 wsd: test: improve Template test
Change-Id: I4b19580e9753133ba83ee64ce287ead3fe021ccb
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-01 21:50:18 -05:00
Ashod Nakashian
5371715a52 wsd: logging improvements
Change-Id: Ic887c42f0ca844e54bfc054e9c0706bbec7ebb6f
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-01 21:50:18 -05:00
Ashod Nakashian
21e99cf128 wsd: better errno handling in sockets
Change-Id: Id3a7744802cbf693a92e39ef4d99433951dfa923
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-01 21:50:18 -05:00
Ashod Nakashian
16185ff4fd wsd: cosmetics
Change-Id: I8ceb1a14f4d479dd7cae9a0a9a2f02990a7b4279
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-01 21:50:18 -05:00
Ashod Nakashian
feaed252bf wsd: retry flushing the WS buffered data when shutting down
Normally writeOutgoingData flushes all the available
write buffer to the socket. However, when an error
occures during the write, the flushing loop is
broken and the error is expected to be handled
in the poll loop (or, at any rate, the poll loop
will sooner or later retry).

This doesn't work when the socket is being shut
down. Details and stack-trace is added in the
code to document this scenario.

The proper fix to flushing before shutting
down is to do it asynchronously (i.e. flag for
shutdown, let poll flush the buffers, and then
close the socket), but currently this isn't
easily possible (again, details in the added
comment). For now, we do a second attempt to
write, before we give up and warn of lost data.

Worth noting that this was caught thanks to the
simulated socket error logic. Every so often the
Close Frame of the WebSocket was getting lost.
This frame is asserted in the 'crash test' and
the explanation is that it happened when the
simulated socket error happened to hit during
the writing of the Close Frame (as one statistic
this happened ~15% of the time, when running the
crash test in a loop). With the retrying in this
patch I was able to run the crash test successfully
a few 100 times without failures.

Finally, we unify the flushing with the mobile-app case
to minimize the differences as much as possible and
improved the logging a bit.

Change-Id: I0c0559d6095cd2af8250a7e65a972ba672ecd4b1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-01 21:49:26 -05:00
Ashod Nakashian
7a13fa0943 wsd: socket error simulation to maintain the ssl state
SSL signals whether it needs more data to read or write
so that we perform the appropriate polling and call
the respective API. Since during error simulation
we skip calling the SSL API altogether, we shouldn't
change the last desired operation it communicated to us.

This becomes clear when we consider that we always read,
unconditionally, in StreamSocket::handlePoll (but write
only when poll signals POLLOUT event). This means that
if we decide to simulate a socket error during such
uncoditional read, and SSL wants to write, we would
reset its last wantsTo flag from write to read!

Logically, since we aren't even invoking any SSL API
during a simulated error, we shouldn't change the
SSL state one way or the other.

Change-Id: Ie4ddbc959f8424ea4ac3bc52f30edbc7399b2c7a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-01 21:48:43 -05:00
Ashod Nakashian
3982c7b34f wsd: set errno when simulating socket errors for SSL
The API is the same for both SSL and non-SSL sockets
(they are virtual functions), and the API relies on
errno to detect errors and decide to retry, log, or
break. As such, we must set the same EAGAIN when
simulating socket errors for both SSL and non-SSL
cases, so that the behavior would also be the same.

Change-Id: Ib1695cc94d93f5ecc53d7b22872f459ac8b11bbd
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-01 21:48:43 -05:00
Szymon Kłos
e3a0c8b972 Add ids for shortcutsbar in draw
needed for show/hide functionality using postmessage

Change-Id: I9dc486c886ae7537963b339c7a4f08104a337e85
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
2021-03-01 13:28:06 +01:00
mert
5df4eb2d02 Fix exception when there is no handles on shape selection
Change-Id: I0725a239177413b3415ec329186c4ee33cf37519
Signed-off-by: mert <mert.tumer@collabora.com>
2021-03-01 13:58:14 +03:00
mert
e84e5addec Draw: Hide items that does not have functionality from notebookbar
Change-Id: I1914136d9a0f442463d1ab94eb2b2e32b1685c07
Signed-off-by: mert <mert.tumer@collabora.com>
2021-03-01 13:58:14 +03:00
mert
fe7252d108 Added ConnectorToolBox to Notebookbar
Change-Id: If00563eef7a5277b2ac82f61b402074c390b7186
Signed-off-by: mert <mert.tumer@collabora.com>
2021-03-01 13:58:14 +03:00
Szymon Kłos
d92d69335d Update unocommands.js
Change-Id: I2bceaafd2eb65dd6280f5e0e2390e4c697715b28
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
2021-03-01 13:58:14 +03:00
Szymon Kłos
a47773954f Update unocommands for Control.NotebookbarDraw.js
Change-Id: I575fc13e4db5860bdeca7093bbc64c85b15a63cb
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
2021-03-01 13:58:14 +03:00
Szymon Kłos
bf62ad5acb notebookbar: added for draw
Change-Id: I9caf00f1b02ebbf0820051d8e44721a8eb4549fd
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
2021-03-01 13:58:14 +03:00
mert
63839fec60 Show rectangle bounds while moving the shape
Change-Id: Ic9a305267ab64e87d503db688555feb01647114d
Signed-off-by: mert <mert.tumer@collabora.com>
2021-03-01 13:58:14 +03:00
mert
84ad87284a Fix handle positions are wrong in Calc
Change-Id: I7f520b02787aabef3e8c5ccbc275aa2bdcc6359c
Signed-off-by: mert <mert.tumer@collabora.com>
2021-03-01 13:58:14 +03:00
mert
71ba3d9cb6 Include map zoom to twiptolatlng function
Change-Id: Ia95726a77494e53b2e027b694252a2bda4c9cec2
Signed-off-by: mert <mert.tumer@collabora.com>
2021-03-01 13:58:14 +03:00
mert
8594118f4d Fix rotation handle position
Change-Id: I75b3c2ff343828d00d263edb236e0d90f3d51f7f
Signed-off-by: mert <mert.tumer@collabora.com>
2021-03-01 13:58:14 +03:00
mert
244aa7eacc Share scale/scaleend functions with Connectors
This will avoid code duplications.
Middle handle and flat line handles will use the same function

Change-Id: I6fc3509147e3908a39692488305f89c6f8527a1f
Signed-off-by: mert <mert.tumer@collabora.com>
2021-03-01 13:58:14 +03:00
mert
158907dd00 Implemented Line drag animations
Change-Id: Id677bb43547d6cb9da4870117272eabea67828a2
Signed-off-by: mert <mert.tumer@collabora.com>
2021-03-01 13:58:14 +03:00
mert
80ca12aeaf Implemented PolyHandle type
Change-Id: If4b50919bcaa8cce597dbaa2e80830b6601d92d0
Signed-off-by: mert <mert.tumer@collabora.com>
2021-03-01 13:58:14 +03:00
mert
6ad4e97aba Pass mousedown callback function to createHandler
This will make the function resuable.

Change-Id: Ic59f023fc87c6e962e1c52cb1e9eeff846bb89bd
Signed-off-by: mert <mert.tumer@collabora.com>
2021-03-01 13:58:14 +03:00
mert
8034f8e724 Implemented new CustomShapeHandle marker
Change-Id: I46f974bc234b053af8904ac5e07cbb7d72ef01fe
Signed-off-by: mert <mert.tumer@collabora.com>
2021-03-01 13:58:14 +03:00
mert
d3eeaac275 Adjust getPoints to new handle callback
Change-Id: Ifc65cfe01f88209ca9f0e50583c652744112fee7
Signed-off-by: mert <mert.tumer@collabora.com>
2021-03-01 13:58:14 +03:00
mert
7d66977d9f Hide rectangle borders to match with core
Change-Id: Ic594dcb8eaf656ecc8f559966de06c1fe8cadfaa
Signed-off-by: mert <mert.tumer@collabora.com>
2021-03-01 13:58:14 +03:00
mert
fa488e6e5e New MoveShapeHandle uuno command
Change-Id: I4b28616dd2e931cd1882d035e5846ab4a19c6cf6
Signed-off-by: mert <mert.tumer@collabora.com>
2021-03-01 13:58:14 +03:00
Tamás Zolnai
b14c3b3441 cypress: fix overlay tests with php-proxy.
php-proxy slows down things and make it visible, that
cellA1Bounds and cellC3Bounds can be initialized to the same
value. So let's wait fo the cell cursor to be updated before
we set the cellC3Bounds value. Changed the toString() function
to exactly match with the json in the overlay items' text attribute.

Signed-off-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Change-Id: Idde0f516ff568cb14b5d53224fd75ebc6167abe9
2021-03-01 11:28:04 +01:00
Tamás Zolnai
706206948c cypress: alias -> local variable change in moveCursor helper method.
Signed-off-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Change-Id: I3b52648ae9d9396d4cd3eb7dacfe9248fdbc2b52
2021-03-01 11:28:04 +01:00
Tamás Zolnai
953c21b995 cypress: alias -> local variable change in formula bar tests.
Signed-off-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Change-Id: I2ef937b29673e8f6f4c301989b464ca0a991267a
2021-03-01 11:28:04 +01:00
Tamás Zolnai
3486923e6b cypress: alias -> local variable change in form field tests.
Signed-off-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Change-Id: Ic8460a2db6648874f5a22998394666706b31da1b
2021-03-01 11:28:04 +01:00
Szymon Kłos
520fc2b9ee Fix loop index
Change-Id: Id3848a9a3be4a4617a11d778b87c115abd3504bc
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
2021-03-01 10:41:52 +01:00
Szymon Kłos
1964776ec8 notebookbar: Show/Hide/Remove _button support
Change-Id: I81f369c6aaf98af64912923196d3d681e424a7f5
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
2021-03-01 09:13:42 +01:00
Szymon Kłos
3bf19f0479 Move show button to UIManager
Change-Id: I1c8c45dabf4cf8611ee8a3e9c7f36611775891aa
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
2021-03-01 09:13:42 +01:00
Szymon Kłos
f671ed12bb notebookbar: Insert_Button support
Change-Id: I7323e3fd740680338c76d0b62a1f20fe752fa3b6
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
2021-03-01 09:13:42 +01:00
Szymon Kłos
5f69d463ea Move insert button to UIManager
Change-Id: I9873e59256f6a8986216c43f850fcdabf5a02c5d
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
2021-03-01 09:13:42 +01:00
Andras Timar
44ac9ef965 document Action_ChangeUIMode
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Id245350d17ff436ad231012065776a6bdddfa56a
2021-03-01 08:48:52 +01:00
Andras Timar
e2ed44b8ab Add Action_ChangeUIMode to PostMessage test harness
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I06c5e7fab8fff763e59f2a4fdf85c7f47dec51bb
2021-03-01 08:48:52 +01:00
Ashod Nakashian
561a9ce991 wsd: storage: upload to storage using http::Request
This converts Poco to http::Request in sync mode,
thereby not changing functionality. In a follow-up,
this will be converted to async.

Change-Id: Ifbecd44ff599394799c1131470d77f803ed8cc45
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-02-27 08:57:25 -05:00
Dennis Francis
09e956ef3a add CBounds.fromCompat() tests
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: Ibca9d4c3e18a027f0b3842c434143076daba436f
2021-02-26 21:48:15 +05:30
Dennis Francis
9ab15688ec make zoom-animation with overlays work correctly for freeze-panes
The implicit transformations done in tile drawing(from offscreen canvas)
must match the canvas transformation done for drawing the overlays.

Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: If434eb87be99754a2def290b19631a1970e83488
2021-02-26 21:48:15 +05:30
Dennis Francis
28f97d76e0 draw overlay on top during zoom-animation
at the frame zoom level on the main canvas after tilesection is drawn
using off-screen canvas.

Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I45adafae4dc4eaaca27fb9b2d858186b04fb898e
2021-02-26 21:48:15 +05:30
Dennis Francis
f10bea6829 cancel animation frame after end frame step
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: Ibeac532f2d5e2d673f6a5f5f69adebdb506a5ef2
2021-02-26 21:48:15 +05:30
Dennis Francis
ec0433d372 Stop ignoring pan after dragend of cell-resize marker
Note that 'up' does not get fired after 'dragend', so the since
969f9f9860 window.IgnorePanning continues
to be true even after 'dragend' which disables panning for document
lifetime.

Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I76b03a0cd77cfdd36a932c2986d51e56007386ad
2021-02-26 21:48:15 +05:30
Henry Castro
266623aa2d kit: revisit log messages kit.cpp
LOG_FTL = abnormal, crash, denied service
LOG_ERR = load, save, session, connection, wrong parameters
other cases LOG_WRN, LOG_INF

Change-Id: Ieefc881876106b1afc4f34505903f1321b33411b
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-02-26 11:22:58 -04:00
Henry Castro
177fdf0330 test: run unit test with disabled capabilities
Change-Id: I78dbdcb1ec3d960b283016d86e95614a8cb0255c
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-02-26 11:13:47 -04:00
Tamás Zolnai
5554133f59 cypress: document some more helper methods.
Signed-off-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Change-Id: I004bbb33167bfeee9f7f332516cb4b4a805a5885
2021-02-26 14:19:31 +01:00
Tamás Zolnai
432da7fc1e cypress: document desktop helper methods.
Signed-off-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Change-Id: I4851c7c471b565968bca153635d9672d41894fe3
2021-02-26 14:19:31 +01:00
Tamás Zolnai
ad301743e2 cypress: make sure we don't do test retry in interactive test runner.
In the cypress.json we configure retries for headless mode only,
however when we run 'cypress run' with 'headed' flag we still have
retries, that we would like to avoid for consistency.
Cypress differentiate modes based on the command: e.g. 'cypress open' or
'cypress run'. We however differentiate based on headless or headed mode,
whether we run the test in an opened browser or in the background.

Signed-off-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Change-Id: Ib34ac3de105dfe410116019e3c3c2afe253636f2
2021-02-26 14:19:31 +01:00
Tamás Zolnai
fdaacc4faa cypress: add tests for statusbar (impress, desktop).
Signed-off-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Change-Id: I5615c78d146510ce1f755d77a5d618bf3476522b
2021-02-26 14:19:31 +01:00
Tamás Zolnai
1a910e137f cypress: add tests for statusbar (calc, desktop).
Signed-off-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Change-Id: I1346790c4285121d54c670f399b3fc90f3572746
2021-02-26 14:19:31 +01:00