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
9bf204f9
Kaydet (Commit)
9bf204f9
authored
Kas 02, 2015
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
afl-eventtesting: can simplify this now we use QueryExit
Change-Id: Iddb96f51ed2fd2d7861e9448a7aa221d998ad2a5
üst
5d0ef001
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
40 deletions
+4
-40
app.hxx
desktop/inc/app.hxx
+1
-2
app.cxx
desktop/source/app/app.cxx
+3
-38
No files found.
desktop/inc/app.hxx
Dosyayı görüntüle @
9bf204f9
...
@@ -160,8 +160,7 @@ class Desktop : public Application
...
@@ -160,8 +160,7 @@ class Desktop : public Application
/** for ui-testing provide a mechanism to pseudo-restart by closing the
/** for ui-testing provide a mechanism to pseudo-restart by closing the
open frames and reopen the frame that appeared post initial startup
open frames and reopen the frame that appeared post initial startup
*/
*/
static
void
CloseFrameAndReopen
(
css
::
uno
::
Reference
<
css
::
frame
::
XDesktop2
>
xDesktop
);
static
void
DoExecute
();
static
void
DoExecute
(
css
::
uno
::
Reference
<
css
::
frame
::
XDesktop2
>
xDesktop
);
/// does initializations which are necessary for the first run of the office
/// does initializations which are necessary for the first run of the office
static
void
DoFirstRunInitializations
();
static
void
DoFirstRunInitializations
();
...
...
desktop/source/app/app.cxx
Dosyayı görüntüle @
9bf204f9
...
@@ -1277,45 +1277,10 @@ static ExecuteGlobals* pExecGlobals = NULL;
...
@@ -1277,45 +1277,10 @@ static ExecuteGlobals* pExecGlobals = NULL;
#define PERSIST_MAX 100
#define PERSIST_MAX 100
unsigned
int
persist_cnt
;
unsigned
int
persist_cnt
;
//This closes the current frame and reopens the initial frame, useful for
//pseudo-restarting, i.e. attempt to effectively reset to the initial state of
//the application post start-up for ui-testing
void
Desktop
::
CloseFrameAndReopen
(
Reference
<
XDesktop2
>
xDesktop
)
{
css
::
uno
::
Reference
<
css
::
container
::
XIndexAccess
>
xTaskContainer
(
xDesktop
->
getFrames
(),
css
::
uno
::
UNO_QUERY_THROW
);
sal_Int32
c
=
xTaskContainer
->
getCount
();
for
(
sal_Int32
i
=
0
;
i
<
c
;
++
i
)
{
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>
xFrame
;
xTaskContainer
->
getByIndex
(
i
)
>>=
xFrame
;
if
(
!
xFrame
.
is
())
continue
;
Reference
<
css
::
frame
::
XDispatchProvider
>
xProvider
(
xFrame
,
css
::
uno
::
UNO_QUERY
);
css
::
uno
::
Reference
<
css
::
frame
::
XController
>
xController
=
xFrame
->
getController
();
css
::
uno
::
Reference
<
css
::
frame
::
XModel
>
xModel
=
xController
->
getModel
();
css
::
uno
::
Reference
<
css
::
util
::
XModifiable
>
xModifiable
(
xModel
,
css
::
uno
::
UNO_QUERY
);
xModifiable
->
setModified
(
false
);
css
::
util
::
URL
aCommand
;
aCommand
.
Complete
=
".uno:CloseDoc"
;
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>
xContext
=
::
comphelper
::
getProcessComponentContext
();
Reference
<
css
::
util
::
XURLTransformer
>
xParser
=
css
::
util
::
URLTransformer
::
create
(
xContext
);
xParser
->
parseStrict
(
aCommand
);
css
::
uno
::
Reference
<
css
::
frame
::
XDispatch
>
xDispatch
=
xProvider
->
queryDispatch
(
aCommand
,
OUString
(),
0
);
xDispatch
->
dispatch
(
aCommand
,
css
::
uno
::
Sequence
<
css
::
beans
::
PropertyValue
>
());
}
OpenDefault
();
}
//This just calls Execute() for all normal uses of LibreOffice, but for
//This just calls Execute() for all normal uses of LibreOffice, but for
//ui-testing if AFL_PERSISTENT is set then on exit it will pseudo-restart (up
//ui-testing if AFL_PERSISTENT is set then on exit it will pseudo-restart (up
//to PERSIST_MAX times)
//to PERSIST_MAX times)
void
Desktop
::
DoExecute
(
Reference
<
XDesktop2
>
xDesktop
)
void
Desktop
::
DoExecute
()
{
{
try_again
:
try_again
:
{
{
...
@@ -1327,7 +1292,7 @@ try_again:
...
@@ -1327,7 +1292,7 @@ try_again:
program is executed directly; and take note of PERSIST_MAX. */
program is executed directly; and take note of PERSIST_MAX. */
if
(
getenv
(
"AFL_PERSISTENT"
)
&&
persist_cnt
++
<
PERSIST_MAX
)
if
(
getenv
(
"AFL_PERSISTENT"
)
&&
persist_cnt
++
<
PERSIST_MAX
)
{
{
CloseFrameAndReopen
(
xDesktop
);
OpenDefault
(
);
#if defined UNX
#if defined UNX
raise
(
SIGSTOP
);
raise
(
SIGSTOP
);
#endif
#endif
...
@@ -1651,7 +1616,7 @@ int Desktop::Main()
...
@@ -1651,7 +1616,7 @@ int Desktop::Main()
// if this run of the office is triggered by restart, some additional actions should be done
// if this run of the office is triggered by restart, some additional actions should be done
DoRestartActionsIfNecessary
(
!
rCmdLineArgs
.
IsInvisible
()
&&
!
rCmdLineArgs
.
IsNoQuickstart
()
);
DoRestartActionsIfNecessary
(
!
rCmdLineArgs
.
IsInvisible
()
&&
!
rCmdLineArgs
.
IsNoQuickstart
()
);
DoExecute
(
xDesktop
);
DoExecute
();
}
}
}
}
catch
(
const
css
::
document
::
CorruptedFilterConfigurationException
&
exFilterCfg
)
catch
(
const
css
::
document
::
CorruptedFilterConfigurationException
&
exFilterCfg
)
...
...
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