diff --git a/chromedp_test.go b/chromedp_test.go index cd343de..b36a7b8 100644 --- a/chromedp_test.go +++ b/chromedp_test.go @@ -33,16 +33,6 @@ func testAllocate(t *testing.T, path string) (_ context.Context, cancel func()) } } - //if err := WithLogf(t.Logf)(c.c); err != nil { - // t.Fatalf("could not set logf: %v", err) - //} - //if err := WithDebugf(t.Logf)(c.c); err != nil { - // t.Fatalf("could not set debugf: %v", err) - //} - //if err := WithErrorf(t.Errorf)(c.c); err != nil { - // t.Fatalf("could not set errorf: %v", err) - //} - return ctx, cancel } @@ -67,7 +57,7 @@ func TestMain(m *testing.M) { // start the browser browserCtx, _ = NewContext(allocCtx) - if err := Run(browserCtx, Tasks{}); err != nil { + if err := Run(browserCtx); err != nil { panic(err) } diff --git a/context.go b/context.go index 089fc18..e3a8514 100644 --- a/context.go +++ b/context.go @@ -81,14 +81,12 @@ func Run(ctx context.Context, actions ...Action) error { } func (c *Context) newSession(ctx context.Context) error { - create := target.CreateTarget("about:blank") - targetID, err := create.Do(ctx, c.Browser) + targetID, err := target.CreateTarget("about:blank").Do(ctx, c.Browser) if err != nil { return err } - attach := target.AttachToTarget(targetID) - sessionID, err := attach.Do(ctx, c.Browser) + sessionID, err := target.AttachToTarget(targetID).Do(ctx, c.Browser) if err != nil { return err }