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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-fillText.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-fillText.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-fillText.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-fillText.html
index bd56d77c296f70d489fcff8261acdcaf27a408d3..5ac45dbfbf8603c2e064c8233a7fb2cdd1585a60 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-fillText.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-fillText.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-fillText.js"></script>
+<script>
+var ctx = document.createElement('canvas').getContext('2d');
+
+function ExpectedNotEnoughArgumentsMessage(num) {
+ return "\"TypeError: Failed to execute 'fillText' on 'CanvasRenderingContext2D': 3 arguments required, but only " + num + " present.\"";
+}
+
+test(function(t) {
+ assert_throws(null, function() {ctx.fillText();}, ExpectedNotEnoughArgumentsMessage(0));
+ assert_throws(null, function() {ctx.fillText('moo');}, ExpectedNotEnoughArgumentsMessage(1));
+ assert_throws(null, function() {ctx.fillText('moo',0);}, ExpectedNotEnoughArgumentsMessage(2));
+ assert_equals(ctx.fillText('moo',0,0), undefined);
+ assert_equals(ctx.fillText('moo',0,0,0), undefined);
+ assert_equals(ctx.fillText('moo',0,0,0,0), undefined);
+}, "Test the behavior of CanvasRenderingContext2D.fillText() when called with different numbers of arguments.");
+</script>
</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698