feat(chromium): add emulated media type

This commit is contained in:
Julien Neuhart
2021-11-22 16:55:24 +01:00
parent ed47493459
commit dd1e11f102
5 changed files with 106 additions and 0 deletions

View File

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