chrome/browser/chromeos/power/session_length_limiter_unittest.cc
// Creates a SessionLengthLimiter after setting a 60 second limit, allows 50
// seconds of session time to pass, then increases the limit to 90 seconds.
// Verifies that when the session time reaches the new 90 second limit, the
// session is terminated.
Creates a SessionLengthLimiter after setting a 60 second limit, allows 50
seconds of session time to pass, then increases the limit to 90 seconds.
Verifies that when the session time reaches the new 90 second limit, the
session is terminated.
Creates a SessionLengthLimiter after setting a 60 second limit allows 50 seconds of session time to pass then increases the limit to 90 seconds . Verifies that when the session time reaches the new 90 second limit the session is terminated .
TEST_F(SessionLengthLimiterTest, RunAndIncreaseSessionLengthLimit) {
  base::ThreadTaskRunnerHandle runner_handler(runner_);
  SetSessionLengthLimitPref(60 * 1000);  
  CreateSessionLengthLimiter(false);
  while (*remaining_ > kTenSeconds)
    VerifyTimerTick();
  SetSessionLengthLimitPref(90 * 1000);  
  while (*remaining_  > kZeroTimeDelta)
    VerifyTimerTick();
  ExpectStopSession();
  VerifyTimerTick();
}
TEST_F ( SessionLengthLimiterTest , RunAndIncreaseSessionLengthLimit ) { base :: ThreadTaskRunnerHandle runner_handler ( runner_ ) ; SetSessionLengthLimitPref ( 60 * 1000 ) ; CreateSessionLengthLimiter ( false ) ; while ( * remaining_ > kTenSeconds ) VerifyTimerTick ( ) ; SetSessionLengthLimitPref ( 90 * 1000 ) ; while ( * remaining_ > kZeroTimeDelta ) VerifyTimerTick ( ) ; ExpectStopSession ( ) ; VerifyTimerTick ( ) ; }
Creates a SessionLengthLimiter after setting a 60 second limit, allows 50
seconds of session time to pass, then increases the limit to 90 seconds.
Creates a SessionLengthLimiter after setting a 60 second limit allows 50 seconds of session time to pass then increases the limit to 90 seconds .
// Set a 60 second session time limit. // 60 seconds. // Create a SessionLengthLimiter. // Check timer ticks for 50 seconds of session time. // Increase the session length limit to 90 seconds. // 90 seconds. // Check timer ticks until the remaining session time reaches zero. // Check that the next timer tick leads to the session being terminated.