diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2022-01-25 08:45:30 -0500 |
---|---|---|
committer | Pranam Lashkari <plashkari628@gmail.com> | 2022-01-26 15:33:15 +0530 |
commit | 9e5b9d6d37bf4ed5675b50ba9b5823812ddb7c89 (patch) | |
tree | 2ef9cf6fe1d506dc306cea39357a4ef48c739b0f /cypress_test/integration_tests/desktop/draw | |
parent | make sure modifiedTimeUs calculates with enough precision (diff) | |
download | online-9e5b9d6d37bf4ed5675b50ba9b5823812ddb7c89.tar.gz online-9e5b9d6d37bf4ed5675b50ba9b5823812ddb7c89.zip |
wsd: support PDF comment saving during unload with test
PDFs are view_comment type documents where
editing is not supported, but adding comments
are. This means that we do get ModifiedStatus=true
but we never get ModifiedStatus=false after
.uno:Save. This is because the save command is
handled in a special way in Core by invoking
save-as instead, which doesn't reset the
ModifiedStatus.
The issue with this was that DocBroker was
stuck on trying to save the document
before unloading, thinking it was modified
due to the stuck ModifiedStatus. Here,
we change the definition of isPossiblyModified()
to ignore the ModifiedStatus for such documents.
Instead, we rely on the last save being successful
and that no new user input exists past the last
save request.
In addition, we now have a new Cypress test
that reproduced the failure without the fix
and now passes with the fix.
Change-Id: Ida9d486ac93a588b9007c5e4583d8bf3c090a62d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Diffstat (limited to 'cypress_test/integration_tests/desktop/draw')
-rw-r--r-- | cypress_test/integration_tests/desktop/draw/pdf_page_up_down_spec.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cypress_test/integration_tests/desktop/draw/pdf_page_up_down_spec.js b/cypress_test/integration_tests/desktop/draw/pdf_page_up_down_spec.js index 0d6af1675b..41e7cd5221 100644 --- a/cypress_test/integration_tests/desktop/draw/pdf_page_up_down_spec.js +++ b/cypress_test/integration_tests/desktop/draw/pdf_page_up_down_spec.js @@ -1,6 +1,7 @@ /* global describe it cy require afterEach beforeEach */ var helper = require('../../common/helper'); +var desktopHelper = require('../../common/desktop_helper'); describe('PDF View Tests', function() { var origTestFileName = 'pdf_page_up_down.pdf'; @@ -21,4 +22,19 @@ describe('PDF View Tests', function() { cy.get('#map').type('{pageup}'); cy.get('#preview-frame-part-0').should('have.attr', 'style', 'border: 2px solid darkgrey;'); }); + + it('PDF insert comment', { env: { 'pdf-view': true } }, function() { + + // Insert some comment into the PDF. + desktopHelper.insertMultipleComment('draw', 1, true); + cy.get('.cool-annotation-content-wrapper').should('exist'); + cy.get('#annotation-content-area-1').should('contain','some text0'); + + // Reload to close and save. PDFs cannot really be edited, + // only comments can be inserted, so they are not saved + // directly, rather save-as is used. This failed because + // DocBroker expected to get ModifiedStatus=false, which + // never happens with save-as and so we couldn't unload. + helper.reload(testFileName, 'draw', true); + }); }); |