Add test to ClientResizeViewPort

This commit is contained in:
Jonathan Leibiusky @xetorthio
2017-05-26 10:20:27 -03:00
parent dfbf870383
commit 4353449df6
3 changed files with 67 additions and 0 deletions

View File

@@ -3,10 +3,18 @@ package pwd
import "net/http"
type mockBroadcast struct {
broadcastTo func(sessionId, eventName string, args ...interface{})
getHandler func() http.Handler
}
func (m *mockBroadcast) BroadcastTo(sessionId, eventName string, args ...interface{}) {
if m.broadcastTo != nil {
m.broadcastTo(sessionId, eventName, args...)
}
}
func (m *mockBroadcast) GetHandler() http.Handler {
if m.getHandler != nil {
return m.getHandler()
}
return nil
}