summaryrefslogtreecommitdiffstats
path: root/layout/style/test/test_bug1375944.html
blob: c265691170b684c70bc0bfd3d12f9e1b06e97049 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html>
<html>
<head>
  <title>Test for bug 1375944</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
</head>
<body>
<iframe id="subframe"></iframe>
<pre id="log">
<script>

SimpleTest.waitForExplicitFinish();

async function runTest() {
  let f = new FontFace("Ahem", "url(Ahem.ttf)", {});
  await f.load();
  is(f.status, "loaded", "Loaded Ahem font");

  let subframe = document.getElementById("subframe");
  subframe.src = "file_bug1375944.html";
  await new Promise(resolve => subframe.onload = resolve);
  let elem = subframe.contentDocument.getElementById("test");
  is(elem.getBoundingClientRect().width, 64,
     "The font should be loaded properly");

  SimpleTest.finish();
}
runTest();

</script>
</pre>
</body>
</html>