Deflake animations/font-variations tests
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Feb 2020 20:21:29 +0000 (20:21 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Feb 2020 20:21:29 +0000 (20:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=208383

Reviewed by Ryosuke Niwa.

Use document.fonts.ready to work around https://bugs.webkit.org/show_bug.cgi?id=208382,
and to simplify the tests.

* animations/font-variations/font-stretch.html:
* animations/font-variations/font-style.html:
* animations/font-variations/font-variation-settings-order.html:
* animations/font-variations/font-variation-settings-unlike.html:
* animations/font-variations/font-variation-settings.html:
* animations/font-variations/font-weight.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257652 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/animations/font-variations/font-stretch.html
LayoutTests/animations/font-variations/font-style.html
LayoutTests/animations/font-variations/font-variation-settings-order.html
LayoutTests/animations/font-variations/font-variation-settings-unlike.html
LayoutTests/animations/font-variations/font-variation-settings.html
LayoutTests/animations/font-variations/font-weight.html

index 0a89d8f..3db670b 100644 (file)
@@ -1,3 +1,20 @@
+2020-02-28  Alexey Proskuryakov  <ap@apple.com>
+
+        Deflake animations/font-variations tests
+        https://bugs.webkit.org/show_bug.cgi?id=208383
+
+        Reviewed by Ryosuke Niwa.
+
+        Use document.fonts.ready to work around https://bugs.webkit.org/show_bug.cgi?id=208382,
+        and to simplify the tests.
+
+        * animations/font-variations/font-stretch.html:
+        * animations/font-variations/font-style.html:
+        * animations/font-variations/font-variation-settings-order.html:
+        * animations/font-variations/font-variation-settings-unlike.html:
+        * animations/font-variations/font-variation-settings.html:
+        * animations/font-variations/font-weight.html:
+
 2020-02-28  Myles C. Maxfield  <mmaxfield@apple.com>
 
         [ iOS wk2 Release ] fast/text-autosizing/ios/idempotentmode/viewport-change-relayout.html is flaky failing.
index 261ac0d..ef95558 100644 (file)
@@ -31,13 +31,7 @@ var expectedValues = [
     ["TheAnimation", 2.0, "box", "font-stretch", "183", 1],
 ];
 
-var promises = [];
-
-document.fonts.forEach(function(f) {
-    promises.push(f.loaded);
-});
-
-Promise.all(promises).then(function() {
+document.fonts.ready.then(function() {
     document.getElementById("box").style.animationName = "TheAnimation";
     runAnimationTest(expectedValues, undefined, undefined, undefined, false, undefined);
 });
index d939b64..89ecd8f 100644 (file)
@@ -31,13 +31,7 @@ var expectedValues = [
     ["TheAnimation", 2.0, "box", "font-style", "oblique 66.3333", 10],
 ];
 
-var promises = [];
-
-document.fonts.forEach(function(f) {
-    promises.push(f.loaded);
-});
-
-Promise.all(promises).then(function() {
+document.fonts.ready.then(function() {
     document.getElementById("box").style.animationName = "TheAnimation";
     runAnimationTest(expectedValues, undefined, undefined, undefined, false, undefined);
 });
index 3aca962..ea881ab 100644 (file)
@@ -35,13 +35,7 @@ var expectedValues = [
     ["TheAnimation", 2.0, "box", "font-variation-settings", "\"wdth\" 766.6666, \"hght\" 666.6666", 5],
 ];
 
-var promises = [];
-
-document.fonts.forEach(function(f) {
-    promises.push(f.loaded);
-});
-
-Promise.all(promises).then(function() {
+document.fonts.ready.then(function() {
     document.getElementById("box").style.animationName = "TheAnimation";
     runAnimationTest(expectedValues, undefined, undefined, undefined, false, undefined);
 });
index 941a1fc..ff90007 100644 (file)
@@ -37,11 +37,7 @@ var expectedValues = [
 
 var promises = [];
 
-document.fonts.forEach(function(f) {
-    promises.push(f.loaded);
-});
-
-Promise.all(promises).then(function() {
+document.fonts.ready.then(function() {
     document.getElementById("box").style.animationName = "TheAnimation";
     runAnimationTest(expectedValues, undefined, undefined, undefined, false, undefined);
 });
index 86ddefb..f62a2e1 100644 (file)
@@ -35,13 +35,7 @@ var expectedValues = [
     ["TheAnimation", 2.0, "box", "font-variation-settings", "\"wdth\" 733.3333", 5],
 ];
 
-var promises = [];
-
-document.fonts.forEach(function(f) {
-    promises.push(f.loaded);
-});
-
-Promise.all(promises).then(function() {
+document.fonts.ready.then(function() {
     document.getElementById("box").style.animationName = "TheAnimation";
     runAnimationTest(expectedValues, undefined, undefined, undefined, false, undefined);
 });
index 1ac90da..3b18327 100644 (file)
@@ -31,13 +31,7 @@ var expectedValues = [
     ["TheAnimation", 2.0, "box", "font-weight", "366.6666", 20],
 ];
 
-var promises = [];
-
-document.fonts.forEach(function(f) {
-    promises.push(f.loaded);
-});
-
-Promise.all(promises).then(function() {
+document.fonts.ready.then(function() {
     document.getElementById("box").style.animationName = "TheAnimation";
     runAnimationTest(expectedValues, undefined, undefined, undefined, false, undefined);
 });