feat(chromium): add new omitBackground form field (closes #226)

This commit is contained in:
Julien Neuhart
2022-10-21 10:41:40 +02:00
parent 921b6b7ba4
commit f89726752f
4 changed files with 102 additions and 4 deletions

View File

@@ -667,6 +667,21 @@ func TestConvertURL(t *testing.T) {
expectHTTPErr: true,
expectHTTPStatus: http.StatusForbidden,
},
{
ctx: &api.ContextMock{Context: &api.Context{}},
api: func() API {
chromiumAPI := struct{ ProtoAPI }{}
chromiumAPI.pdf = func(_ context.Context, _ *zap.Logger, _, _ string, _ Options) error {
return ErrOmitBackgroundWithoutPrintBackground
}
return chromiumAPI
}(),
options: DefaultOptions(),
expectErr: true,
expectHTTPErr: true,
expectHTTPStatus: http.StatusForbidden,
},
{
ctx: &api.ContextMock{Context: &api.Context{}},
api: func() API {