Fix testSaveAsUndoStackAnnotations autotest
ClosedPublic

Authored by rkflx on Dec 31 2017, 2:59 PM.

Details

Summary

Okular allows to drop changes when saving to a file format not
supporting those. However, this is only sensible for Save As,
while for Save the Continue button is not needed. When this
behaviour was introduced in 481676dcedf1, the jpg test row failed
subsequently, because closeDialogHelper relies on the availability of
the Continue button. The epub test row is similar, but returns
early because it does not allow canSwapBackingFile and therefore does
not fail the test afterwards.

As the test progresses, the initial Save As (potato.jpg to
/tmp/123.jpg) is implicitly followed by Save (/tmp/123.jpg to
/tmp/123.jpg) for each subsequent part.saveAs. This causes the
Continue button to vanish, so eventually the test will fail.

Forcing Save As so the Continue button continues to exist
could be done in multiple ways, but just alternating between two
different files to save seems like the most efficient and most readable
approach.

Test Plan
  • ./autotests/parttest testSaveAsUndoStackAnnotations:jpg now passes.
  • Other test rows still pass.
  • No changes to non-test code needed.

Diff Detail

Repository
R223 Okular
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rkflx created this revision.Dec 31 2017, 2:59 PM
Restricted Application added a project: Okular. · View Herald TranscriptDec 31 2017, 2:59 PM
Restricted Application added a subscriber: Okular. · View Herald Transcript
rkflx requested review of this revision.Dec 31 2017, 2:59 PM
rkflx added a reviewer: Okular.Jan 1 2018, 7:34 AM
aacid accepted this revision.Jan 2 2018, 4:31 PM
This revision is now accepted and ready to land.Jan 2 2018, 4:31 PM
This revision was automatically updated to reflect the committed changes.