| src: url(../../resources/Ahem.ttf); |
| var timeoutValue = 100; //ms |
| document.getElementById("result").innerHTML = |
| document.fonts.checkFont("10px TestFont") ? 'PASS' : 'FAIL with TestFont missing'; |
| testRunner.waitUntilDone(); |
| testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1); |
| document.fonts.loadFont({ font: '10px TestFont', onsuccess: onsuccess, onerror: onerror }); |
| window.setTimeout(verify, timeoutValue); |
| window.setTimeout(function() { |
| window.location.href = "data:text/html,<body onload='history.back()'></body>"; |
| document.getElementById("result").innerHTML = "FAIL with font load error"; |
| <body onload='runTest()'> |
| This test verifies that the page cache preserves pages with fonts loaded via the document.fonts API. The test loads a font, then navigates away and back, confirming that the font remains loaded. If successful, it outputs 'PASS' below. |