mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-15 11:52:14 +01:00
fix: chromium memory leaks (#705)
This commit is contained in:
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
91
test/testdata/chromium/html/index.html
vendored
Normal file
91
test/testdata/chromium/html/index.html
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
|
||||
<title>Gutenberg</title>
|
||||
<style>
|
||||
@media print {
|
||||
#screen { display: none }
|
||||
}
|
||||
@media screen {
|
||||
#print { display: none }
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="page-break-after">
|
||||
<div class="center">
|
||||
<h1>Gutenberg</h1>
|
||||
<img src="img.gif" alt="An image">
|
||||
</div>
|
||||
|
||||
<blockquote cite="https://sites.google.com/site/johanngutenbergper5/q">
|
||||
<p>It is a press, certainly, but a press from which shall flow in inexhaustible streams...Through it, God will spread His Word. A spring of truth shall flow from it: like a new star it shall scatter the darkness of ignorance, and cause a light heretofore unknown to shine amongst men.</p>
|
||||
<footer>— <a href="https://sites.google.com/site/johanngutenbergper5/q">Johannes Gutenberg</a></cite></footer>
|
||||
</blockquote>
|
||||
</div>
|
||||
|
||||
<div class="page-break-after">
|
||||
<h2>This paragraph uses the default font</h2>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
||||
|
||||
<h2>This paragraph uses a Google font</h2>
|
||||
<p class="google-font">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
||||
|
||||
<h2>This paragraph uses a local font</h2>
|
||||
<p class="local-font">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
||||
</div>
|
||||
|
||||
<div class="center page-break-after">
|
||||
<h1>This image is loaded from a URL</h1>
|
||||
<img src="https://user-images.githubusercontent.com/8983173/130322857-185831e2-f041-46eb-a17f-0a69d066c4e5.png">
|
||||
</div>
|
||||
|
||||
<div class="page-break-after">
|
||||
<h2>This paragraph appears if wait delay > 2 seconds or if expression window.globalVar === 'ready' returns true</h2>
|
||||
<p id="wait" style="display: none">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
||||
|
||||
<h2>This paragraph appears if the emulated media type is 'print'</h2>
|
||||
<p id="print">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
||||
|
||||
<h2>This paragraph appears if the emulated media type is 'screen'</h2>
|
||||
<p id="screen">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
||||
</div>
|
||||
|
||||
<div class="page-break-after">
|
||||
<h2>This paragraph appears if JavaScript is NOT disabled</h2>
|
||||
<p id="javascript" style="display: none">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
||||
</div>
|
||||
|
||||
<script type="application/javascript">
|
||||
var globalVar = 'notReady'
|
||||
|
||||
const delay = ms => new Promise(res => setTimeout(res, ms))
|
||||
delay(2000).then(() => {
|
||||
document.getElementById('wait').style.display = 'contents'
|
||||
window.globalVar = 'ready'
|
||||
})
|
||||
</script>
|
||||
|
||||
<script type="application/javascript">
|
||||
document.getElementById('javascript').style.display = 'contents'
|
||||
</script>
|
||||
|
||||
<script type="application/javascript">
|
||||
console.log("a simple message")
|
||||
console.debug("a debug message")
|
||||
console.warn("a warning message")
|
||||
console.error("an error message")
|
||||
</script>
|
||||
|
||||
<script type="application/javascript">
|
||||
throw new Error("Exception 1")
|
||||
</script>
|
||||
|
||||
<script type="application/javascript">
|
||||
throw new Error("Exception 2")
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
38
test/testdata/chromium/html/sample1/index.html
vendored
38
test/testdata/chromium/html/sample1/index.html
vendored
@@ -1,38 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
|
||||
<title>Gutenberg</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="page-break-after">
|
||||
<div class="center">
|
||||
<h1>Gutenberg</h1>
|
||||
<img src="img.gif">
|
||||
</div>
|
||||
|
||||
<blockquote cite="https://sites.google.com/site/johanngutenbergper5/q">
|
||||
<p>It is a press, certainly, but a press from which shall flow in inexhaustible streams...Through it, God will spread His Word. A spring of truth shall flow from it: like a new star it shall scatter the darkness of ignorance, and cause a light heretofore unknown to shine amongst men.</p>
|
||||
<footer>— <a href="https://sites.google.com/site/johanngutenbergper5/q">Johannes Gutenberg</a></cite></footer>
|
||||
</blockquote>
|
||||
</div>
|
||||
|
||||
<div class="page-break-after">
|
||||
<h2>This paragraph use the default font</h2>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
||||
|
||||
<h2>This paragraph use a Google font</h2>
|
||||
<p class="google-font">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
||||
|
||||
<h2>This paragraph use a local font</h2>
|
||||
<p class="local-font">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
||||
</div>
|
||||
|
||||
<div class="center">
|
||||
<h1>This image is loaded from a URL</h1>
|
||||
<img src="https://user-images.githubusercontent.com/8983173/130322857-185831e2-f041-46eb-a17f-0a69d066c4e5.png">
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
24
test/testdata/chromium/html/sample10/index.html
vendored
24
test/testdata/chromium/html/sample10/index.html
vendored
@@ -1,24 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Gutenberg</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>Console API</p>
|
||||
|
||||
<script type="application/javascript">
|
||||
console.log("a simple message")
|
||||
console.debug("a debug message")
|
||||
console.warn("a warning message")
|
||||
console.error("an error message")
|
||||
</script>
|
||||
<script type="application/javascript">
|
||||
throw new Error("Exception 1")
|
||||
</script>
|
||||
<script type="application/javascript">
|
||||
throw new Error("Exception 2")
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
28
test/testdata/chromium/html/sample2/index.html
vendored
28
test/testdata/chromium/html/sample2/index.html
vendored
@@ -1,28 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Gutenberg</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p id="status">
|
||||
No window.status
|
||||
</p>
|
||||
|
||||
<script type="application/javascript">
|
||||
const delay = ms => new Promise(res => setTimeout(res, ms))
|
||||
|
||||
const changeStatus = async (status) => {
|
||||
await delay(2000)
|
||||
console.log('waited 2s')
|
||||
|
||||
document.getElementById('status').innerText = 'window.status === ' + status
|
||||
|
||||
window.status = status
|
||||
};
|
||||
|
||||
changeStatus('ready')
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
10
test/testdata/chromium/html/sample3/index.html
vendored
10
test/testdata/chromium/html/sample3/index.html
vendored
@@ -1,10 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Gutenberg</title>
|
||||
</head>
|
||||
<body>
|
||||
<iframe src='file:///etc/passwd'></iframe>
|
||||
</body>
|
||||
</html>
|
||||
10
test/testdata/chromium/html/sample4/index.html
vendored
10
test/testdata/chromium/html/sample4/index.html
vendored
@@ -1,10 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Gutenberg</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Hello, world!</p>
|
||||
</body>
|
||||
</html>
|
||||
BIN
test/testdata/chromium/html/sample5/MyImg.gif
vendored
BIN
test/testdata/chromium/html/sample5/MyImg.gif
vendored
Binary file not shown.
|
Before Width: | Height: | Size: 29 KiB |
11
test/testdata/chromium/html/sample5/index.html
vendored
11
test/testdata/chromium/html/sample5/index.html
vendored
@@ -1,11 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Gutenberg</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Gutenberg</h1>
|
||||
<img src="MyImg.gif">
|
||||
</body>
|
||||
</html>
|
||||
20
test/testdata/chromium/html/sample6/index.html
vendored
20
test/testdata/chromium/html/sample6/index.html
vendored
@@ -1,20 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
<title>Gutenberg</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="center">
|
||||
<h1>Gutenberg</h1>
|
||||
</div>
|
||||
|
||||
<blockquote cite="https://sites.google.com/site/johanngutenbergper5/q">
|
||||
<p>It is a press, certainly, but a press from which shall flow in inexhaustible streams...Through it, God will spread His Word. A spring of truth shall flow from it: like a new star it shall scatter the darkness of ignorance, and cause a light heretofore unknown to shine amongst men.</p>
|
||||
<footer>— <a href="https://sites.google.com/site/johanngutenbergper5/q">Johannes Gutenberg</a></cite></footer>
|
||||
</blockquote>
|
||||
|
||||
<script src="paged.polyfill.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
32782
test/testdata/chromium/html/sample6/paged.polyfill.js
vendored
32782
test/testdata/chromium/html/sample6/paged.polyfill.js
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,7 +0,0 @@
|
||||
body {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
.center {
|
||||
text-align: center;
|
||||
}
|
||||
14
test/testdata/chromium/html/sample7/index.html
vendored
14
test/testdata/chromium/html/sample7/index.html
vendored
@@ -1,14 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Gutenberg</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Gutenberg</h1>
|
||||
<p style="color: #d1d0d0;">
|
||||
It is a press, certainly, but a press from which shall flow in inexhaustible streams...Through it, God will spread His Word. A spring of truth shall flow from it: like a new star it shall scatter the darkness of ignorance, and cause a light heretofore unknown to shine amongst men.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
19
test/testdata/chromium/html/sample8/index.html
vendored
19
test/testdata/chromium/html/sample8/index.html
vendored
@@ -1,19 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Gutenberg</title>
|
||||
<style>
|
||||
@media print {
|
||||
#screen { display: none }
|
||||
}
|
||||
@media screen {
|
||||
#print { display: none }
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p id="print">Print media type</p>
|
||||
<p id="screen">Screen media type</p>
|
||||
</body>
|
||||
</html>
|
||||
17
test/testdata/chromium/html/sample9/index.html
vendored
17
test/testdata/chromium/html/sample9/index.html
vendored
@@ -1,17 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Gutenberg</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p id="javascript">
|
||||
JavaScript disabled.
|
||||
</p>
|
||||
|
||||
<script type="application/javascript">
|
||||
document.getElementById('javascript').innerText = 'JavaScript not disabled.'
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -25,4 +25,5 @@ body {
|
||||
.page-break-after {
|
||||
page-break-after: always;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
@@ -20,15 +20,24 @@
|
||||
</div>
|
||||
|
||||
<div class="page-break-after">
|
||||
{{ toHTML "markdown1.md" }}
|
||||
{{ toHTML "defaultfont.md" }}
|
||||
|
||||
<div class="google-font">
|
||||
{{ toHTML "markdown2.md" }}
|
||||
{{ toHTML "googlefont.md" }}
|
||||
</div>
|
||||
|
||||
<div class="local-font">
|
||||
{{ toHTML "markdown3.md" }}
|
||||
{{ toHTML "localfont.md" }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-break-after">
|
||||
{{ toHTML "table.md" }}
|
||||
|
||||
<h2>HTML from previous table</h2>
|
||||
<textarea readonly="readonly" cols="100" rows="50">
|
||||
{{ toHTML "table.md" }}
|
||||
</textarea>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,23 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Gutenberg</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="page-break-after">
|
||||
<div class="center">
|
||||
<h1>Gutenberg</h1>
|
||||
</div>
|
||||
|
||||
<blockquote cite="https://sites.google.com/site/johanngutenbergper5/q">
|
||||
<p>It is a press, certainly, but a press from which shall flow in inexhaustible streams...Through it, God will spread His Word. A spring of truth shall flow from it: like a new star it shall scatter the darkness of ignorance, and cause a light heretofore unknown to shine amongst men.</p>
|
||||
<footer>— <a href="https://sites.google.com/site/johanngutenbergper5/q">Johannes Gutenberg</a></cite></footer>
|
||||
</blockquote>
|
||||
</div>
|
||||
|
||||
<div class="page-break-after">
|
||||
{{ toHTML "markdown.md" }}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,18 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Gutenberg</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Table in markdown</h1>
|
||||
|
||||
<h2>toHTML</h2>
|
||||
{{ toHTML "markdown.md" }}
|
||||
|
||||
<h2>Actual HTML</h2>
|
||||
<textarea readonly="readonly" cols="100" rows="50">
|
||||
{{ toHTML "markdown.md" }}
|
||||
</textarea>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,3 +1,5 @@
|
||||
## This paragraph displays a table from a markdown file
|
||||
|
||||
| Tables | Are | Cool |
|
||||
|----------|:-------------:|------:|
|
||||
| col 1 is | left-aligned | $1600 |
|
||||
15
test/testdata/chromium/url/sample1/footer.html
vendored
15
test/testdata/chromium/url/sample1/footer.html
vendored
@@ -1,15 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
body {
|
||||
font-size: 8rem;
|
||||
margin: 4rem auto;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
<span class="pageNumber"></span> of <span class="totalPages"></span>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
13
test/testdata/chromium/url/sample1/header.html
vendored
13
test/testdata/chromium/url/sample1/header.html
vendored
@@ -1,13 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
body {
|
||||
font-size: 8rem;
|
||||
margin: 4rem auto;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<span class="title"></span>
|
||||
</body>
|
||||
</html>
|
||||
8206
test/testdata/chromium/url/sample2/footer.html
vendored
8206
test/testdata/chromium/url/sample2/footer.html
vendored
File diff suppressed because it is too large
Load Diff
8206
test/testdata/chromium/url/sample2/header.html
vendored
8206
test/testdata/chromium/url/sample2/header.html
vendored
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user