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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-strokeText.html

Issue 2694703004: Use testharness.js instead of js-test.js in LayoutTests/fast/canvas tests. (Closed)
Patch Set: 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-overloads-strokeText.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-strokeText.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-strokeText.html
index ccdc0bcd3083c5c335195eb8e4250e4831868ed2..00518c6af42b72ca61a82f8601cf3901a773f527 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-strokeText.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-strokeText.html
@@ -1,9 +1,20 @@
-<!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-overloads-strokeText.js"></script>
+<script>
+var ctx = document.createElement('canvas').getContext('2d');
+
+function ExpectedMessage(num) {
+ return "\"TypeError: Failed to execute 'strokeText' on 'CanvasRenderingContext2D': 3 arguments required, but only " + num + " present.\"";
+}
+
+test(function(t) {
+ assert_throws(null, function() {ctx.strokeText();}, ExpectedMessage(0));
+ assert_throws(null, function() {ctx.strokeText('moo');}, ExpectedMessage(1));
+ assert_throws(null, function() {ctx.strokeText('moo',0);}, ExpectedMessage(2));
+ assert_equals(ctx.strokeText('moo',0,0), undefined);
+ assert_equals(ctx.strokeText('moo',0,0,0), undefined);
+ assert_equals(ctx.strokeText('moo',0,0,0,0), undefined);
+}, "Test the behavior of CanvasRenderingContext2D.strokeText() when called with different numbers of arguments.");
+</script>
</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698