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.
31 lines
1.0 KiB
HTML
31 lines
1.0 KiB
HTML
<!DOCTYPE html>
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
asyncTest(async (done) => {
|
|
// FIXME: Surely there's a better way to get this font URL
|
|
let fontUrl = new URL(location.href);
|
|
fontUrl.search = "";
|
|
fontUrl += "/../../../../Assets/HashSans.woff";
|
|
|
|
const hashSans = new FontFace("Hash Sans", `url(${fontUrl})`);
|
|
println(`hashSans.family: ${hashSans.family}`);
|
|
println(`hashSans.status: ${hashSans.status}`);
|
|
|
|
await hashSans.load().then(() => {
|
|
println(`hashSans.status: ${hashSans.status}`);
|
|
}, () => {
|
|
println("FAILED");
|
|
});
|
|
|
|
let notExistFont = new FontFace("NotExist", "url(https://something.invalid/not-exist.woff)");
|
|
await notExistFont.load().then(() => {
|
|
println("FAILED");
|
|
}, (reason) => {
|
|
println(`font load failed because: ${reason}`);
|
|
println(`notExistFont.status: ${notExistFont.status}`);
|
|
});
|
|
|
|
done();
|
|
});
|
|
</script>
|