fix: chromium memory leaks (#705)

This commit is contained in:
Julien Neuhart
2023-10-23 17:52:30 +02:00
committed by GitHub
parent b5a59e4de0
commit 54daac329e
71 changed files with 4248 additions and 51761 deletions

View File

@@ -29,7 +29,7 @@ func TestLibreOffice_Provision(t *testing.T) {
{
name: "nominal behavior",
ctx: func() *gotenberg.Context {
provider1 := struct {
provider1 := &struct {
gotenberg.ModuleMock
uno.ProviderMock
}{}
@@ -42,7 +42,7 @@ func TestLibreOffice_Provision(t *testing.T) {
return uno.APIMock{}, nil
}
provider2 := struct {
provider2 := &struct {
gotenberg.ModuleMock
gotenberg.PDFEngineProviderMock
}{}
@@ -52,7 +52,7 @@ func TestLibreOffice_Provision(t *testing.T) {
}}
}
provider2.PDFEngineMock = func() (gotenberg.PDFEngine, error) {
return gotenberg.PDFEngineMock{}, nil
return &gotenberg.PDFEngineMock{}, nil
}
return gotenberg.NewContext(
@@ -79,7 +79,7 @@ func TestLibreOffice_Provision(t *testing.T) {
{
name: "no API from UNO API provider",
ctx: func() *gotenberg.Context {
provider := struct {
provider := &struct {
gotenberg.ModuleMock
uno.ProviderMock
}{}
@@ -106,7 +106,7 @@ func TestLibreOffice_Provision(t *testing.T) {
{
name: "no PDF engine provider",
ctx: func() *gotenberg.Context {
provider := struct {
provider := &struct {
gotenberg.ModuleMock
uno.ProviderMock
}{}
@@ -133,7 +133,7 @@ func TestLibreOffice_Provision(t *testing.T) {
{
name: "no PDF engine from PDF engine provider",
ctx: func() *gotenberg.Context {
provider1 := struct {
provider1 := &struct {
gotenberg.ModuleMock
uno.ProviderMock
}{}
@@ -146,7 +146,7 @@ func TestLibreOffice_Provision(t *testing.T) {
return uno.APIMock{}, nil
}
provider2 := struct {
provider2 := &struct {
gotenberg.ModuleMock
gotenberg.PDFEngineProviderMock
}{}
@@ -156,7 +156,7 @@ func TestLibreOffice_Provision(t *testing.T) {
}}
}
provider2.PDFEngineMock = func() (gotenberg.PDFEngine, error) {
return gotenberg.PDFEngineMock{}, errors.New("foo")
return &gotenberg.PDFEngineMock{}, errors.New("foo")
}
return gotenberg.NewContext(

View File

@@ -32,7 +32,7 @@ func TestUNO_Provider(t *testing.T) {
{
name: "nominal behavior",
ctx: func() *gotenberg.Context {
provider := struct {
provider := &struct {
gotenberg.ModuleMock
uno.ProviderMock
}{}
@@ -68,7 +68,7 @@ func TestUNO_Provider(t *testing.T) {
{
name: "no API from UNO API provider",
ctx: func() *gotenberg.Context {
provider := struct {
provider := &struct {
gotenberg.ModuleMock
uno.ProviderMock
}{}

View File

@@ -270,7 +270,7 @@ func TestConvertHandler(t *testing.T) {
}
},
},
engine: gotenberg.PDFEngineMock{
engine: &gotenberg.PDFEngineMock{
MergeMock: func(ctx context.Context, logger *zap.Logger, inputPaths []string, outputPath string) error {
return nil
},
@@ -304,7 +304,7 @@ func TestConvertHandler(t *testing.T) {
}
},
},
engine: gotenberg.PDFEngineMock{
engine: &gotenberg.PDFEngineMock{
MergeMock: func(ctx context.Context, logger *zap.Logger, inputPaths []string, outputPath string) error {
return errors.New("foo")
},
@@ -341,7 +341,7 @@ func TestConvertHandler(t *testing.T) {
}
},
},
engine: gotenberg.PDFEngineMock{
engine: &gotenberg.PDFEngineMock{
MergeMock: func(ctx context.Context, logger *zap.Logger, inputPaths []string, outputPath string) error {
return nil
},
@@ -381,7 +381,7 @@ func TestConvertHandler(t *testing.T) {
}
},
},
engine: gotenberg.PDFEngineMock{
engine: &gotenberg.PDFEngineMock{
MergeMock: func(ctx context.Context, logger *zap.Logger, inputPaths []string, outputPath string) error {
return nil
},
@@ -421,7 +421,7 @@ func TestConvertHandler(t *testing.T) {
}
},
},
engine: gotenberg.PDFEngineMock{
engine: &gotenberg.PDFEngineMock{
MergeMock: func(ctx context.Context, logger *zap.Logger, inputPaths []string, outputPath string) error {
return nil
},
@@ -461,7 +461,7 @@ func TestConvertHandler(t *testing.T) {
}
},
},
engine: gotenberg.PDFEngineMock{
engine: &gotenberg.PDFEngineMock{
MergeMock: func(ctx context.Context, logger *zap.Logger, inputPaths []string, outputPath string) error {
return nil
},
@@ -493,7 +493,7 @@ func TestConvertHandler(t *testing.T) {
}
},
},
engine: gotenberg.PDFEngineMock{
engine: &gotenberg.PDFEngineMock{
ConvertMock: func(ctx context.Context, logger *zap.Logger, format, inputPath, outputPath string) error {
return nil
},
@@ -526,7 +526,7 @@ func TestConvertHandler(t *testing.T) {
}
},
},
engine: gotenberg.PDFEngineMock{
engine: &gotenberg.PDFEngineMock{
ConvertMock: func(ctx context.Context, logger *zap.Logger, format, inputPath, outputPath string) error {
return nil
},
@@ -558,7 +558,7 @@ func TestConvertHandler(t *testing.T) {
}
},
},
engine: gotenberg.PDFEngineMock{
engine: &gotenberg.PDFEngineMock{
ConvertMock: func(ctx context.Context, logger *zap.Logger, format, inputPath, outputPath string) error {
return errors.New("foo")
},
@@ -590,7 +590,7 @@ func TestConvertHandler(t *testing.T) {
}
},
},
engine: gotenberg.PDFEngineMock{
engine: &gotenberg.PDFEngineMock{
ConvertMock: func(ctx context.Context, logger *zap.Logger, format, inputPath, outputPath string) error {
return gotenberg.ErrPDFFormatNotAvailable
},

View File

@@ -35,7 +35,7 @@ func TestUNO_Provision(t *testing.T) {
{
name: "nominal behavior",
ctx: func() *gotenberg.Context {
provider := struct {
provider := &struct {
gotenberg.ModuleMock
gotenberg.LoggerProviderMock
}{}
@@ -61,7 +61,7 @@ func TestUNO_Provision(t *testing.T) {
{
name: "threshold from deprecated flag --unoconv-disable-listener",
ctx: func() *gotenberg.Context {
provider := struct {
provider := &struct {
gotenberg.ModuleMock
gotenberg.LoggerProviderMock
}{}
@@ -107,7 +107,7 @@ func TestUNO_Provision(t *testing.T) {
{
name: "no logger from logger provider",
ctx: func() *gotenberg.Context {
provider := struct {
provider := &struct {
gotenberg.ModuleMock
gotenberg.LoggerProviderMock
}{}