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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-font-ex-units-crash.html

Issue 2676493005: Use testharness.js instead of js-test.js in LayoutTests/fast/canvas tests. (Closed)
Patch Set: Addressing comments 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/canvas/canvas-font-ex-units-crash.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-font-ex-units-crash.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-font-ex-units-crash.html
index 7f08156e619b730b5f586e445ea7ce60ac32ffdd..014ebeb5e5eacd95e34909c1a277c4e23e25e61f 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-font-ex-units-crash.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-font-ex-units-crash.html
@@ -1,9 +1,17 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src="../../resources/js-test.js"></script>
-</head>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
<body>
-<script src="script-tests/canvas-font-ex-units-crash.js"></script>
+<script>
+test(function(t) {
+ ctx = document.createElement('canvas').getContext('2d');
+
+ ctx.font = "5ex sans-serif";
+
+ size = parseInt(ctx.font.substr(0, 2));
+ family = ctx.font.substr(5);
+
+ assert_approx_equals(size, 25, 10);
+ assert_equals(family, 'sans-serif');
+}, "Test that setting a font with size in 'ex' units doesn't crash.");
+</script>
</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698