Commit 2c6be442 authored by Xiaohui Chen's avatar Xiaohui Chen Committed by Commit Bot

ambient: update unittest delay

Token refresh unitest has a delay that's too long. It causes many
screen refreshes and makes the unittest run very slow.

R=wutao@chromium.org

Bug: None
Change-Id: Ic93fdc6a97a4125dff42be077d99ca197cc94b3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2327273Reviewed-by: default avatarTao Wu <wutao@chromium.org>
Commit-Queue: Xiaohui Chen <xiaohuic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#792890}
parent 0eabe530
...@@ -22,13 +22,6 @@ ...@@ -22,13 +22,6 @@
namespace ash { namespace ash {
namespace {
constexpr base::TimeDelta kDefaultTokenExpirationDelay =
base::TimeDelta::FromHours(1);
} // namespace
using AmbientControllerTest = AmbientAshTestBase; using AmbientControllerTest = AmbientAshTestBase;
TEST_F(AmbientControllerTest, ShowAmbientScreenUponLock) { TEST_F(AmbientControllerTest, ShowAmbientScreenUponLock) {
...@@ -133,9 +126,10 @@ TEST_F(AmbientControllerTest, ShouldRefreshAccessTokenAfterFailure) { ...@@ -133,9 +126,10 @@ TEST_F(AmbientControllerTest, ShouldRefreshAccessTokenAfterFailure) {
EXPECT_FALSE(IsAccessTokenRequestPending()); EXPECT_FALSE(IsAccessTokenRequestPending());
// Token request automatically retry. // Token request automatically retry.
// The failure delay has jitter so fast forward a bit more, but before // The failure delay has jitter so fast forward a bit more.
// the returned token would expire again. constexpr base::TimeDelta kMaxTokenRefreshDelay =
task_environment()->FastForwardBy(kDefaultTokenExpirationDelay / 2); base::TimeDelta::FromSeconds(60);
task_environment()->FastForwardBy(kMaxTokenRefreshDelay * 2);
EXPECT_TRUE(IsAccessTokenRequestPending()); EXPECT_TRUE(IsAccessTokenRequestPending());
// Clean up. // Clean up.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment