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

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

Issue 2681423002: Use testharness.js instead of js-test.js in LayoutTests/fast/canvas tests. (Closed)
Patch Set: Adding exceptions to TestExpectations 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-largedraws.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-largedraws.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-largedraws.html
index a5f1bc88485dce3acab22809808e1f2c1f095de2..f69ef6a0e6bea323cb177a2352d05a1149d2c0df 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-largedraws.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-largedraws.html
@@ -1,47 +1,49 @@
-<!DOCTYPE html>
-<html>
- <body>
- <script>
- if (window.testRunner)
- testRunner.dumpAsText();
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
- function newCanvasContext() {
- canvas = document.createElement("canvas");
- canvas.width = 100;
- canvas.height = 100;
- return canvas.getContext("2d");
- }
+<script>
+function newCanvasContext() {
+ canvas = document.createElement("canvas");
+ canvas.width = 100;
+ canvas.height = 100;
+ return canvas.getContext("2d");
+}
- window.onload = function () {
- ctx = newCanvasContext();
- ctx.fillStyle = '#0f0';
- ctx.fillRect(0, 0, 100, 50);
- ctx.moveTo(10500000000, 10500000000);
- ctx.lineTo(110, -10);
- ctx.lineTo(-10, 60);
- ctx.fill();
- ctx.getImageData(50, 25, 1, 1);
+function runTest() {
+ ctx = newCanvasContext();
+ ctx.fillStyle = '#0f0';
+ ctx.fillRect(0, 0, 100, 50);
+ ctx.moveTo(10500000000, 10500000000);
+ ctx.lineTo(110, -10);
+ ctx.lineTo(-10, 60);
+ ctx.fill();
+ ctx.getImageData(50, 25, 1, 1);
- ctx = newCanvasContext();
- ctx.fillStyle = '#0f0';
- ctx.scale(4500000000, 4500000000);
- ctx.moveTo(0, 0.5);
- ctx.lineTo(2, 0.5);
- ctx.stroke();
- ctx.getImageData(50, 25, 1, 1);
+ ctx = newCanvasContext();
+ ctx.fillStyle = '#0f0';
+ ctx.scale(4500000000, 4500000000);
+ ctx.moveTo(0, 0.5);
+ ctx.lineTo(2, 0.5);
+ ctx.stroke();
+ ctx.getImageData(50, 25, 1, 1);
- ctx = newCanvasContext();
- ctx.fillStyle = '#0f0';
- ctx.fillRect(0, 0, 100, 50);
- ctx.scale(2, -4500000000);
- ctx.arc(25, 50, 56, 0, 2*Math.PI, false);
- ctx.fill();
- ctx.arc(105000000005, -105000000005, 105000000004, 0, 10500000000*Math.PI, false);
- ctx.fill();
- ctx.getImageData(50, 25, 1, 1);
- }
- </script>
- PASS: Draw commands with big numbers cause no problems.
- </body>
-</html>
+ ctx = newCanvasContext();
+ ctx.fillStyle = '#0f0';
+ ctx.fillRect(0, 0, 100, 50);
+ ctx.scale(2, -4500000000);
+ ctx.arc(25, 50, 56, 0, 2*Math.PI, false);
+ ctx.fill();
+ ctx.arc(105000000005, -105000000005, 105000000004, 0, 10500000000*Math.PI, false);
+ ctx.fill();
+ ctx.getImageData(50, 25, 1, 1);
+}
+
+async_test(t => {
+ window.onload = function() {
+ t.step(runTest);
+ t.done();
+ }
+}, 'Draw commands with big numbers cause no problems.');
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698