| <script src="../../resources/js-test-pre.js"></script> |
| src: url(../../resources/Ahem.ttf); |
| description('Test that the event handlers of FontLoader are called in the correct order.'); |
| window.jsTestIsAsync = true; |
| function handleEvent(e) { |
| shouldBeEqualToString('event.type', ['loading', 'loadstart', 'load', 'loadingdone'][numberOfEvents]); |
| document.fonts.onloading = handleEvent; |
| document.fonts.onloadingdone = handleEvent; |
| document.fonts.onloadstart = handleEvent; |
| document.fonts.onload = handleEvent; |
| document.fonts.onerror = handleEvent; |
| document.fonts.notifyWhenFontsReady(function() { |
| shouldBe('numberOfEvents', '4'); |
| testFailed('document.fonts does not exist'); |
| <div style="font-family: ahem">Hello, world!</div> |
| <script src="../../resources/js-test-post.js"></script> |