Chromium Code Reviews| Index: LayoutTests/fast/css/resource-timing-for-unloaded-font.html |
| diff --git a/LayoutTests/fast/css/resource-timing-for-unloaded-font.html b/LayoutTests/fast/css/resource-timing-for-unloaded-font.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..16d3fefdecdbf0a3453818c8cb5e311ef562113e |
| --- /dev/null |
| +++ b/LayoutTests/fast/css/resource-timing-for-unloaded-font.html |
| @@ -0,0 +1,34 @@ |
| +<!DOCTYPE html> |
| +<script src="../../resources/js-test.js"></script> |
| +<style> |
| +@font-face { |
| + font-family: foo; |
| + src: url(file:///foo.ttf); |
|
bashi
2014/06/27 01:40:51
nit: it would be clearer if you name it as no-such
Kunihiko Sakamoto
2014/06/27 02:14:57
Done.
|
| +} |
| +</style> |
| + |
| +<script> |
| +description('Unloaded web fonts should not report Resource Timing') |
|
bashi
2014/06/27 01:40:51
nit: missing semicolon.
Kunihiko Sakamoto
2014/06/27 02:14:57
Done.
|
| + |
| +window.jsTestIsAsync = true; |
| + |
| +function getDocumentFontFaces() { |
| + var faces = []; |
| + document.fonts.forEach(function(face) { faces.push(face); }); |
| + return faces; |
| +} |
| + |
| +function verify() { |
| + shouldBeEqualToString('getDocumentFontFaces()[0].status', 'unloaded'); |
| + entries = performance.getEntriesByName('file:///foo.ttf'); |
| + shouldBe('entries.length', '0'); |
| + finishJSTest(); |
| +} |
| + |
| +if (location.hash == '#check') { |
| + setTimeout(verify, 10); |
| +} else { |
| + location.hash = 'check'; |
| + location.reload(); |
| +} |
| +</script> |