tests: Vendor blink perf tests (#38654)

Vendors the [blink perf
tests](https://chromium.googlesource.com/chromium/src/+/HEAD/third_party/blink/perf_tests/).
These perf tests are useful to evaluate the performance of servo. 
The license that governs the perf tests is included in the folder. 
Running benchmark cases automatically is left to future work.

The update.py script is taken from mozjs and slightly adapted, so we can
easily filter
(and patch if this should be necessary in the future.

Testing: This PR just adds the perf_tests, but does not use or modify
them in any way.

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This commit is contained in:
Jonathan Schwender 2025-08-17 11:54:04 +02:00 committed by GitHub
parent 7621332824
commit ee781b71b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
648 changed files with 359694 additions and 0 deletions

View file

@ -0,0 +1,37 @@
<!DOCTYPE html>
<title>Custom Highlights Painting</title>
<style>
::highlight(example) {
color: blue;
background: yellow;
}
.lime ::highlight(example) {
background: lime;
}
</style>
<script src="../resources/runner.js"></script>
<script src="resources/paint.js"></script>
<main></main>
<pre id="log"></pre>
<script>
const LOREM_IPSUM = "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. ".repeat(42);
const highlight = new Highlight;
const main = document.querySelector("main");
main.textContent = LOREM_IPSUM;
for (let i = 0; i < LOREM_IPSUM.length; i += 2) {
const range = new Range;
range.setStart(main.firstChild, i);
range.setEnd(main.firstChild, i + 1);
highlight.add(range);
}
CSS.highlights.set("example", highlight);
measurePaint({
description: "Measure time for painting Custom Highlights (emulates searching 'a' in a large text)",
run: () => document.body.classList.toggle("lime"),
});
</script>