mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 06:37:52 +00:00
Having to go through multiple levels of .. is not ideal, but less odd than reaching into another test type's data files.
33 lines
1.0 KiB
HTML
33 lines
1.0 KiB
HTML
<script src="./include.js"></script>
|
|
<script type="text/javascript">
|
|
const SOURCES = ["../../Assets/120.png", "file:///i-do-no-exist-i-swear.png"];
|
|
|
|
const runTest = source => {
|
|
let input = document.createElement("input");
|
|
input.type = "image";
|
|
input.alt = "submit";
|
|
|
|
return new Promise((resolve, reject) => {
|
|
input.addEventListener("load", () => {
|
|
const filename = input.src.split('/').pop();
|
|
resolve(`${filename} loaded`);
|
|
});
|
|
input.addEventListener("error", () => {
|
|
resolve(`${input.src} failed`);
|
|
});
|
|
|
|
input.setAttribute("src", source);
|
|
});
|
|
};
|
|
|
|
asyncTest(done => {
|
|
let promises = SOURCES.map(source => runTest(source));
|
|
|
|
Promise.allSettled(promises)
|
|
.then(results => results.map(result => result.value))
|
|
.then(results => results.sort())
|
|
.then(results => results.forEach(println))
|
|
.finally(done);
|
|
});
|
|
</script>
|