[Libreoffice-commits] core.git: desktop/qa sfx2/source

Miklos Vajna vmiklos at collabora.co.uk
Wed Oct 19 17:07:01 UTC 2016


 desktop/qa/desktop_lib/test_desktop_lib.cxx |   62 ----------------------------
 sfx2/source/control/bindings.cxx            |    4 -
 2 files changed, 1 insertion(+), 65 deletions(-)

New commits:
commit b86b78e0ad9bb1e6ed2e22a0fca18cad8d19ded1
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Oct 19 15:17:14 2016 +0200

    Revert "CppunitTest_desktop_lib: add ModifiedStatus callback testcase"
    
    This reverts commit cdf08b3aa74bb32ea18b583a9c0c41b91d7819ac. 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

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index d71df17..1c92165 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -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.
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index 04d625a..4562cc1 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -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;


More information about the Libreoffice-commits mailing list