Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(508)

Unified Diff: common/auth/localauth/server_test.go

Issue 2988263002: Fix mocked time in 'common/auth/localauth' tests. (Closed)
Patch Set: doh Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « common/auth/localauth/ctx_test.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: common/auth/localauth/server_test.go
diff --git a/common/auth/localauth/server_test.go b/common/auth/localauth/server_test.go
index 2ba181a7fbce00be58e684d8eca3c2c83febf0b2..bcb25ccfa39147e083601351384bf1f5c5df0d52 100644
--- a/common/auth/localauth/server_test.go
+++ b/common/auth/localauth/server_test.go
@@ -95,7 +95,7 @@ func TestProtocol(t *testing.T) {
t.Parallel()
ctx := context.Background()
- ctx, _ = testclock.UseTime(ctx, testclock.TestRecentTimeLocal)
+ ctx, _ = testclock.UseTime(ctx, testclock.TestRecentTimeUTC)
Convey("With server", t, func(c C) {
// Use channels to pass mocked requests/responses back and forth.
@@ -157,7 +157,7 @@ func TestProtocol(t *testing.T) {
AccessToken: "tok1",
Expiry: clock.Now(ctx).Add(30 * time.Minute),
}
- So(call(goodRequest()), ShouldEqual, `HTTP 200 (json): {"access_token":"tok1","expiry":1454502906}`)
+ So(call(goodRequest()), ShouldEqual, `HTTP 200 (json): {"access_token":"tok1","expiry":1454474106}`)
So(<-requests, ShouldResemble, []string{"A", "B"})
// application/json is also the default.
@@ -167,7 +167,7 @@ func TestProtocol(t *testing.T) {
AccessToken: "tok2",
Expiry: clock.Now(ctx).Add(30 * time.Minute),
}
- So(call(req), ShouldEqual, `HTTP 200 (json): {"access_token":"tok2","expiry":1454502906}`)
+ So(call(req), ShouldEqual, `HTTP 200 (json): {"access_token":"tok2","expiry":1454474106}`)
So(<-requests, ShouldResemble, []string{"A", "B"})
})
« no previous file with comments | « common/auth/localauth/ctx_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698