This test tests running headless but also letting it go into the runloop
(t *testing.T)
| 205 | |
| 206 | // This test tests running headless but also letting it go into the runloop |
| 207 | func TestRunHeadless(t *testing.T) { |
| 208 | testChan := make(chan struct{}) |
| 209 | go func() { |
| 210 | Run(RunOptions{ |
| 211 | HeadlessMode: true, |
| 212 | OverrideCloseAction: true, |
| 213 | }, &testRunScene{1}) |
| 214 | testChan <- struct{}{} |
| 215 | }() |
| 216 | select { |
| 217 | case <-testChan: |
| 218 | return |
| 219 | case <-time.After(1 * time.Second): |
| 220 | t.Error("Timed out while waiting for Headless Run to return from loop. Exit wasn't called within 1 second.") |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | func TestOverrideCloseAction(t *testing.T) { |
| 225 | var buf bytes.Buffer |