Lines Matching full:timer

5 #include "base/timer/timer.h"
36 // The message loops on which each timer should be tested.
57 // A basic helper class that can start a one-shot timer and signal a
58 // WaitableEvent when this timer fires.
98 // until the timer fires and to change task runner for the timer.
225 // This should run before the timer expires. in RunTest_OneShotTimers_Cancel()
228 // Now start the timer. in RunTest_OneShotTimers_Cancel()
264 // This should run before the timer expires. in RunTest_RepeatingTimer_Cancel()
267 // Now start the timer. in RunTest_RepeatingTimer_Cancel()
296 // If Delay is never called, the timer shouldn't go off. in RunTest_DelayTimer_NoCall()
298 DelayTimer timer(FROM_HERE, TimeDelta::FromMilliseconds(1), &target, in RunTest_DelayTimer_NoCall() local
312 DelayTimer timer(FROM_HERE, TimeDelta::FromMilliseconds(1), &target, in RunTest_DelayTimer_OneCall() local
314 timer.Reset(); in RunTest_DelayTimer_OneCall()
324 ResetHelper(DelayTimer* timer, DelayTimerTarget* target) in ResetHelper()
325 : timer_(timer), target_(target) {} in ResetHelper()
340 // If Delay is never called, the timer shouldn't go off. in RunTest_DelayTimer_Reset()
342 DelayTimer timer(FROM_HERE, TimeDelta::FromMilliseconds(50), &target, in RunTest_DelayTimer_Reset() local
344 timer.Reset(); in RunTest_DelayTimer_Reset()
346 ResetHelper reset_helper(&timer, &target); in RunTest_DelayTimer_Reset()
374 DelayTimer timer(FROM_HERE, TimeDelta::FromMilliseconds(50), &target, in RunTest_DelayTimer_Deleted() local
376 timer.Reset(); in RunTest_DelayTimer_Deleted()
379 // When the timer is deleted, the DelayTimerFatalTarget should never be in RunTest_DelayTimer_Deleted()
402 // If underline timer does not handle properly, we will crash or fail
411 // A MessageLoop is required for the timer events on the other thread to in TEST()
412 // communicate back to the Timer under test. in TEST()
441 OneShotTimer timer(task_runner->GetMockTickClock()); in TEST() local
442 timer.Start(FROM_HERE, TimeDelta::FromSeconds(1), in TEST()
483 RepeatingTimer timer(task_runner->GetMockTickClock()); in TEST() local
484 timer.Start(FROM_HERE, TimeDelta::FromSeconds(1), in TEST()
487 timer.Stop(); in TEST()
522 DelayTimer timer(FROM_HERE, TimeDelta::FromSeconds(1), &receiver, in TEST() local
526 timer.Reset(); in TEST()
529 timer.Reset(); in TEST()
556 // Ref counted class which owns a Timer. The class passes a reference to itself
557 // via the |user_task| parameter in Timer::Start(). |Timer::user_task_| might
565 // Start timer with long delay in order to test the timer getting destroyed in StartTimer()
566 // while a timer task is still pending. in StartTimer()
576 ADD_FAILURE() << "Timer unexpectedly fired."; in Run()
586 // if there is a pending timer not yet fired and |Timer::user_task_| owns the in TEST()
587 // timer. The test may only trigger exceptions if debug heap checking is in TEST()
595 // |Timer::user_task_| owns sole reference to |tester|. in TEST()
606 Timer timer(false, false); in TEST() local
607 EXPECT_FALSE(timer.IsRunning()); in TEST()
608 timer.Start(FROM_HERE, TimeDelta::FromDays(1), Bind(&TimerTestCallback)); in TEST()
609 EXPECT_TRUE(timer.IsRunning()); in TEST()
610 timer.Stop(); in TEST()
611 EXPECT_FALSE(timer.IsRunning()); in TEST()
612 EXPECT_TRUE(timer.user_task().is_null()); in TEST()
616 Timer timer(true, false); in TEST() local
618 EXPECT_FALSE(timer.IsRunning()); in TEST()
619 timer.Start(FROM_HERE, TimeDelta::FromDays(1), Bind(&TimerTestCallback)); in TEST()
620 EXPECT_TRUE(timer.IsRunning()); in TEST()
621 timer.Stop(); in TEST()
622 EXPECT_FALSE(timer.IsRunning()); in TEST()
623 ASSERT_FALSE(timer.user_task().is_null()); in TEST()
624 timer.Reset(); in TEST()
625 EXPECT_TRUE(timer.IsRunning()); in TEST()
630 Timer timer(false, false); in TEST() local
633 EXPECT_FALSE(timer.IsRunning()); in TEST()
634 timer.Start(FROM_HERE, TimeDelta::FromDays(1), Bind(&TimerTestCallback)); in TEST()
635 EXPECT_TRUE(timer.IsRunning()); in TEST()
637 EXPECT_FALSE(timer.IsRunning()); in TEST()
638 EXPECT_TRUE(timer.user_task().is_null()); in TEST()
643 Timer timer(FROM_HERE, TimeDelta::FromDays(1), Bind(&TimerTestCallback), in TEST() local
645 EXPECT_FALSE(timer.IsRunning()); in TEST()
646 timer.Reset(); in TEST()
647 EXPECT_TRUE(timer.IsRunning()); in TEST()
648 timer.Stop(); in TEST()
649 EXPECT_FALSE(timer.IsRunning()); in TEST()
650 timer.Reset(); in TEST()
651 EXPECT_TRUE(timer.IsRunning()); in TEST()
656 Timer timer(FROM_HERE, TimeDelta::FromDays(1), Bind(&TimerTestCallback), in TEST() local
658 EXPECT_FALSE(timer.IsRunning()); in TEST()
659 timer.Reset(); in TEST()
660 EXPECT_TRUE(timer.IsRunning()); in TEST()
661 timer.Stop(); in TEST()
662 EXPECT_FALSE(timer.IsRunning()); in TEST()
663 timer.Reset(); in TEST()
664 EXPECT_TRUE(timer.IsRunning()); in TEST()
695 Timer timer(false, false); in TEST() local
696 timer.Start(FROM_HERE, TimeDelta::FromMilliseconds(10), in TEST()
698 timer.Stop(); in TEST()
699 timer.Start(FROM_HERE, TimeDelta::FromMilliseconds(40), in TEST()
711 Timer timer(false, false); in TEST() local
712 timer.Start(FROM_HERE, TimeDelta::FromMilliseconds(10), in TEST()
714 timer.Reset(); in TEST()
716 ASSERT_FALSE(timer.user_task().is_null()); in TEST()
743 // Create the timer.
746 // Schedule an event on the timer.
755 // Tell the timer to abandon the task.
758 // Reset() to call Timer::AbandonScheduledTask() in AbandonTask()
769 // Delete the timer.
793 // Timer is created on this thread. in TEST_F()
804 // to |task_runner|. And since the Timer's task is one that posts back to this in TEST_F()
808 // Timer will be destroyed on this thread. in TEST_F()
816 // Timer is created on this thread. in TEST_F()
826 // Timer must be destroyed on pool thread, too. in TEST_F()
839 // Create timer on sequence #1. in TEST_F()
862 // Timer must be destroyed on the sequence it was scheduled from (#1). in TEST_F()
875 // Create timer on sequence #1. in TEST_F()
897 // Timer must be destroyed on the sequence it was scheduled from (#1). in TEST_F()