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

Side by Side Diff: go/src/infra/gae/libs/wrapper/memory/taskqueue_test.go

Issue 1143053004: Simplify memory package interface. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: switch to blasters Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « go/src/infra/gae/libs/wrapper/memory/taskqueue.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package memory 5 package memory
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 "infra/gae/libs/wrapper" 9 "infra/gae/libs/wrapper"
10 "math/rand" 10 "math/rand"
(...skipping 12 matching lines...) Expand all
23 23
24 Convey("TaskQueue", t, func() { 24 Convey("TaskQueue", t, func() {
25 now := time.Date(2000, time.January, 1, 1, 1, 1, 1, time.UTC) 25 now := time.Date(2000, time.January, 1, 1, 1, 1, 1, time.UTC)
26 timeNow := func(context.Context) time.Time { 26 timeNow := func(context.Context) time.Time {
27 ret := now 27 ret := now
28 now = now.Add(time.Second) 28 now = now.Add(time.Second)
29 return ret 29 return ret
30 } 30 }
31 c := wrapper.SetTimeNowFactory(context.Background(), timeNow) 31 c := wrapper.SetTimeNowFactory(context.Background(), timeNow)
32 c = wrapper.SetMathRand(c, rand.New(rand.NewSource(wrapper.GetTi meNow(c).UnixNano()))) 32 c = wrapper.SetMathRand(c, rand.New(rand.NewSource(wrapper.GetTi meNow(c).UnixNano())))
33 » » c = Use(Enable(c)) 33 » » c = Use(c)
34 34
35 tq := wrapper.GetTQ(c).(interface { 35 tq := wrapper.GetTQ(c).(interface {
36 wrapper.TQMultiReadWriter 36 wrapper.TQMultiReadWriter
37 wrapper.TQTestable 37 wrapper.TQTestable
38 }) 38 })
39 39
40 So(tq, ShouldNotBeNil) 40 So(tq, ShouldNotBeNil)
41 41
42 Convey("implements TQMultiReadWriter", func() { 42 Convey("implements TQMultiReadWriter", func() {
43 Convey("Add", func() { 43 Convey("Add", func() {
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 }() 463 }()
464 464
465 So(tq.GetScheduledTasks()["default"][tEnQ.Name], ShouldResemble, tEnQ) 465 So(tq.GetScheduledTasks()["default"][tEnQ.Name], ShouldResemble, tEnQ)
466 So(tq.GetTombstonedTasks()["default"][tEnQ2.Name ], ShouldResemble, tEnQ2) 466 So(tq.GetTombstonedTasks()["default"][tEnQ2.Name ], ShouldResemble, tEnQ2)
467 So(tq.GetTransactionTasks()["default"], ShouldBe Nil) 467 So(tq.GetTransactionTasks()["default"], ShouldBe Nil)
468 }) 468 })
469 469
470 }) 470 })
471 }) 471 })
472 } 472 }
OLDNEW
« no previous file with comments | « go/src/infra/gae/libs/wrapper/memory/taskqueue.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698