MCPcopy Create free account
hub / github.com/google/gapid / TestPostbackString

Function TestPostbackString

test/integration/replay/postback_test.go:87–114  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

85}
86
87func TestPostbackString(t *testing.T) {
88 expected := "γειά σου κόσμος"
89
90 done := make(chan struct{})
91
92 if doReplay(t, func(b *builder.Builder) {
93 ptr := b.String(expected)
94 b.Post(ptr, uint64(len(expected)), func(r binary.Reader, err error) {
95 defer close(done)
96 if err != nil {
97 t.Errorf("Postback returned error: %v", err)
98 return
99 }
100 data := make([]byte, len(expected))
101 r.Data(data)
102 err = r.Error()
103 if err != nil {
104 t.Errorf("Postback returned error: %v", err)
105 return
106 }
107 if expected != string(data) {
108 t.Errorf("Postback data was not as expected. Expected: %v. Got: %v", expected, data)
109 }
110 })
111 }) == nil {
112 <-done
113 }
114}
115
116func TestMultiPostback(t *testing.T) {
117 done := make(chan struct{})

Callers

nothing calls this directly

Calls 5

doReplayFunction · 0.70
StringMethod · 0.65
DataMethod · 0.65
ErrorMethod · 0.65
PostMethod · 0.45

Tested by

no test coverage detected