Skip to content

Commit

Permalink
Make the doc for Timeout more clear (#567)
Browse files Browse the repository at this point in the history
  • Loading branch information
tooolbox authored Mar 25, 2022
1 parent a6e5ce7 commit 742c7ad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (b *Browser) GetContext() context.Context {
return b.ctx
}

// Timeout returns a clone with the specified timeout context.Context chained sub-operations
// Timeout returns a clone with the specified total timeout of all chained sub-operations
func (b *Browser) Timeout(d time.Duration) *Browser {
ctx, cancel := context.WithTimeout(b.ctx, d)
return b.Context(context.WithValue(ctx, timeoutContextKey{}, &timeoutContextVal{b.ctx, cancel}))
Expand Down Expand Up @@ -63,7 +63,7 @@ func (p *Page) GetContext() context.Context {
return p.ctx
}

// Timeout returns a clone with the specified timeout context.Context chained sub-operations
// Timeout returns a clone with the specified total timeout of all chained sub-operations
func (p *Page) Timeout(d time.Duration) *Page {
ctx, cancel := context.WithTimeout(p.ctx, d)
return p.Context(context.WithValue(ctx, timeoutContextKey{}, &timeoutContextVal{p.ctx, cancel}))
Expand Down Expand Up @@ -101,7 +101,7 @@ func (el *Element) GetContext() context.Context {
return el.ctx
}

// Timeout returns a clone with the specified timeout context.Context chained sub-operations
// Timeout returns a clone with the specified total timeout of all chained sub-operations
func (el *Element) Timeout(d time.Duration) *Element {
ctx, cancel := context.WithTimeout(el.ctx, d)
return el.Context(context.WithValue(ctx, timeoutContextKey{}, &timeoutContextVal{el.ctx, cancel}))
Expand Down

0 comments on commit 742c7ad

Please sign in to comment.