Lines Matching refs:cb
245 CountingCallback cb(mDispatch); in TEST_F() local
247 mDispatch->schedule(cb, in TEST_F()
259 CountingCallback cb(mDispatch); in TEST_F() local
261 mDispatch->schedule(cb, in TEST_F()
269 ASSERT_THAT(cb.mCalls.size(), Eq(1)); in TEST_F()
270 EXPECT_THAT(cb.mCalls[0], Eq(mPeriod)); in TEST_F()
279 CountingCallback cb(mDispatch); in TEST_F() local
281 mDispatch->schedule(cb, in TEST_F()
288 mDispatch->update(cb, {.workDuration = 300, .readyDuration = 0, .lastVsync = intended}); in TEST_F()
295 ASSERT_THAT(cb.mCalls.size(), Eq(1)); in TEST_F()
296 EXPECT_THAT(cb.mCalls[0], Eq(mPeriod)); in TEST_F()
297 EXPECT_THAT(cb.mWakeupTime[0], Eq(700)); in TEST_F()
304 CountingCallback cb(mDispatch); in TEST_F() local
306 mDispatch->update(cb, {.workDuration = 300, .readyDuration = 0, .lastVsync = intended}); in TEST_F()
316 CountingCallback cb(mDispatch); in TEST_F() local
317 mDispatch->schedule(cb, {.workDuration = 100, .readyDuration = 0, .lastVsync = mPeriod}); in TEST_F()
320 ASSERT_THAT(cb.mCalls.size(), Eq(1)); in TEST_F()
321 EXPECT_THAT(cb.mCalls[0], Eq(1150)); in TEST_F()
333 CountingCallback cb(mDispatch); in TEST_F() local
334 const auto result = mDispatch->schedule(cb, in TEST_F()
347 CountingCallback cb(mDispatch); in TEST_F() local
349 mDispatch->schedule(cb, in TEST_F()
354 EXPECT_EQ(mDispatch->cancel(cb), CancelResult::Cancelled); in TEST_F()
361 CountingCallback cb(mDispatch); in TEST_F() local
363 mDispatch->schedule(cb, in TEST_F()
369 EXPECT_EQ(mDispatch->cancel(cb), CancelResult::TooLate); in TEST_F()
376 PausingCallback cb(mDispatch, std::chrono::duration_cast<std::chrono::milliseconds>(1s)); in TEST_F() local
378 mDispatch->schedule(cb, in TEST_F()
385 EXPECT_TRUE(cb.waitForPause()); in TEST_F()
386 EXPECT_EQ(mDispatch->cancel(cb), CancelResult::TooLate); in TEST_F()
387 cb.unpause(); in TEST_F()
397 PausingCallback cb(mDispatch, 50ms); in TEST_F() local
398 cb.stashResource(resource); in TEST_F()
400 mDispatch->schedule(cb, in TEST_F()
407 EXPECT_TRUE(cb.waitForPause()); in TEST_F()
409 cb.unregister(); in TEST_F()
412 cb.unpause(); in TEST_F()
415 EXPECT_TRUE(cb.resourcePresent()); in TEST_F()
460 CountingCallback cb(mDispatch); in TEST_F() local
462 mDispatch->schedule(cb, {.workDuration = 100, .readyDuration = 0, .lastVsync = 0}); in TEST_F()
466 ASSERT_THAT(cb.mCalls.size(), Eq(1)); in TEST_F()
467 EXPECT_THAT(cb.mCalls[0], Eq(1000)); in TEST_F()
469 mDispatch->schedule(cb, {.workDuration = 100, .readyDuration = 0, .lastVsync = 1000}); in TEST_F()
473 ASSERT_THAT(cb.mCalls.size(), Eq(2)); in TEST_F()
474 EXPECT_THAT(cb.mCalls[1], Eq(2000)); in TEST_F()
476 mDispatch->schedule(cb, {.workDuration = 100, .readyDuration = 0, .lastVsync = 2000}); in TEST_F()
480 ASSERT_THAT(cb.mCalls.size(), Eq(3)); in TEST_F()
481 EXPECT_THAT(cb.mCalls[2], Eq(4000)); in TEST_F()
593 CountingCallback cb(mDispatch); in TEST_F() local
594 mDispatch->schedule(cb, {.workDuration = 100, .readyDuration = 0, .lastVsync = 920}); in TEST_F()
597 EXPECT_THAT(cb.mCalls.size(), Eq(1)); in TEST_F()
599 mDispatch->schedule(cb, {.workDuration = 100, .readyDuration = 0, .lastVsync = 1900}); in TEST_F()
601 EXPECT_THAT(cb.mCalls.size(), Eq(1)); in TEST_F()
603 EXPECT_THAT(cb.mCalls.size(), Eq(2)); in TEST_F()
605 mDispatch->schedule(cb, {.workDuration = 100, .readyDuration = 0, .lastVsync = 2900}); in TEST_F()
607 EXPECT_THAT(cb.mCalls.size(), Eq(3)); in TEST_F()
672 CountingCallback cb(mDispatch); in TEST_F() local
673 mDispatch->schedule(cb, {.workDuration = 0, .readyDuration = 0, .lastVsync = 1000}); in TEST_F()
676 mDispatch->schedule(cb, {.workDuration = 50, .readyDuration = 0, .lastVsync = 1000}); in TEST_F()
679 mDispatch->schedule(cb, {.workDuration = 50, .readyDuration = 0, .lastVsync = 2000}); in TEST_F()
682 mDispatch->schedule(cb, {.workDuration = 100, .readyDuration = 0, .lastVsync = 2000}); in TEST_F()
754 CountingCallback cb(mDispatch); in TEST_F() local
756 mDispatch->schedule(cb, {.workDuration = 500, .readyDuration = 0, .lastVsync = 1000}); in TEST_F()
762 result = mDispatch->schedule(cb, {.workDuration = 800, .readyDuration = 0, .lastVsync = 1000}); in TEST_F()
768 ASSERT_THAT(cb.mCalls.size(), Eq(1)); in TEST_F()
778 CountingCallback cb(mDispatch); in TEST_F() local
780 mDispatch->schedule(cb, {.workDuration = 500, .readyDuration = 0, .lastVsync = 1000}); in TEST_F()
786 result = mDispatch->schedule(cb, {.workDuration = 800, .readyDuration = 0, .lastVsync = 1000}); in TEST_F()
792 ASSERT_THAT(cb.mCalls.size(), Eq(1)); in TEST_F()
801 CountingCallback cb(mDispatch); in TEST_F() local
803 mDispatch->schedule(cb, {.workDuration = 500, .readyDuration = 0, .lastVsync = 1000}); in TEST_F()
808 result = mDispatch->schedule(cb, {.workDuration = 400, .readyDuration = 0, .lastVsync = 1000}); in TEST_F()
852 CountingCallback cb(mDispatch); in TEST_F() local
854 mDispatch->schedule(cb, {.workDuration = 400, .readyDuration = 0, .lastVsync = 1000}); in TEST_F()
859 result = mDispatch->schedule(cb, {.workDuration = 1400, .readyDuration = 0, .lastVsync = 1000}); in TEST_F()
874 CountingCallback cb(mDispatch); in TEST_F() local
876 mDispatch->schedule(cb, {.workDuration = 400, .readyDuration = 0, .lastVsync = 1000}); in TEST_F()
881 result = mDispatch->schedule(cb, {.workDuration = 1400, .readyDuration = 0, .lastVsync = 1000}); in TEST_F()
893 VSyncCallbackRegistration cb( in TEST_F() local
895 VSyncCallbackRegistration cb1(std::move(cb)); in TEST_F()
896 cb.schedule({.workDuration = 100, .readyDuration = 0, .lastVsync = 1000}); in TEST_F()
897 cb.cancel(); in TEST_F()
907 VSyncCallbackRegistration cb( in TEST_F() local
911 cb1 = std::move(cb); in TEST_F()
912 cb.schedule({.workDuration = 100, .readyDuration = 0, .lastVsync = 1000}); in TEST_F()
913 cb.cancel(); in TEST_F()
955 CountingCallback cb(mDispatch); in TEST_F() local
958 mDispatch->schedule(cb, {.workDuration = 400, .readyDuration = 0, .lastVsync = 1000}); in TEST_F()
966 result = mDispatch->schedule(cb, {.workDuration = 370, .readyDuration = 0, .lastVsync = 2000}); in TEST_F()
972 EXPECT_THAT(cb.mCalls.size(), Eq(1)); in TEST_F()
984 CountingCallback cb(mDispatch); in TEST_F() local
987 mDispatch->schedule(cb, {.workDuration = 400, .readyDuration = 0, .lastVsync = 1000}); in TEST_F()
995 result = mDispatch->schedule(cb, {.workDuration = 370, .readyDuration = 0, .lastVsync = 2000}); in TEST_F()
1001 ASSERT_EQ(1, cb.mCalls.size()); in TEST_F()
1002 EXPECT_EQ(1000, cb.mCalls[0]); in TEST_F()
1004 ASSERT_EQ(1, cb.mWakeupTime.size()); in TEST_F()
1005 EXPECT_EQ(600, cb.mWakeupTime[0]); in TEST_F()
1110 CountingCallback cb(mDispatch); in TEST_F() local
1112 mDispatch->schedule(cb, in TEST_F()
1119 ASSERT_THAT(cb.mCalls.size(), Eq(1)); in TEST_F()
1120 EXPECT_THAT(cb.mCalls[0], Eq(mPeriod)); in TEST_F()
1121 ASSERT_THAT(cb.mWakeupTime.size(), Eq(1)); in TEST_F()
1122 EXPECT_THAT(cb.mWakeupTime[0], 900); in TEST_F()
1123 ASSERT_THAT(cb.mReadyTime.size(), Eq(1)); in TEST_F()
1124 EXPECT_THAT(cb.mReadyTime[0], 970); in TEST_F()
1133 CountingCallback cb(mDispatch); in TEST_F() local
1135 mDispatch->schedule(cb, {.workDuration = 400, .readyDuration = 0, .lastVsync = 1000}); in TEST_F()
1136 mDispatch->schedule(cb, {.workDuration = 1400, .readyDuration = 0, .lastVsync = 1000}); in TEST_F()
1142 ASSERT_THAT(cb.mCalls.size(), Eq(1)); in TEST_F()
1143 EXPECT_THAT(cb.mCalls[0], Eq(2000)); in TEST_F()
1144 ASSERT_THAT(cb.mWakeupTime.size(), Eq(1)); in TEST_F()
1145 EXPECT_THAT(cb.mWakeupTime[0], Eq(600)); in TEST_F()
1146 ASSERT_THAT(cb.mReadyTime.size(), Eq(1)); in TEST_F()
1147 EXPECT_THAT(cb.mReadyTime[0], Eq(2000)); in TEST_F()
1157 CountingCallback cb(mDispatch); in TEST_F() local
1159 mDispatch->schedule(cb, {.workDuration = 400, .readyDuration = 0, .lastVsync = 1000}); in TEST_F()
1160 mDispatch->schedule(cb, {.workDuration = 1400, .readyDuration = 0, .lastVsync = 1000}); in TEST_F()
1166 ASSERT_THAT(cb.mCalls.size(), Eq(1)); in TEST_F()
1167 EXPECT_THAT(cb.mCalls[0], Eq(1000)); in TEST_F()
1168 ASSERT_THAT(cb.mWakeupTime.size(), Eq(1)); in TEST_F()
1169 EXPECT_THAT(cb.mWakeupTime[0], Eq(0)); in TEST_F()
1170 ASSERT_THAT(cb.mReadyTime.size(), Eq(1)); in TEST_F()
1171 EXPECT_THAT(cb.mReadyTime[0], Eq(1000)); in TEST_F()
1178 CountingCallback cb(mDispatch); in TEST_F() local
1180 mDispatch->schedule(cb, {.workDuration = 500, .readyDuration = 0, .lastVsync = 1000}); in TEST_F()
1186 result = mDispatch->schedule(cb, {.workDuration = 800, .readyDuration = 0, .lastVsync = 1000}); in TEST_F()
1192 ASSERT_THAT(cb.mCalls.size(), Eq(1)); in TEST_F()
1201 CountingCallback cb(mDispatch); in TEST_F() local
1203 mDispatch->schedule(cb, {.workDuration = 500, .readyDuration = 0, .lastVsync = 1000}); in TEST_F()
1209 result = mDispatch->schedule(cb, {.workDuration = 800, .readyDuration = 0, .lastVsync = 1000}); in TEST_F()
1215 ASSERT_THAT(cb.mCalls.size(), Eq(1)); in TEST_F()
1216 EXPECT_THAT(cb.mCalls[0], Eq(1000)); in TEST_F()
1217 ASSERT_THAT(cb.mWakeupTime.size(), Eq(1)); in TEST_F()
1218 EXPECT_THAT(cb.mWakeupTime[0], Eq(300)); in TEST_F()
1219 ASSERT_THAT(cb.mReadyTime.size(), Eq(1)); in TEST_F()
1220 EXPECT_THAT(cb.mReadyTime[0], Eq(1000)); in TEST_F()