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 decreases the limit to 40 seconds.
// Verifies that when the limit is decreased to 40 seconds after 50 seconds of
// session time have passed, the next timer tick causes the session to be
// terminated.
Creates a SessionLengthLimiter after setting a 60 second limit, allows 50
seconds of session time to pass, then decreases the limit to 40 seconds.
Verifies that when the limit is decreased to 40 seconds after 50 seconds of
session time have passed, the next timer tick causes the session to be
terminated.
Creates a SessionLengthLimiter after setting a 60 second limit allows 50 seconds of session time to pass then decreases the limit to 40 seconds . Verifies that when the limit is decreased to 40 seconds after 50 seconds of session time have passed the next timer tick causes the session to be terminated .
TEST_F(SessionLengthLimiterTest, RunAndDecreaseSessionLengthLimit) {
  base::ThreadTaskRunnerHandle runner_handler(runner_);
  SetSessionLengthLimitPref(60 * 1000);  
  CreateSessionLengthLimiter(false);
  while (*remaining_ > kTenSeconds)
    VerifyTimerTick();
  SetSessionLengthLimitPref(40 * 1000);  
  ExpectStopSession();
  VerifyTimerTick();
}
TEST_F ( SessionLengthLimiterTest , RunAndDecreaseSessionLengthLimit ) { base :: ThreadTaskRunnerHandle runner_handler ( runner_ ) ; SetSessionLengthLimitPref ( 60 * 1000 ) ; CreateSessionLengthLimiter ( false ) ; while ( * remaining_ > kTenSeconds ) VerifyTimerTick ( ) ; SetSessionLengthLimitPref ( 40 * 1000 ) ; ExpectStopSession ( ) ; VerifyTimerTick ( ) ; }
Creates a SessionLengthLimiter after setting a 60 second limit, allows 50
seconds of session time to pass, then decreases the limit to 40 seconds.
Creates a SessionLengthLimiter after setting a 60 second limit allows 50 seconds of session time to pass then decreases the limit to 40 seconds .
// Set a 60 second session time limit. // 60 seconds. // Create a SessionLengthLimiter. // Check timer ticks for 50 seconds of session time. // Reduce the session length limit below the 50 seconds that have already // elapsed. // 40 seconds. // Check that the next timer tick causes the session to be terminated.