Kaydet (Commit) 45935fc3 authored tarafından Michael Meeks's avatar Michael Meeks

quit after emitting all the events to allow valgrinding.

Change-Id: Ibee9d8f00008dd0a266db276772d48deb0bd9d18
üst 4ea70f09
...@@ -120,7 +120,7 @@ void DebugEventInjector::InjectMenuEvent() ...@@ -120,7 +120,7 @@ void DebugEventInjector::InjectMenuEvent()
static void InitKeyEvent( SalKeyEvent &rKeyEvent ) static void InitKeyEvent( SalKeyEvent &rKeyEvent )
{ {
double nRand = getRandom(); double nRand = getRandom();
if (nRand < 0.01) if (nRand < 0.001)
rKeyEvent.mnTime = getRandom() * ULONG_MAX; rKeyEvent.mnTime = getRandom() * ULONG_MAX;
else else
rKeyEvent.mnTime = Time::GetSystemTicks(); rKeyEvent.mnTime = Time::GetSystemTicks();
...@@ -216,14 +216,15 @@ void DebugEventInjector::InjectKeyNavEdit() ...@@ -216,14 +216,15 @@ void DebugEventInjector::InjectKeyNavEdit()
InitKeyEvent( aKeyEvent ); InitKeyEvent( aKeyEvent );
aKeyEvent.mnCode = nKey; aKeyEvent.mnCode = nKey;
if (getRandom() < 0.10) // modifier if (getRandom() < 0.15) // modifier
aKeyEvent.mnCode |= (sal_uInt16)(getRandom() * KEY_MODTYPE) & KEY_MODTYPE; aKeyEvent.mnCode |= (sal_uInt16)(getRandom() * KEY_MODTYPE) & KEY_MODTYPE;
aKeyEvent.mnCharCode = 0x0; // hopefully unused. aKeyEvent.mnCharCode = 0x0; // hopefully unused.
bool bHandled = ImplWindowFrameProc( pWindow, NULL, SALEVENT_KEYINPUT, &aKeyEvent); bool bHandled = ImplWindowFrameProc( pWindow, NULL, SALEVENT_KEYINPUT, &aKeyEvent );
fprintf (stderr, "Injected edit / move key 0x%x -> %d win %p\n", fprintf( stderr, "Injected edit / move key 0x%x -> %d win %p\n",
(int) aKeyEvent.mnCode, (int)bHandled, pWindow); (int) aKeyEvent.mnCode, (int)bHandled, pWindow );
ImplWindowFrameProc( pWindow, NULL, SALEVENT_KEYUP, &aKeyEvent );
} }
void DebugEventInjector::Timeout() void DebugEventInjector::Timeout()
...@@ -235,6 +236,8 @@ void DebugEventInjector::Timeout() ...@@ -235,6 +236,8 @@ void DebugEventInjector::Timeout()
SetTimeout( 1 ); SetTimeout( 1 );
Start(); Start();
} }
else
Application::Quit();
} }
DebugEventInjector *DebugEventInjector::getCreate() DebugEventInjector *DebugEventInjector::getCreate()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment