Skip to content

Commit

Permalink
Add BrowserPool TryGet test
Browse files Browse the repository at this point in the history
  • Loading branch information
bestmountain committed Apr 30, 2024
1 parent 93a60a7 commit 95cc251
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions browser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,23 @@ func TestBrowserPool(_ *testing.T) {
})
}

func TestBrowserPool_TryGet(t *testing.T) {
pool := rod.NewBrowserPool(3)
create := func() (*rod.Browser, error) {
b := rod.New()
err := b.Connect()
return b, err
}
b, err := pool.TryGet(create)
if err != nil {
t.Fatal(err)
}
pool.Put(b)
pool.Cleanup(func(p *rod.Browser) {
p.MustClose()
})
}

func TestOldBrowser(t *testing.T) {
t.Skip()

Expand Down

0 comments on commit 95cc251

Please sign in to comment.