mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-16 04:12:16 +01:00
feat(chromium): skip networkIdle event
This commit is contained in:
@@ -380,6 +380,41 @@ func TestChromiumBrowser_pdf(t *testing.T) {
|
||||
"'file:///etc/passwd' matches the expression from the denied list",
|
||||
},
|
||||
},
|
||||
{
|
||||
scenario: "skip networkIdle event",
|
||||
browser: newChromiumBrowser(
|
||||
browserArguments{
|
||||
binPath: os.Getenv("CHROMIUM_BIN_PATH"),
|
||||
wsUrlReadTimeout: 5 * time.Second,
|
||||
allowList: regexp.MustCompile(""),
|
||||
denyList: regexp.MustCompile(""),
|
||||
},
|
||||
),
|
||||
fs: func() *gotenberg.FileSystem {
|
||||
fs := gotenberg.NewFileSystem()
|
||||
|
||||
err := os.MkdirAll(fs.WorkingDirPath(), 0o755)
|
||||
if err != nil {
|
||||
t.Fatalf(fmt.Sprintf("expected no error but got: %v", err))
|
||||
}
|
||||
|
||||
err = os.WriteFile(fmt.Sprintf("%s/index.html", fs.WorkingDirPath()), []byte("<h1>Skip networkIdle event</h1>"), 0o755)
|
||||
if err != nil {
|
||||
t.Fatalf("expected no error but got: %v", err)
|
||||
}
|
||||
|
||||
return fs
|
||||
}(),
|
||||
options: Options{
|
||||
SkipNetworkIdleEvent: true,
|
||||
},
|
||||
noDeadline: false,
|
||||
start: true,
|
||||
expectError: false,
|
||||
expectedLogEntries: []string{
|
||||
"skipping network idle event",
|
||||
},
|
||||
},
|
||||
{
|
||||
scenario: "ErrConsoleExceptions",
|
||||
browser: newChromiumBrowser(
|
||||
|
||||
Reference in New Issue
Block a user