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
2ad231f9
Kaydet (Commit)
2ad231f9
authored
Eki 06, 2015
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
experimental afl driven ui testing
Change-Id: I1933951c52adc75ed36db2c083c232f29b6140d6
üst
c43cf1d2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
85 additions
and
0 deletions
+85
-0
cmdlineargs.cxx
desktop/source/app/cmdlineargs.cxx
+1
-0
svdata.hxx
vcl/inc/svdata.hxx
+6
-0
svapp.cxx
vcl/source/app/svapp.cxx
+65
-0
README.eventtesting
vcl/workben/README.eventtesting
+13
-0
eventtesting
vcl/workben/eventtesting
+0
-0
No files found.
desktop/source/app/cmdlineargs.cxx
Dosyayı görüntüle @
2ad231f9
...
...
@@ -494,6 +494,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
// vcl/unx/generic/app/sm.cxx:
oArg
!=
"session="
&&
#endif
oArg
!=
"eventtesting"
&&
//ignore additional legacy options that don't do anything anymore
oArg
!=
"nocrashreport"
&&
m_unknown
.
isEmpty
())
...
...
vcl/inc/svdata.hxx
Dosyayı görüntüle @
2ad231f9
...
...
@@ -31,6 +31,7 @@
#include "tools/debug.hxx"
#include "tools/solar.h"
#include "vcl/bitmapex.hxx"
#include "vcl/idle.hxx"
#include "vcl/dllapi.h"
#include "vcl/keycod.hxx"
#include "vcl/svapp.hxx"
...
...
@@ -156,7 +157,12 @@ struct ImplSVAppData
*/
ImeStatusWindowMode
meShowImeStatusWindow
;
SvFileStream
*
mpEventTestInput
;
Idle
*
mpEventTestingIdle
;
int
mnEventTestLimit
;
DECL_STATIC_LINK_TYPED
(
ImplSVAppData
,
ImplQuitMsg
,
void
*
,
void
);
DECL_LINK_TYPED
(
VclEventTestingHdl
,
Idle
*
,
void
);
};
struct
ImplSVGDIData
...
...
vcl/source/app/svapp.cxx
Dosyayı görüntüle @
2ad231f9
...
...
@@ -327,11 +327,76 @@ const vcl::KeyCode* Application::GetReservedKeyCode( sal_uLong i )
return
&
ImplReservedKeys
::
get
()
->
first
[
i
].
mKeyCode
;
}
namespace
{
bool
InjectKeyEvent
(
SvStream
&
rStream
)
{
VclPtr
<
vcl
::
Window
>
xWin
(
Application
::
GetActiveTopWindow
());
if
(
!
xWin
)
return
false
;
SalKeyEvent
aKeyEvent
;
rStream
.
ReadUInt64
(
aKeyEvent
.
mnTime
);
rStream
.
ReadUInt16
(
aKeyEvent
.
mnCode
);
rStream
.
ReadUInt16
(
aKeyEvent
.
mnCharCode
);
rStream
.
ReadUInt16
(
aKeyEvent
.
mnRepeat
);
if
(
!
rStream
.
good
())
return
false
;
ImplWindowFrameProc
(
xWin
.
get
(),
NULL
,
SALEVENT_KEYINPUT
,
&
aKeyEvent
);
ImplWindowFrameProc
(
xWin
.
get
(),
NULL
,
SALEVENT_KEYUP
,
&
aKeyEvent
);
return
true
;
}
}
IMPL_LINK_NOARG_TYPED
(
ImplSVAppData
,
VclEventTestingHdl
,
Idle
*
,
void
)
{
SAL_INFO
(
"vcl.eventtesting"
,
"EventTestLimit is "
<<
mnEventTestLimit
);
if
(
mnEventTestLimit
==
0
)
{
delete
mpEventTestInput
;
delete
mpEventTestingIdle
;
SAL_INFO
(
"vcl.eventtesting"
,
"Event Limit reached, exiting"
<<
mnEventTestLimit
);
Application
::
Quit
();
}
else
{
Scheduler
::
ProcessTaskScheduling
(
true
);
if
(
InjectKeyEvent
(
*
mpEventTestInput
))
--
mnEventTestLimit
;
if
(
!
mpEventTestInput
->
good
())
{
delete
mpEventTestInput
;
delete
mpEventTestingIdle
;
SAL_INFO
(
"vcl.eventtesting"
,
"Event Input exhausted, exiting"
<<
mnEventTestLimit
);
Application
::
Quit
();
return
;
}
Scheduler
::
ProcessTaskScheduling
(
true
);
mpEventTestingIdle
->
Start
();
}
}
void
Application
::
Execute
()
{
ImplSVData
*
pSVData
=
ImplGetSVData
();
pSVData
->
maAppData
.
mbInAppExecute
=
true
;
sal_uInt16
n
=
GetCommandLineParamCount
();
for
(
sal_uInt16
i
=
0
;
i
!=
n
;
++
i
)
{
if
(
GetCommandLineParam
(
i
)
==
"--eventtesting"
)
{
pSVData
->
maAppData
.
mnEventTestLimit
=
10
;
pSVData
->
maAppData
.
mpEventTestingIdle
=
new
Idle
(
"eventtesting"
);
pSVData
->
maAppData
.
mpEventTestingIdle
->
SetIdleHdl
(
LINK
(
&
(
pSVData
->
maAppData
),
ImplSVAppData
,
VclEventTestingHdl
));
pSVData
->
maAppData
.
mpEventTestingIdle
->
SetPriority
(
SchedulerPriority
::
LOWEST
);
pSVData
->
maAppData
.
mpEventTestInput
=
new
SvFileStream
(
"eventtesting"
,
StreamMode
::
READ
);
pSVData
->
maAppData
.
mpEventTestingIdle
->
Start
();
break
;
}
}
while
(
!
pSVData
->
maAppData
.
mbAppQuit
)
Application
::
Yield
();
...
...
vcl/workben/README.eventtesting
0 → 100644
Dosyayı görüntüle @
2ad231f9
Notes on experimental afl driven ui fuzzing
only keyboard events for now
vcl/workben/eventtesting is just serialized "helloworld" keystrokes to get
things started
currently an arbitrary limit of 10 keystrokes before application quits in
order to initially explore that shallow space
Xnest :1
cp vcl/workben/eventtesting .
afl-fuzz -f eventtesting -t 10000 -i ~/fuzz/in.vcl -o ~/fuzz/out.vcl -d -T vcl -m 50000000 instdir/program/soffice.bin --nologo --writer --eventtesting --norestore --display :1
vcl/workben/eventtesting
0 → 100644
Dosyayı görüntüle @
2ad231f9
File added
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