summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2014-11-05 20:51:21 +0000
committerMichael Meeks <michael.meeks@collabora.com>2014-11-05 20:59:47 +0000
commit42019e2f25235f69ac5f8efdabedd99fca32f1a1 (patch)
tree5c2620004a181a6b5fb90ba731292b067d84a6a6
parent4907c32bb8c51a47e379ca75abeaaca6e3ce248e (diff)
idle: unit test.
Change-Id: Ie48fb4260bf580010715777bc63974e4d635aed8
-rw-r--r--vcl/qa/cppunit/timer.cxx26
1 files changed, 22 insertions, 4 deletions
diff --git a/vcl/qa/cppunit/timer.cxx b/vcl/qa/cppunit/timer.cxx
index a0860009ca6d..4e2bb5647f7d 100644
--- a/vcl/qa/cppunit/timer.cxx
+++ b/vcl/qa/cppunit/timer.cxx
@@ -79,13 +79,31 @@ void TimerTest::testWatchdog()
}
#endif
+// --------------------------------------------------------------------
-void TimerTest::testIdle()
+class IdleBool : public Idle
{
-// Add an idle handler
-// forcible execute that lot first ... and ...
+ bool &mrBool;
+public:
+ IdleBool( bool &rBool ) :
+ Idle( VCL_IDLE_PRIORITY_LOWEST ), mrBool( rBool )
+ {
+ Start();
+ mrBool = false;
+ }
+ virtual void Timeout() SAL_OVERRIDE
+ {
+ mrBool = true;
+ Application::EndYield();
+ }
+};
-// Error ...
+void TimerTest::testIdle()
+{
+ bool bTriggered = false;
+ IdleBool aTest( bTriggered );
+ Timer::ProcessAllIdleHandlers();
+ CPPUNIT_ASSERT_MESSAGE("watchdog triggered", bTriggered);
}
// --------------------------------------------------------------------