Skip to content

Commit

Permalink
check the responseTime to remind us to remove the milliseconds workar…
Browse files Browse the repository at this point in the history
…ound
  • Loading branch information
ZekeLu committed Aug 5, 2023
1 parent ee5e968 commit 3454942
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions chromedp_test.go
Expand Up @@ -1329,6 +1329,16 @@ func TestRunResponse(t *testing.T) {
if want := test.wantStatus; want != 0 && status != want {
t.Fatalf("wanted status code %d, got %d", want, status)
}

if resp != nil {
latency := time.Since(resp.ResponseTime.Time())
if latency > time.Hour || latency < -time.Hour {
t.Errorf("responseTime does not hold a reasonable value %s. "+
"Maybe it's in seconds now and we should remove the workaround. "+
"See https://github.com/chromedp/pdlgen/issues/22.",
resp.ResponseTime.Time())
}
}
}
t.Run("Navigate"+test.name, func(t *testing.T) {
t.Parallel()
Expand Down

0 comments on commit 3454942

Please sign in to comment.