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
4eed8e53
Kaydet (Commit)
4eed8e53
authored
Nis 29, 2015
tarafından
Michael Meeks
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
abhortive focus unit test - apparently we need visible windows for that.
Change-Id: I64999eb625a4b312997ba78698710bd1acaf8da7
üst
3801e506
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
lifecycle.cxx
vcl/qa/cppunit/lifecycle.cxx
+41
-0
No files found.
vcl/qa/cppunit/lifecycle.cxx
Dosyayı görüntüle @
4eed8e53
...
...
@@ -16,6 +16,7 @@
#include <vcl/combobox.hxx>
#include <vcl/field.hxx>
#include <vcl/virdev.hxx>
#include <vcl/tabctrl.hxx>
class
LifecycleTest
:
public
test
::
BootstrapFixture
{
...
...
@@ -31,6 +32,7 @@ public:
void
testParentedWidgets
();
void
testChildDispose
();
void
testPostDispose
();
void
testFocus
();
CPPUNIT_TEST_SUITE
(
LifecycleTest
);
CPPUNIT_TEST
(
testCast
);
...
...
@@ -40,6 +42,7 @@ public:
CPPUNIT_TEST
(
testParentedWidgets
);
CPPUNIT_TEST
(
testChildDispose
);
CPPUNIT_TEST
(
testPostDispose
);
CPPUNIT_TEST
(
testFocus
);
CPPUNIT_TEST_SUITE_END
();
};
...
...
@@ -143,6 +146,44 @@ void LifecycleTest::testPostDispose()
CPPUNIT_ASSERT
(
!
xWin
->
GetWindow
(
0
));
}
class
FocusCrashPostDispose
:
public
TabControl
{
public
:
FocusCrashPostDispose
(
vcl
::
Window
*
pParent
)
:
TabControl
(
pParent
,
0
)
{
}
virtual
bool
PreNotify
(
NotifyEvent
&
)
SAL_OVERRIDE
{
return
false
;
}
virtual
bool
Notify
(
NotifyEvent
&
)
SAL_OVERRIDE
{
// CPPUNIT_ASSERT(false && "notify");
return
false
;
}
virtual
void
GetFocus
()
SAL_OVERRIDE
{
CPPUNIT_ASSERT
(
false
&&
"get focus"
);
}
virtual
void
LoseFocus
()
SAL_OVERRIDE
{
CPPUNIT_ASSERT
(
false
&&
"this should never be called"
);
}
};
void
LifecycleTest
::
testFocus
()
{
ScopedVclPtrInstance
<
WorkWindow
>
xWin
(
nullptr
,
WB_APP
|
WB_STDWORK
);
ScopedVclPtrInstance
<
FocusCrashPostDispose
>
xChild
(
xWin
);
xWin
->
Show
();
xChild
->
GrabFocus
();
// process asynchronous ToTop
Scheduler
::
ProcessTaskScheduling
(
false
);
// FIXME: really awful to test focus issues without showing windows.
// CPPUNIT_ASSERT(xChild->HasFocus());
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
LifecycleTest
);
CPPUNIT_PLUGIN_IMPLEMENT
();
...
...
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