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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/fontfaceset-css-change-in-callback.html

Issue 2629543004: Convert some fontfaceset tests to use jsharness (Closed)
Patch Set: Fix minor formatting issue Created 3 years, 10 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
Index: third_party/WebKit/LayoutTests/fast/css/fontfaceset-css-change-in-callback.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/fontfaceset-css-change-in-callback.html b/third_party/WebKit/LayoutTests/fast/css/fontfaceset-css-change-in-callback.html
index 28827ca0d5bed731a6f423dc60f83a48cc5969ec..89cc9255fb8b4f8c93dff1fc358b3562e62db87d 100644
--- a/third_party/WebKit/LayoutTests/fast/css/fontfaceset-css-change-in-callback.html
+++ b/third_party/WebKit/LayoutTests/fast/css/fontfaceset-css-change-in-callback.html
@@ -1,36 +1,27 @@
-<html>
-<head>
-<script src="../../resources/js-test.js"></script>
+<script src='../../resources/testharness.js'></script>
+<script src='../../resources/testharnessreport.js'></script>
+
<style>
@font-face {
font-family: 'ahem';
src: url(../../resources/Ahem.ttf);
}
</style>
-<script>
-description('Checks that adding CSS in callback of fonts.loadFont() does not cause a crash.');
-window.jsTestIsAsync = true;
+<script>
-function addCss() {
- var cssText = "@font-face { font-family: 'Courier New'; src: local('Courier New') }";
- var cssNode = document.createElement('style');
+promise_test(() => {
+ return document.fonts.load("12px ahem").then(() => {
+ let cssText = "@font-face { font-family: 'Courier New'; src: local('Courier New') }";
+ let cssNode = document.createElement('style');
cssNode.type = 'text/css';
- var head = document.getElementsByTagName('head')[0];
+ let head = document.getElementsByTagName('head')[0];
head.appendChild(cssNode);
- var cssTextNode = document.createTextNode(cssText);
+ let cssTextNode = document.createTextNode(cssText);
cssNode.appendChild(cssTextNode);
- finishJSTest();
-}
-if (document.fonts)
- document.fonts.load("12px ahem").then(addCss);
-else {
- testFailed('document.fonts does not exist');
- finishJSTest();
-}
+ });
+}, 'Checks that adding CSS in callback of fonts.loadFont() does not ' +
+ 'cause a crash.');
+
</script>
-</head>
-<body>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698