Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/webfont/fontfaceset-status-attribute.html |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/webfont/fontfaceset-status-attribute.html b/third_party/WebKit/LayoutTests/http/tests/webfont/fontfaceset-status-attribute.html |
| index 7f9d95aafc84deb2ea83cfb67fb5e96bdfd6f3fd..f94214b20df01eb6136146e1ec00cdb199ccbb53 100644 |
| --- a/third_party/WebKit/LayoutTests/http/tests/webfont/fontfaceset-status-attribute.html |
| +++ b/third_party/WebKit/LayoutTests/http/tests/webfont/fontfaceset-status-attribute.html |
| @@ -1,42 +1,37 @@ |
| -<html> |
| -<head> |
| -<script src="../../js-test-resources/js-test.js"></script> |
| +<!DOCTYPE html> |
|
Takashi Toyoshima
2016/09/16 05:40:50
I slightly prefer to keep the original test case (
Kunihiko Sakamoto
2016/09/20 02:27:25
Done.
|
| <style> |
| @font-face { |
| font-family: 'TestFont'; |
| src: url(slow-ahem-loading.cgi); |
| } |
| </style> |
| +<style id="RemoveMe"> |
| + @font-face { |
| + font-family: 'TestFont2'; |
| + src: url(slow-ahem-loading.cgi?2); |
| + } |
| +</style> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| <script> |
| -description('Test for FontFaceSet.status attribute'); |
| - |
| -window.jsTestIsAsync = true; |
| -function runTests() { |
| - shouldBeFalse("document.fonts.check('10px TestFont')"); |
| - shouldBeEqualToString("document.fonts.status", "loaded"); |
| - document.fonts.load('10px TestFont').then(onsuccess); |
| - shouldBeEqualToString("document.fonts.status", "loading"); |
| -} |
| +promise_test(function(t) { |
| + assert_false(document.fonts.check('10px TestFont')); |
| + assert_equals(document.fonts.status, "loaded"); |
| + var loadPromise = document.fonts.load('10px TestFont'); |
| + document.fonts.load('10px TestFont2'); |
| + assert_equals(document.fonts.status, "loading"); |
| -function onsuccess() { |
| - shouldBeTrue("document.fonts.check('10px TestFont')"); |
| - document.fonts.ready.then(onFontsReady); |
| -} |
| + var style = document.getElementById('RemoveMe'); |
| + style.parentNode.removeChild(style); |
| -function onFontsReady() { |
| - shouldBeEqualToString("document.fonts.status", "loaded"); |
| - finishJSTest(); |
| -} |
| + return loadPromise |
| + .then(function() { |
| + assert_true(document.fonts.check('10px TestFont')); |
| + return document.fonts.ready; |
| + }).then(function() { |
| + assert_equals(document.fonts.status, "loaded"); |
| + }); |
| +}, 'FontFaceSet.status attribute'); |
| -if (document.fonts) |
| - runTests(); |
| -else { |
| - testFailed('document.fonts does not exist'); |
| - finishJSTest(); |
| -} |
| </script> |
| -</head> |
| -<body> |
| -</body> |
| -</html> |