Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
cfa94043
Kaydet (Commit)
cfa94043
authored
Şub 11, 2016
tarafından
Jan Holesovsky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
lok: Extend the StatusModified unit test with Save As.
Change-Id: Ie9bbce6892fe1dcf55e23028e68037f996d7c71f
üst
645ec0a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
3 deletions
+39
-3
test_desktop_lib.cxx
desktop/qa/desktop_lib/test_desktop_lib.cxx
+39
-3
No files found.
desktop/qa/desktop_lib/test_desktop_lib.cxx
Dosyayı görüntüle @
cfa94043
...
...
@@ -644,10 +644,10 @@ void DesktopLOKTest::testModifiedStatus()
pDocument
->
pClass
->
initializeForRendering
(
pDocument
,
nullptr
);
pDocument
->
pClass
->
registerCallback
(
pDocument
,
&
DesktopLOKTest
::
callback
,
this
);
// Set the document as modified.
// Type "t" and check that the document was set as modified
m_bModified
=
false
;
m_aStateChangedCondition
.
reset
();
uno
::
Reference
<
util
::
XModifiable
>
xModifiable
(
mxComponent
,
uno
::
UNO_QUERY
);
xModifiable
->
setModified
(
true
);
pDocument
->
pClass
->
postKeyEvent
(
pDocument
,
LOK_KEYEVENT_KEYINPUT
,
't'
,
0
);
TimeValue
aTimeValue
=
{
2
,
0
};
// 2 seconds max
m_aStateChangedCondition
.
wait
(
aTimeValue
);
Scheduler
::
ProcessEventsToIdle
();
...
...
@@ -655,6 +655,42 @@ void DesktopLOKTest::testModifiedStatus()
// 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"
));
m_aStateChangedCondition
.
wait
(
aTimeValue
);
Scheduler
::
ProcessEventsToIdle
();
// There was no callback about the modified status change.
CPPUNIT_ASSERT
(
!
m_bModified
);
// Modify the document again
m_bModified
=
false
;
m_aStateChangedCondition
.
reset
();
pDocument
->
pClass
->
postKeyEvent
(
pDocument
,
LOK_KEYEVENT_KEYINPUT
,
't'
,
0
);
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
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment