41 MockTimerScheduler scheduler;
42 EXPECT_CALL(scheduler, SetTimer(100, _))
43 .WillOnce(DoAll(SaveArg<1>(&fn1), Return(1001)));
44 EXPECT_CALL(scheduler, SetTimer(200, _))
45 .WillOnce(DoAll(SaveArg<1>(&fn2), Return(1002)));
46 EXPECT_CALL(scheduler, KillTimer(1001));
47 EXPECT_CALL(scheduler, KillTimer(1002));
49 MockTimerCallback cb1;
50 EXPECT_CALL(cb1, OnTimerFired()).Times(1);
52 MockTimerCallback cb2;
53 EXPECT_CALL(cb2, OnTimerFired()).Times(2);
55 auto timer1 =
std::make_unique<
CFX_Timer>(&scheduler, &cb1, 100);
56 auto timer2 =
std::make_unique<
CFX_Timer>(&scheduler, &cb2, 200);
57 EXPECT_TRUE(timer1->HasValidID());
58 EXPECT_TRUE(timer2->HasValidID());
71 MockTimerScheduler scheduler;
72 EXPECT_CALL(scheduler, SetTimer(100, _))
73 .WillOnce(DoAll(SaveArg<1>(&fn1), Return(1001)));
74 EXPECT_CALL(scheduler, KillTimer(1001));
76 MockTimerCallback cb1;
77 EXPECT_CALL(cb1, OnTimerFired()).Times(0);
80 auto timer1 =
std::make_unique<
CFX_Timer>(&scheduler, &cb1, 100);
81 EXPECT_TRUE(timer1->HasValidID());