diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-11-11 16:44:59 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-11-11 20:09:41 +0100 |
commit | 7986d35eee84fdf391c563602fb348758e1cd254 (patch) | |
tree | 0be65fbf8655c1461f712537ba0130f99b4d8da2 /include/test | |
parent | 4c9093c95445c154c4ce7db1756ca936ea0752ca (diff) |
move password handling from SwModelTestBase to UnoApiTest
so other places inheriting from UnoApiTest can also import/export
protected documents
Change-Id: I0e2716204dbb171c9e17e3939b266977e1b96dda
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142592
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'include/test')
-rw-r--r-- | include/test/unoapi_test.hxx | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx index 307d0f1a0589..0277131e31f7 100644 --- a/include/test/unoapi_test.hxx +++ b/include/test/unoapi_test.hxx @@ -14,7 +14,9 @@ #include <string_view> +#include <rtl/ref.hxx> #include <test/bootstrapfixture.hxx> +#include <test/testinteractionhandler.hxx> #include <unotest/macros_test.hxx> #include <com/sun/star/lang/XComponent.hpp> #include <osl/file.hxx> @@ -28,24 +30,32 @@ class OOO_DLLPUBLIC_TEST UnoApiTest : public test::BootstrapFixture, public unot public: UnoApiTest(OUString path); - OUString createFileURL(std::u16string_view aFileBase); - OUString loadFromURL(std::u16string_view aFileBase); - virtual void setUp() override; virtual void tearDown() override; + OUString createFileURL(std::u16string_view aFileBase); + void load(const OUString& rURL, const char* pPassword = nullptr); + OUString loadFromURL(std::u16string_view aFileBase, const char* pPassword = nullptr); + css::uno::Any executeMacro(const OUString& rScriptURL, const css::uno::Sequence<css::uno::Any>& rParams = {}); void save(const OUString& rFilter, const char* pPassword = nullptr); void saveAndClose(const OUString& rFilter); - void saveAndReload(const OUString& rFilter); + void saveAndReload(const OUString& rFilter, const char* pPassword = nullptr); std::unique_ptr<vcl::pdf::PDFiumDocument> parsePDFExport(const OString& rPassword = OString()); void skipValidation() { mbSkipValidation = true; } void setFilterOptions(const OUString& rFilterOptions) { maFilterOptions = rFilterOptions; } + void setImportFilterOptions(const OUString& rFilterOptions) + { + maImportFilterOptions = rFilterOptions; + } + + void setImportFilterName(const OUString& rFilterName) { maImportFilterName = rFilterName; } + protected: // reference to document component that we are testing css::uno::Reference<css::lang::XComponent> mxComponent; @@ -54,10 +64,19 @@ protected: SvMemoryStream maMemory; // Underlying memory for parsed PDF files. + rtl::Reference<TestInteractionHandler> xInteractionHandler; + private: + void + setTestInteractionHandler(const char* pPassword, + std::vector<com::sun::star::beans::PropertyValue>& rFilterOptions); + bool mbSkipValidation; OUString m_aBaseString; OUString maFilterOptions; + + OUString maImportFilterOptions; + OUString maImportFilterName; }; #endif // INCLUDED_TEST_UNOAPI_TEST_HXX |