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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/webfont/fontfaceset-status-attribute.html

Issue 2340273002: Fix FontFaceSet state getting stuck at loading (Closed)
Patch Set: Created 4 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 | third_party/WebKit/LayoutTests/http/tests/webfont/fontfaceset-status-attribute-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/webfont/fontfaceset-status-attribute-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698