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

Side by Side Diff: logdog/client/butler/butler_test.go

Issue 2737603003: Butler stream servers can generate client address. (Closed)
Patch Set: better comment Created 3 years, 9 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 | « no previous file | logdog/client/butler/streamserver/base.go » ('j') | 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 LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package butler 5 package butler
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "errors" 9 "errors"
10 "fmt" 10 "fmt"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 onNext func() 186 onNext func()
187 streamC chan *testStream 187 streamC chan *testStream
188 } 188 }
189 189
190 func newTestStreamServer() *testStreamServer { 190 func newTestStreamServer() *testStreamServer {
191 return &testStreamServer{ 191 return &testStreamServer{
192 streamC: make(chan *testStream), 192 streamC: make(chan *testStream),
193 } 193 }
194 } 194 }
195 195
196 func (tss *testStreamServer) Listen() error { 196 func (tss *testStreamServer) Address() string { return "test" }
197 » return tss.err 197
198 } 198 func (tss *testStreamServer) Listen() error { return tss.err }
199 199
200 func (tss *testStreamServer) Next() (io.ReadCloser, *streamproto.Properties) { 200 func (tss *testStreamServer) Next() (io.ReadCloser, *streamproto.Properties) {
201 if tss.onNext != nil { 201 if tss.onNext != nil {
202 tss.onNext() 202 tss.onNext()
203 } 203 }
204 204
205 ts, ok := <-tss.streamC 205 ts, ok := <-tss.streamC
206 if !ok { 206 if !ok {
207 return nil, nil 207 return nil, nil
208 } 208 }
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 tss.onNext = func() { 598 tss.onNext = func() {
599 panic("test panic") 599 panic("test panic")
600 } 600 }
601 601
602 b := mkb(c, conf) 602 b := mkb(c, conf)
603 b.AddStreamServer(tss) 603 b.AddStreamServer(tss)
604 So(b.Wait(), ShouldErrLike, "test panic") 604 So(b.Wait(), ShouldErrLike, "test panic")
605 }) 605 })
606 }) 606 })
607 } 607 }
OLDNEW
« no previous file with comments | « no previous file | logdog/client/butler/streamserver/base.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698