Tests: two setups follow the gate's pictures and the presenter's cookie
TestPressBeforeTheTalkLoadsKeepsTheSlideOnScreen held the talk 1.5 s, but the window's first paint now waits up to 3.5 s for Next's picture, so the talk was in before the press: it is held 5 s. The stale-answer race's watcher was the browser signed in as the presenter, whose cookie now drives a talk begun before positions: the watcher's browser has no cookies.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+8
−1
internal/slidestest/presenter_moves_browser_test.go+4 −1internal/slidestest/races_browser_test.go+4 −0
diff --git a/internal/slidestest/presenter_moves_browser_test.go b/internal/slidestest/presenter_moves_browser_test.go| index 46015bb..57949d8 100644 |
| --- a/internal/slidestest/presenter_moves_browser_test.go |
| +++ b/internal/slidestest/presenter_moves_browser_test.go |
| @@ -544,10 +544,13 @@ func TestPressBeforeTheTalkLoadsKeepsTheSlideOnScreen(t *testing.T) { |
| mt := newMovesTalk(t) |
| mt.gotoSlide(t, 2) |
| ctx := mt.fr.rig.Context() |
| + // The talk later than the window's first paint, which waits for |
| + // Next's picture up to 3.5 s (the font gate), so the press is made |
| + // while the talk is still on its way. |
| hold := func(r *http.Request) { |
| switch { |
| case strings.HasSuffix(r.URL.Path, "/talk"): |
| - time.Sleep(1500 * time.Millisecond) |
| + time.Sleep(5 * time.Second) |
| case strings.Contains(r.URL.Path, "/assets/"): |
| time.Sleep(3 * time.Second) |
| } |
diff --git a/internal/slidestest/races_browser_test.go b/internal/slidestest/races_browser_test.go| index d7c457b..e6517e3 100644 |
| --- a/internal/slidestest/races_browser_test.go |
| +++ b/internal/slidestest/races_browser_test.go |
| @@ -273,6 +273,10 @@ func TestTheProjectorIgnoresAStaleAnswer(t *testing.T) { |
| path := "/p/" + session |
| if c.page == "token" { |
| path += "?t=" + token |
| + } else { |
| + // A watcher is nobody signed in: the presenter's own |
| + // cookie drives even a talk begun before positions. |
| + fr.rig.Run(network.ClearBrowserCookies()) |
| } |
| fr.rig.Run(fr.navigate(path)) |
| fr.shown(t) |