Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(376)

Side by Side Diff: LayoutTests/fast/css/fontfaceset-ready.html

Issue 1313853003: CSS Font Loading: FontFaceSet.ready should return the same promise each time (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Source/core/css/FontFaceSet.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>FontFaceSet.ready attribute</title>
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <script>
6
7 promise_test(function(t) {
8 assert_equals(document.fonts.ready, document.fonts.ready,
9 'FontFaceSet.ready should return the same promise');
10
11 var face = new FontFace('test', 'url(../../resources/Ahem.ttf)');
12
13 return document.fonts.ready
14 .then(function(fonts) {
15 assert_equals(fonts, document.fonts,
16 'FontFaceSet.ready should be resolved with the FontFac eSet');
17
18 var oldReady = document.fonts.ready;
19 document.fonts.add(face);
20 assert_equals(document.fonts.ready, oldReady,
21 'FontFaceSet.ready should not be replaced when FontFac e added to it is not loading');
22 assert_equals(document.fonts.status, 'loaded',
23 'FontFaceSet.status after adding unloaded FontFace');
24 face.load();
25 var newReady = document.fonts.ready;
26 assert_not_equals(newReady, oldReady,
27 'FontFaceSet.ready should be replaced when a FontF ace in it started loading');
28 assert_equals(document.fonts.status, 'loading',
29 'FontFaceSet.status after calling load() on a FontFace in it');
30 return newReady;
31 }).then(function(fonts) {
32 assert_equals(face.status, 'loaded',
33 'FontFaceSet.ready should be resolved after all fonts have been loaded');
34 assert_equals(document.fonts.status, 'loaded',
35 'FontFaceSet.status after FontFaceSet.ready is resolve d');
36 });
37 }, 'FontFaceSet.ready attribute');
38
39 </script>
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/FontFaceSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698