Revert "CppunitTest_desktop_lib: add ModifiedStatus callback testcase"
This reverts commit cdf08b3aa7
. It breaks
'make -sr CppunitTest_desktop_lib
CPPUNIT_TEST_NAME="DesktopLOKTest::testPaintPartTile
DesktopLOKTest::testWriterCommentInsertCursor" VALGRIND=memcheck' (it is
terminated by SIGSEGV), and also it's the reason why sometimes the
lo_ubsan buildbot fails, see e.g.
<http://ci.libreoffice.org/job/lo_ubsan/329/console>.
This has to be re-introduced once I find a way to process all binding
updates at once without side-effects.
Conflicts:
desktop/qa/desktop_lib/test_desktop_lib.cxx
sfx2/source/control/bindings.cxx
Change-Id: Id6c49b9b31095ef1a1a8c1cd92cbae5deb316500
This commit is contained in:
@@ -91,7 +91,6 @@ public:
|
||||
void testCellCursor();
|
||||
void testCommandResult();
|
||||
void testWriterComments();
|
||||
void testModifiedStatus();
|
||||
void testSheetOperations();
|
||||
void testSheetSelections();
|
||||
void testContextMenuCalc();
|
||||
@@ -124,7 +123,6 @@ public:
|
||||
CPPUNIT_TEST(testCellCursor);
|
||||
CPPUNIT_TEST(testCommandResult);
|
||||
CPPUNIT_TEST(testWriterComments);
|
||||
CPPUNIT_TEST(testModifiedStatus);
|
||||
CPPUNIT_TEST(testSheetOperations);
|
||||
CPPUNIT_TEST(testSheetSelections);
|
||||
CPPUNIT_TEST(testContextMenuCalc);
|
||||
@@ -755,66 +753,6 @@ void DesktopLOKTest::testWriterComments()
|
||||
comphelper::LibreOfficeKit::setActive(false);
|
||||
}
|
||||
|
||||
void DesktopLOKTest::testModifiedStatus()
|
||||
{
|
||||
LibLibreOffice_Impl aOffice;
|
||||
comphelper::LibreOfficeKit::setActive();
|
||||
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
|
||||
pDocument->pClass->initializeForRendering(pDocument, nullptr);
|
||||
pDocument->pClass->registerCallback(pDocument, &DesktopLOKTest::callback, this);
|
||||
|
||||
// Type "t" and check that the document was set as modified
|
||||
m_bModified = false;
|
||||
m_aStateChangedCondition.reset();
|
||||
pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 't', 0);
|
||||
Scheduler::ProcessEventsToIdle();
|
||||
TimeValue aTimeValue = { 2 , 0 }; // 2 seconds max
|
||||
m_aStateChangedCondition.wait(aTimeValue);
|
||||
Scheduler::ProcessEventsToIdle();
|
||||
|
||||
// This was false, there was no callback about the modified status change.
|
||||
CPPUNIT_ASSERT(m_bModified);
|
||||
|
||||
// Perform SaveAs with "TakeOwnership" option set, and check that the
|
||||
// modification state was reset
|
||||
m_aStateChangedCondition.reset();
|
||||
utl::TempFile aTempFile;
|
||||
aTempFile.EnableKillingFile();
|
||||
CPPUNIT_ASSERT(pDocument->pClass->saveAs(pDocument, aTempFile.GetURL().toUtf8().getStr(), "odt", "TakeOwnership"));
|
||||
Scheduler::ProcessEventsToIdle();
|
||||
m_aStateChangedCondition.wait(aTimeValue);
|
||||
Scheduler::ProcessEventsToIdle();
|
||||
|
||||
// There was no callback about the modified status change.
|
||||
CPPUNIT_ASSERT(!m_bModified);
|
||||
|
||||
// Modify the document again
|
||||
m_aStateChangedCondition.reset();
|
||||
pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 't', 0);
|
||||
Scheduler::ProcessEventsToIdle();
|
||||
m_aStateChangedCondition.wait(aTimeValue);
|
||||
Scheduler::ProcessEventsToIdle();
|
||||
|
||||
// There was no callback about the modified status change.
|
||||
CPPUNIT_ASSERT(m_bModified);
|
||||
|
||||
/*
|
||||
// TODO: move this to a test where LOK is fully bootstrapped, so that we can
|
||||
// get back the notification about ".uno:Save" too
|
||||
// Now perform a normal "Save", and check the modified state was reset
|
||||
// again
|
||||
m_aStateChangedCondition.reset();
|
||||
pDocument->pClass->postUnoCommand(pDocument, ".uno:Save", nullptr, false);
|
||||
m_aStateChangedCondition.wait(aTimeValue);
|
||||
Scheduler::ProcessEventsToIdle();
|
||||
|
||||
// There was no callback about the modified status change.
|
||||
CPPUNIT_ASSERT(!m_bModified);
|
||||
*/
|
||||
|
||||
comphelper::LibreOfficeKit::setActive(false);
|
||||
}
|
||||
|
||||
void DesktopLOKTest::testTrackChanges()
|
||||
{
|
||||
// Load a document and create two views.
|
||||
|
@@ -1470,9 +1470,7 @@ bool SfxBindings::NextJob_Impl(Timer * pTimer)
|
||||
}
|
||||
|
||||
// if possible Update all server / happens in its own time slice
|
||||
// but process all events at once when unit testing, for reliability reasons
|
||||
static bool bTest = getenv("LO_TESTNAME");
|
||||
if ( pImpl->bMsgDirty && !bTest )
|
||||
if ( pImpl->bMsgDirty )
|
||||
{
|
||||
UpdateSlotServer_Impl();
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user