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

Unified Diff: LayoutTests/fast/css/fontfaceset-iterator.html

Issue 557763003: Add iterator support to FontFaceSet (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/css/fontfaceset-iterator-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/css/fontfaceset-iterator.html
diff --git a/LayoutTests/fast/css/fontfaceset-iterator.html b/LayoutTests/fast/css/fontfaceset-iterator.html
new file mode 100644
index 0000000000000000000000000000000000000000..27747a43d60f2e114c7e47ebbb9b747db7f2763f
--- /dev/null
+++ b/LayoutTests/fast/css/fontfaceset-iterator.html
@@ -0,0 +1,47 @@
+<!doctype html>
+<script src="../../resources/js-test.js"></script>
+<style>
+@font-face {
+ font-family: font1;
+ src: local(Arial);
+}
+@font-face {
+ font-family: font2;
+ src: local(Arial);
+}
+</style>
+<script>
+description('Tests iterators of FontFaceSet.');
+
+var font3 = new FontFace('font3', 'local(Arial)');
+document.fonts.add(font3);
+
+var expected = ['font1', 'font2', 'font3'];
+var families;
+
+families = [];
+for (var face of document.fonts) {
+ families.push(face.family);
+}
+shouldBeEqualToString("families.join(',')", expected.join(','));
+
+families = [];
+for (var face of document.fonts.keys()) {
+ families.push(face.family);
+}
+shouldBeEqualToString("families.join(',')", expected.join(','));
+
+families = [];
+for (var face of document.fonts.values()) {
+ families.push(face.family);
+}
+shouldBeEqualToString("families.join(',')", expected.join(','));
+
+families = [];
+for (var entry of document.fonts.entries()) {
+ shouldBeTrue('entry[0] === entry[1]');
+ families.push(entry[0].family);
+}
+shouldBeEqualToString("families.join(',')", expected.join(','));
+
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/css/fontfaceset-iterator-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698