summaryrefslogtreecommitdiff
path: root/desktop/qa
diff options
context:
space:
mode:
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();