Skip to content

Commit

Permalink
make sure the tcp connection breaks
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmood committed Oct 16, 2022
1 parent 647d5da commit 00913ce
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion page_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,16 @@ func TestPageCloseErr(t *testing.T) {
func TestPageCloseWhenNotAttached(t *testing.T) {
g := setup(t)

r := g.Serve()
r.Mux.Handle("/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
hj, _ := w.(http.Hijacker)
h, _, _ := hj.Hijack()
_ = h.Close()
}))

p := g.browser.MustPage(g.blank())

_ = p.Navigate("http://not-exists")
_ = p.Navigate(r.URL())

g.E(p.Close())
}
Expand Down

0 comments on commit 00913ce

Please sign in to comment.