test_bug1375944.html (832B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>Test for bug 1375944</title> 5 <script src="/tests/SimpleTest/SimpleTest.js"></script> 6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"> 7 </head> 8 <body> 9 <iframe id="subframe"></iframe> 10 <pre id="log"> 11 <script> 12 13 SimpleTest.waitForExplicitFinish(); 14 15 async function runTest() { 16 let f = new FontFace("Ahem", "url(Ahem.ttf)", {}); 17 await f.load(); 18 is(f.status, "loaded", "Loaded Ahem font"); 19 20 let subframe = document.getElementById("subframe"); 21 subframe.src = "file_bug1375944.html"; 22 await new Promise(resolve => subframe.onload = resolve); 23 let elem = subframe.contentDocument.getElementById("test"); 24 is(elem.getBoundingClientRect().width, 64, 25 "The font should be loaded properly"); 26 27 SimpleTest.finish(); 28 } 29 runTest(); 30 31 </script> 32 </pre> 33 </body> 34 </html>