From 6fb5264bbd393b857e50a42f2c284fe5d4d524da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Wed, 20 Mar 2019 17:41:47 +0000 Subject: [PATCH] use DisableGPU in the tests On my i5-8350U, the option takes 'go test' from ~11s to ~10s, from a manual look over a few runs. --- chromedp_test.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/chromedp_test.go b/chromedp_test.go index 76e9877..8db5965 100644 --- a/chromedp_test.go +++ b/chromedp_test.go @@ -17,6 +17,7 @@ var ( NoFirstRun, NoDefaultBrowserCheck, Headless, + DisableGPU, } ) @@ -59,10 +60,6 @@ func TestMain(m *testing.M) { if noSandbox := os.Getenv("CHROMEDP_NO_SANDBOX"); noSandbox != "false" { allocOpts = append(allocOpts, NoSandbox) } - // must be explicitly set, as disabling gpu slows unit tests - if disableGPU := os.Getenv("CHROMEDP_DISABLE_GPU"); disableGPU != "" && disableGPU != "false" { - allocOpts = append(allocOpts, DisableGPU) - } ctx, cancel := NewAllocator(context.Background(), WithExecAllocator(allocOpts...)) allocCtx = ctx