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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-2d-imageData-create-nonfinite.html

Issue 2671853004: Use testharness.js instead of js-test.js in LayoutTests/fast/canvas tests. (Closed)
Patch Set: Corrections 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-2d-imageData-create-nonfinite.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-2d-imageData-create-nonfinite.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-2d-imageData-create-nonfinite.html
index 382708fb25cf206b8b59af54ff322797ac19e439..4835c1a8bcb720721b0645308343215bad552be1 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-2d-imageData-create-nonfinite.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-2d-imageData-create-nonfinite.html
@@ -1,9 +1,17 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<script src="../../resources/js-test.js"></script>
-</head>
-<body>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
<canvas id="canvas" width=600 height=300>
-<script src="resources/canvas-2d-imageData-create-nonfinite.js"></script>
-</body>
+<script>
+test(function(t) {
+ var canvas = document.getElementById('canvas');
+ var ctx = canvas.getContext('2d');
+
+ assert_throws(null, function() {ctx.createImageData(Infinity, Infinity);}, "Failed to execute 'createImageData' on 'CanvasRenderingContext2D': The provided double value is non-finite..");
+ assert_throws(null, function() {ctx.createImageData(Infinity, 10);}, "Failed to execute 'createImageData' on 'CanvasRenderingContext2D': The provided double value is non-finite..");
+ assert_throws(null, function() {ctx.createImageData(-Infinity, 10);}, "Failed to execute 'createImageData' on 'CanvasRenderingContext2D': The provided double value is non-finite..");
+ assert_throws(null, function() {ctx.createImageData(10, Infinity);}, "Failed to execute 'createImageData' on 'CanvasRenderingContext2D': The provided double value is non-finite..");
+ assert_throws(null, function() {ctx.createImageData(10, -Infinity);}, "Failed to execute 'createImageData' on 'CanvasRenderingContext2D': The provided double value is non-finite..");
+ assert_throws(null, function() {ctx.createImageData(NaN, 10);}, "Failed to execute 'createImageData' on 'CanvasRenderingContext2D': The provided double value is non-finite..");
+ assert_throws(null, function() {ctx.createImageData(10, NaN);}, "Failed to execute 'createImageData' on 'CanvasRenderingContext2D': The provided double value is non-finite..");
+}, 'Test the argument bounds of canvas createImageData.');
+</script>

Powered by Google App Engine
This is Rietveld 408576698