Chromium Code Reviews| Index: LayoutTests/fast/css/fontfaceset-ready.html |
| diff --git a/LayoutTests/fast/css/fontfaceset-ready.html b/LayoutTests/fast/css/fontfaceset-ready.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6f0195d7db878e83fe9628f83ed71c519491e56e |
| --- /dev/null |
| +++ b/LayoutTests/fast/css/fontfaceset-ready.html |
| @@ -0,0 +1,31 @@ |
| +<!DOCTYPE html> |
| +<title>FontFaceSet.ready attribute</title> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<script> |
| + |
| +promise_test(function(t) { |
| + assert_equals(document.fonts.ready, document.fonts.ready, |
| + 'FontFaceSet.ready should return the same promise'); |
| + |
| + var face = new FontFace('test', 'url(../../resources/Ahem.ttf)'); |
| + |
| + return document.fonts.ready |
| + .then(function(fonts) { |
| + assert_equals(fonts, document.fonts, |
| + 'FontFaceSet.ready should be resolved with the FontFaceSet'); |
| + |
| + var oldReady = document.fonts.ready; |
| + document.fonts.add(face); |
| + face.load(); |
| + var newReady = document.fonts.ready; |
|
dominicc (has gone to gerrit)
2015/09/02 00:14:06
Exactly when does document.fonts.ready get reset?
Kunihiko Sakamoto
2015/09/02 05:05:42
That is when face.load() is called. Added another
|
| + assert_not_equals(newReady, oldReady, |
|
dominicc (has gone to gerrit)
2015/09/02 00:14:06
Because resetting [[ReadyPromise]] happens at the
Kunihiko Sakamoto
2015/09/02 05:05:41
Done.
|
| + 'FontFaceSet.ready should be replaced when a FontFace in it started loading'); |
| + return newReady; |
| + }).then(function(fonts) { |
| + assert_equals(face.status, 'loaded', |
| + 'FontFaceSet.ready should be resolved after all fonts have been loaded'); |
| + }); |
| +}, 'FontFaceSet.ready attribute'); |
| + |
| +</script> |