Home | History | Annotate | Download | only in timer

Lines Matching refs:Timer

5 #include "base/timer/timer.h"
37 // The message loops on which each timer should be tested.
58 // A basic helper class that can start a one-shot timer and signal a
59 // WaitableEvent when this timer fires.
99 // until the timer fires and to change task runner for the timer.
226 // This should run before the timer expires.
229 // Now start the timer.
265 // This should run before the timer expires.
268 // Now start the timer.
297 // If Delay is never called, the timer shouldn't go off.
299 DelayTimer timer(FROM_HERE, TimeDelta::FromMilliseconds(1), &target,
313 DelayTimer timer(FROM_HERE, TimeDelta::FromMilliseconds(1), &target,
315 timer.Reset();
325 ResetHelper(DelayTimer* timer, DelayTimerTarget* target)
326 : timer_(timer), target_(target) {}
341 // If Delay is never called, the timer shouldn't go off.
343 DelayTimer timer(FROM_HERE, TimeDelta::FromMilliseconds(50), &target,
345 timer.Reset();
347 ResetHelper reset_helper(&timer, &target);
375 DelayTimer timer(FROM_HERE, TimeDelta::FromMilliseconds(50), &target,
377 timer.Reset();
380 // When the timer is deleted, the DelayTimerFatalTarget should never be
403 // If underline timer does not handle properly, we will crash or fail
412 // A MessageLoop is required for the timer events on the other thread to
413 // communicate back to the Timer under test.
443 OneShotTimer timer(tick_clock.get());
444 timer.Start(FROM_HERE, TimeDelta::FromSeconds(1),
486 RepeatingTimer timer(tick_clock.get());
487 timer.Start(FROM_HERE, TimeDelta::FromSeconds(1),
490 timer.Stop();
526 DelayTimer timer(FROM_HERE, TimeDelta::FromSeconds(1), &receiver,
530 timer.Reset();
533 timer.Reset();
560 // Ref counted class which owns a Timer. The class passes a reference to itself
561 // via the |user_task| parameter in Timer::Start(). |Timer::user_task_| might
569 // Start timer with long delay in order to test the timer getting destroyed
570 // while a timer task is still pending.
580 ADD_FAILURE() << "Timer unexpectedly fired.";
590 // if there is a pending timer not yet fired and |Timer::user_task_| owns the
591 // timer. The test may only trigger exceptions if debug heap checking is
599 // |Timer::user_task_| owns sole reference to |tester|.
610 Timer timer(false, false);
611 EXPECT_FALSE(timer.IsRunning());
612 timer.Start(FROM_HERE, TimeDelta::FromDays(1), Bind(&TimerTestCallback));
613 EXPECT_TRUE(timer.IsRunning());
614 timer.Stop();
615 EXPECT_FALSE(timer.IsRunning());
616 EXPECT_TRUE(timer.user_task().is_null());
620 Timer timer(true, false);
622 EXPECT_FALSE(timer.IsRunning());
623 timer.Start(FROM_HERE, TimeDelta::FromDays(1), Bind(&TimerTestCallback));
624 EXPECT_TRUE(timer.IsRunning());
625 timer.Stop();
626 EXPECT_FALSE(timer.IsRunning());
627 ASSERT_FALSE(timer.user_task().is_null());
628 timer.Reset();
629 EXPECT_TRUE(timer.IsRunning());
634 Timer timer(false, false);
637 EXPECT_FALSE(timer.IsRunning());
638 timer.Start(FROM_HERE, TimeDelta::FromDays(1), Bind(&TimerTestCallback));
639 EXPECT_TRUE(timer.IsRunning());
641 EXPECT_FALSE(timer.IsRunning());
642 EXPECT_TRUE(timer.user_task().is_null());
647 Timer timer(FROM_HERE, TimeDelta::FromDays(1), Bind(&TimerTestCallback),
649 EXPECT_FALSE(timer.IsRunning());
650 timer.Reset();
651 EXPECT_TRUE(timer.IsRunning());
652 timer.Stop();
653 EXPECT_FALSE(timer.IsRunning());
654 timer.Reset();
655 EXPECT_TRUE(timer.IsRunning());
660 Timer timer(FROM_HERE, TimeDelta::FromDays(1), Bind(&TimerTestCallback),
662 EXPECT_FALSE(timer.IsRunning());
663 timer.Reset();
664 EXPECT_TRUE(timer.IsRunning());
665 timer.Stop();
666 EXPECT_FALSE(timer.IsRunning());
667 timer.Reset();
668 EXPECT_TRUE(timer.IsRunning());
697 Timer timer(false, false);
698 timer.Start(FROM_HERE, TimeDelta::FromMilliseconds(10),
700 timer.Stop();
701 timer.Start(FROM_HERE, TimeDelta::FromMilliseconds(40),
713 Timer timer(false, false);
714 timer.Start(FROM_HERE, TimeDelta::FromMilliseconds(10),
716 timer.Reset();
718 ASSERT_FALSE(timer.user_task().is_null());