mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-22 05:19:03 +00:00
fix: add NoSandbox flag to chrome headless that is run during WASM tests, since
this is now required for Ubuntu 23+ and we are using Ubuntu 24+ when running Github Actions. See https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
@@ -33,8 +33,16 @@ func runargs(t *testing.T, args ...string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func chromectx(t *testing.T) context.Context {
|
func chromectx(t *testing.T) context.Context {
|
||||||
|
// see https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md
|
||||||
|
opts := append(chromedp.DefaultExecAllocatorOptions[:],
|
||||||
|
chromedp.NoSandbox,
|
||||||
|
)
|
||||||
|
|
||||||
|
allocCtx, cancel := chromedp.NewExecAllocator(context.Background(), opts...)
|
||||||
|
t.Cleanup(cancel)
|
||||||
|
|
||||||
// looks for locally installed Chrome
|
// looks for locally installed Chrome
|
||||||
ctx, ccancel := chromedp.NewContext(context.Background(), chromedp.WithErrorf(t.Errorf), chromedp.WithDebugf(t.Logf), chromedp.WithLogf(t.Logf))
|
ctx, ccancel := chromedp.NewContext(allocCtx, chromedp.WithErrorf(t.Errorf), chromedp.WithDebugf(t.Logf), chromedp.WithLogf(t.Logf))
|
||||||
t.Cleanup(ccancel)
|
t.Cleanup(ccancel)
|
||||||
|
|
||||||
// Wait for browser to be ready.
|
// Wait for browser to be ready.
|
||||||
|
|||||||
Reference in New Issue
Block a user