<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<script>
description("Test that setting a font with size in 'ex' units doesn't crash.");

ctx = document.createElement('canvas').getContext('2d');

ctx.font = "5ex sans-serif";

let index = ctx.font.indexOf(" ");
size = parseInt(ctx.font.substr(0, index));
family = ctx.font.substr(index + 1);

shouldBeCloseTo("size", 25, 10);
shouldBe("family", "'sans-serif'");
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>
