summaryrefslogtreecommitdiff
path: root/desktop/qa
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2017-02-19 23:58:52 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-02-28 09:50:11 +0000
commite7729f458409f7fef2b7dab752205e3b230acb65 (patch)
tree32b71b7dedfb50b887ce2dd2313bb27d273c419a /desktop/qa
parent6603947329a7b372a173a3c60e013e532d0bc5cf (diff)
Run macro:// via LOKit
Change-Id: I54d3c734d86d4b44e1dfe1ad7728e2f51cd26d53 Reviewed-on: https://gerrit.libreoffice.org/34538 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'desktop/qa')
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 62ec69d63576..81cbecedc686 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -107,6 +107,7 @@ public:
void testCommentsCalc();
void testCommentsImpress();
void testCommentsCallbacksWriter();
+ void testRunMacro();
CPPUNIT_TEST_SUITE(DesktopLOKTest);
CPPUNIT_TEST(testGetStyles);
@@ -145,6 +146,7 @@ public:
CPPUNIT_TEST(testCommentsCalc);
CPPUNIT_TEST(testCommentsImpress);
CPPUNIT_TEST(testCommentsCallbacksWriter);
+ CPPUNIT_TEST(testRunMacro);
CPPUNIT_TEST_SUITE_END();
uno::Reference<lang::XComponent> mxComponent;
@@ -2096,6 +2098,19 @@ void DesktopLOKTest::testCommentsCallbacksWriter()
comphelper::LibreOfficeKit::setActive(false);
}
+void DesktopLOKTest::testRunMacro()
+{
+ LibLibreOffice_Impl aOffice;
+ bool bGoodMacro, bNonExistentMacro;
+
+ // Tools macros come pre-installed in system share/basic folder,
+ bGoodMacro = aOffice.m_pOfficeClass->runMacro(&aOffice, OString("macro:///Tools.Debug.ActivateReadOnlyFlag()").getStr());
+ CPPUNIT_ASSERT(bGoodMacro);
+
+ bNonExistentMacro = aOffice.m_pOfficeClass->runMacro(&aOffice, OString("macro:///I.Am.Not(There)").getStr());
+ CPPUNIT_ASSERT(!bNonExistentMacro);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest);
CPPUNIT_PLUGIN_IMPLEMENT();