mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
This exposed a false positive in our test suite which has been fixed and made more robust
42 lines
1.2 KiB
HTML
42 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<script src="../include.js"></script>
|
|
<script type="text/javascript">
|
|
asyncTest(async done => {
|
|
const fontFaceSet = document.fonts;
|
|
|
|
const fontFace = new FontFace("Hash Sans", "url(../../../Assets/HashSans.woff)");
|
|
fontFaceSet.add(fontFace);
|
|
|
|
try {
|
|
await fontFaceSet.load("invalid");
|
|
println("Load invalid font: FAIL");
|
|
} catch (e) {
|
|
println("Load invalid font: PASS");
|
|
}
|
|
|
|
try {
|
|
await fontFaceSet.load("revert");
|
|
println("Load CSS keyword as font: FAIL");
|
|
} catch (e) {
|
|
println("Load CSS keyword as font: PASS");
|
|
}
|
|
|
|
try {
|
|
const result = await fontFaceSet.load("10px NonExistentFont");
|
|
println(`Load non-existent font: ${result.length == 0 ? "PASS" : "FAIL"}`);
|
|
} catch {
|
|
println("Load non-existent font: FAIL");
|
|
}
|
|
|
|
try {
|
|
const result = await fontFaceSet.load("1em Hash Sans");
|
|
println(`Load valid font: ${result.length > 0 ? "PASS" : "FAIL"}`);
|
|
} catch (e) {
|
|
println("Load valid font: FAIL");
|
|
println(e);
|
|
}
|
|
|
|
done();
|
|
});
|
|
</script>
|