gecko-dev/security/sandbox/test/bug1393259.html
Jonathan Kew c48e7d41b9 Bug 1542773 - Make the mac font activation/sandbox test (browser_bug1393259.js) more robust. r=haik
When the test font is activated, the notification of the font configuration change
may be handled asynchronously by content processes, so that it's possible the content
process has not yet handled the update at the point when registerFont() detects the
change and returns to the test script.

(This issue becomes more acute with the upcoming shared-font-list system, where the
OS notification is not handled by the content process at all; it's only handled by
the parent process, which then notifies content processes *after* it has updated the
font list. So there's an inherent latency between the update being recognized by the
chrome process - and therefore "ready" as far as the test script is concerned - and
content processes receiving and handling the change.)

To handle this, we can explicitly wait for the width of the rendered content to change,
which will indicate that the font configuration change has been handled by the content
process.

Differential Revision: https://phabricator.services.mozilla.com/D26570

--HG--
extra : moz-landing-system : lando
2019-04-09 16:56:06 +00:00

20 lines
341 B
HTML

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8"/>
</head>
<style>
#content { display: inline-block; }
.monospace_fallback { font: 3em monospace; }
</style>
<body>
<div id="content" class="monospace_fallback">
abcdefghijklmnopqrstuvwxyz<br>
<b>abcdefghijklmnopqrstuvwxyz</b><br>
<i>abcdefghijklmnopqrstuvwxyz</i>
</div>
</body>
</html>