diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-02-03 14:14:42 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-02-03 15:26:47 +0100 |
commit | 83549da20cd1a9ce3b42f1630d2e2f90ab732390 (patch) | |
tree | a54925fd028b7b8b70a8e1adb165c4cbdecfb2ad /sd/qa | |
parent | efc67a685f608fe32066875fb549c91b52d0bc6b (diff) |
tdf#124708: sd_uiimpress: Add unittest
Change-Id: I82e045af25924179b69e427439bcdbe6a11163b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110347
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sd/qa')
-rw-r--r-- | sd/qa/unit/data/tdf124708.ppt | bin | 0 -> 60928 bytes | |||
-rw-r--r-- | sd/qa/unit/uiimpress.cxx | 31 |
2 files changed, 31 insertions, 0 deletions
diff --git a/sd/qa/unit/data/tdf124708.ppt b/sd/qa/unit/data/tdf124708.ppt Binary files differnew file mode 100644 index 000000000000..6d29e1acbfee --- /dev/null +++ b/sd/qa/unit/data/tdf124708.ppt diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx index 8b444d7f3674..db2d6f4c61a3 100644 --- a/sd/qa/unit/uiimpress.cxx +++ b/sd/qa/unit/uiimpress.cxx @@ -235,6 +235,37 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf126197) pViewShell2->GetViewFrame()->GetDispatcher()->Execute(SID_DELETE, SfxCallMode::SYNCHRON); } +CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf124708) +{ + mxComponent = loadFromDesktop(m_directories.getURLFromSrc(u"sd/qa/unit/data/tdf124708.ppt")); + + CPPUNIT_ASSERT(mxComponent.is()); + + dispatchCommand(mxComponent, ".uno:NextPage", {}); + Scheduler::ProcessEventsToIdle(); + + checkCurrentPageNumber(2); + + auto pXImpressDocument = dynamic_cast<SdXImpressDocument*>(mxComponent.get()); + sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell(); + SdPage* pActualPage = pViewShell->GetActualPage(); + CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(16), pActualPage->GetObjCount()); + + dispatchCommand(mxComponent, ".uno:SelectAll", {}); + Scheduler::ProcessEventsToIdle(); + + // Without the fix in place, this test would have crashed here + dispatchCommand(mxComponent, ".uno:Delete", {}); + Scheduler::ProcessEventsToIdle(); + + CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pActualPage->GetObjCount()); + + dispatchCommand(mxComponent, ".uno:Undo", {}); + Scheduler::ProcessEventsToIdle(); + + CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(16), pActualPage->GetObjCount()); +} + CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf139996) { mxComponent = loadFromDesktop("private:factory/simpress", |