Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit 7f17113

Browse files
committed
Reformat duration for consistency
Resolves: #647 (comment)
1 parent 31365bd commit 7f17113

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

tests/lifecycle_wait_test.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func TestLifecycleWaitForNavigation(t *testing.T) {
5858
}{
5959
{
6060
name: "load",
61-
pingSlowness: time.Millisecond * 100,
61+
pingSlowness: 100 * time.Millisecond,
6262
pingJSSlow: false,
6363
waitUntil: common.LifecycleEventLoad,
6464
pingRequestTextAssert: func(result string, pingCount int) {
@@ -70,7 +70,7 @@ func TestLifecycleWaitForNavigation(t *testing.T) {
7070
},
7171
{
7272
name: "domcontentloaded",
73-
pingSlowness: time.Millisecond * 100,
73+
pingSlowness: 100 * time.Millisecond,
7474
pingJSSlow: true,
7575
waitUntil: common.LifecycleEventDOMContentLoad,
7676
pingRequestTextAssert: func(result string, pingCount int) {
@@ -216,7 +216,7 @@ func TestLifecycleWaitForLoadState(t *testing.T) {
216216
}{
217217
{
218218
name: "load",
219-
pingSlowness: time.Millisecond * 100,
219+
pingSlowness: 100 * time.Millisecond,
220220
pingJSSlow: false,
221221
waitUntil: common.LifecycleEventLoad,
222222
pingRequestTextAssert: func(result string) {
@@ -228,7 +228,7 @@ func TestLifecycleWaitForLoadState(t *testing.T) {
228228
},
229229
{
230230
name: "domcontentloaded",
231-
pingSlowness: time.Millisecond * 100,
231+
pingSlowness: 100 * time.Millisecond,
232232
pingJSSlow: true,
233233
waitUntil: common.LifecycleEventDOMContentLoad,
234234
pingRequestTextAssert: func(result string) {
@@ -260,7 +260,7 @@ func TestLifecycleWaitForLoadState(t *testing.T) {
260260
// so that we wait until networkidle is received from
261261
// the browser -- not relying on the persisted state in memory.
262262
name: "domcontentloaded then networkidle",
263-
pingSlowness: time.Millisecond * 100,
263+
pingSlowness: 100 * time.Millisecond,
264264
pingJSSlow: false,
265265
waitUntil: common.LifecycleEventDOMContentLoad,
266266
assertFunc: func(p api.Page) {
@@ -331,7 +331,7 @@ func TestLifecycleReload(t *testing.T) {
331331
}{
332332
{
333333
name: "load",
334-
pingSlowness: time.Millisecond * 100,
334+
pingSlowness: 100 * time.Millisecond,
335335
pingJSSlow: false,
336336
waitUntil: common.LifecycleEventLoad,
337337
pingRequestTextAssert: func(result string, pingCount int) {
@@ -343,7 +343,7 @@ func TestLifecycleReload(t *testing.T) {
343343
},
344344
{
345345
name: "domcontentloaded",
346-
pingSlowness: time.Millisecond * 100,
346+
pingSlowness: 100 * time.Millisecond,
347347
pingJSSlow: true,
348348
waitUntil: common.LifecycleEventDOMContentLoad,
349349
pingRequestTextAssert: func(result string, pingCount int) {
@@ -424,7 +424,7 @@ func TestLifecycleGotoWithSubFrame(t *testing.T) {
424424
}{
425425
{
426426
name: "load",
427-
pingSlowness: time.Millisecond * 100,
427+
pingSlowness: 100 * time.Millisecond,
428428
pingJSSlow: false,
429429
waitUntil: common.LifecycleEventLoad,
430430
pingRequestTextAssert: func(result string) {
@@ -436,7 +436,7 @@ func TestLifecycleGotoWithSubFrame(t *testing.T) {
436436
},
437437
{
438438
name: "domcontentloaded",
439-
pingSlowness: time.Millisecond * 100,
439+
pingSlowness: 100 * time.Millisecond,
440440
pingJSSlow: true,
441441
waitUntil: common.LifecycleEventDOMContentLoad,
442442
pingRequestTextAssert: func(result string) {
@@ -505,7 +505,7 @@ func TestLifecycleGoto(t *testing.T) {
505505
}{
506506
{
507507
name: "load",
508-
pingSlowness: time.Millisecond * 100,
508+
pingSlowness: 100 * time.Millisecond,
509509
pingJSSlow: false,
510510
waitUntil: common.LifecycleEventLoad,
511511
pingRequestTextAssert: func(result string) {
@@ -517,7 +517,7 @@ func TestLifecycleGoto(t *testing.T) {
517517
},
518518
{
519519
name: "domcontentloaded",
520-
pingSlowness: time.Millisecond * 100,
520+
pingSlowness: 100 * time.Millisecond,
521521
pingJSSlow: true,
522522
waitUntil: common.LifecycleEventDOMContentLoad,
523523
pingRequestTextAssert: func(result string) {
@@ -591,7 +591,7 @@ func TestLifecycleGotoNetworkIdle(t *testing.T) {
591591

592592
withHomeHandler(t, tb, "prolonged_network_idle.html")
593593
ch := make(chan bool)
594-
withPingHandler(t, tb, time.Millisecond*50, ch)
594+
withPingHandler(t, tb, 50*time.Millisecond, ch)
595595
withPingJSHandler(t, tb, false, ch, false)
596596

597597
assertHome(t, tb, p, common.LifecycleEventNetworkIdle, func() testPromise {
@@ -612,7 +612,7 @@ func TestLifecycleGotoNetworkIdle(t *testing.T) {
612612
p := tb.NewPage(nil)
613613

614614
withHomeHandler(t, tb, "prolonged_network_idle_10.html")
615-
withPingHandler(t, tb, time.Millisecond*50, nil)
615+
withPingHandler(t, tb, 50*time.Millisecond, nil)
616616

617617
assertHome(t, tb, p, common.LifecycleEventNetworkIdle, func() testPromise {
618618
result := p.TextContent("#pingRequestText", nil)

0 commit comments

Comments
 (0)