summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/canvas
diff options
context:
space:
mode:
authorenne@chromium.org <enne@chromium.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538>2014-03-28 01:12:26 +0000
committerenne@chromium.org <enne@chromium.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538>2014-03-28 01:12:26 +0000
commit25ff2577ad3a7ce42f51c9de2d56bf83f6d178d2 (patch)
tree8ce0eb99d3441c46e51281e11662382a3d86199d /third_party/WebKit/LayoutTests/fast/canvas
parente01bb69dc56e4184c63e865e937081e555b54a63 (diff)
downloadchromium_src-25ff2577ad3a7ce42f51c9de2d56bf83f6d178d2.zip
chromium_src-25ff2577ad3a7ce42f51c9de2d56bf83f6d178d2.tar.gz
chromium_src-25ff2577ad3a7ce42f51c9de2d56bf83f6d178d2.tar.bz2
Remove repaint.js from layout tests
All of these tests don't seem to depend on minimizing repaints and are more trying to make sure that something has repainted. Therefore, change them all to just use rAF rather than repaint.js and make them pixel tests where applicable. BUG=345027 Review URL: https://codereview.chromium.org/207383002 git-svn-id: svn://svn.chromium.org/blink/trunk@170237 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Diffstat (limited to 'third_party/WebKit/LayoutTests/fast/canvas')
-rw-r--r--third_party/WebKit/LayoutTests/fast/canvas/canvas-as-image-incremental-repaint.html10
-rw-r--r--third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-fill-repaint.html11
-rw-r--r--third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-invalid-args.html2
-rw-r--r--third_party/WebKit/LayoutTests/fast/canvas/canvas-incremental-repaint-2.html10
-rw-r--r--third_party/WebKit/LayoutTests/fast/canvas/canvas-incremental-repaint.html26
-rw-r--r--third_party/WebKit/LayoutTests/fast/canvas/canvas-resize-after-paint-without-layout.html10
-rw-r--r--third_party/WebKit/LayoutTests/fast/canvas/drawImage-with-broken-image.html2
-rw-r--r--third_party/WebKit/LayoutTests/fast/canvas/setWidthResetAfterForcedRender.html10
8 files changed, 52 insertions, 29 deletions
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-as-image-incremental-repaint.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-as-image-incremental-repaint.html
index ae2be13..85b81b3 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-as-image-incremental-repaint.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-as-image-incremental-repaint.html
@@ -8,8 +8,12 @@
content: -webkit-canvas(squares);
}
</style>
- <script src="resources/repaint.js"></script>
+ <script src="../../resources/run-after-display.js"></script>
<script type="application/x-javascript">
+ if (window.testRunner) {
+ testRunner.dumpAsTextWithPixelResults();
+ testRunner.waitUntilDone();
+ }
function repaintTest()
{
var ctx = document.getCSSCanvasContext("2d", "squares", 300, 300);
@@ -19,10 +23,12 @@
ctx.fillStyle = "rgba(0, 0, 200, 0.5)";
ctx.fillRect (50, 50, 100, 100);
+ if (window.testRunner)
+ testRunner.notifyDone();
}
</script>
</head>
-<body onload="runRepaintTest()">
+<body onload="runAfterDisplay(repaintTest)">
<div></div>
</body>
</html>
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-fill-repaint.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-fill-repaint.html
index 71060e4..e72f9fd 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-fill-repaint.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-fill-repaint.html
@@ -1,13 +1,15 @@
<!doctype html>
-<script src="resources/repaint.js"></script>
-<body onload="runRepaintTest();">
+<script src="../../resources/run-after-display.js"></script>
+<body onload="runAfterDisplay(repaintTest);">
<canvas id="canvas-source-in" width="100" height="100"></canvas>
<canvas id="canvas-copy" width="100" height="100"></canvas>
<script>
var compositeTypes = ['source-in','copy'];
- if (window.testRunner)
+ if (window.testRunner) {
testRunner.dumpAsTextWithPixelResults();
+ testRunner.waitUntilDone();
+ }
for (i = 0; i < compositeTypes.length; i++) {
var canvas = document.getElementById('canvas-' + compositeTypes[i]);
@@ -25,7 +27,8 @@
ctx.fillStyle = '#00f';
ctx.fillRect(40, 40, 20, 20);
}
+ if (window.testRunner)
+ testRunner.notifyDone();
}
-
</script>
</body>
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-invalid-args.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-invalid-args.html
index 4787de4..e3bf13c 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-invalid-args.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-invalid-args.html
@@ -82,7 +82,7 @@ xhr.onload = function() {
}
var xhr2 = new XMLHttpRequest();
-xhr2.open("GET", 'resources/repaint.js');
+xhr2.open("GET", 'resources/shadow-offset.js');
xhr2.responseType = 'blob';
xhr2.send();
xhr2.onload = function() {
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-incremental-repaint-2.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-incremental-repaint-2.html
index 8ced65a..cf1add2 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-incremental-repaint-2.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-incremental-repaint-2.html
@@ -10,11 +10,12 @@
border: 20px solid black;
}
</style>
- <script src="resources/repaint.js"></script>
+ <script src="../../resources/run-after-display.js"></script>
<script type="text/javascript" charset="utf-8">
if (window.testRunner) {
testRunner.dumpAsTextWithPixelResults();
+ testRunner.waitUntilDone();
}
function repaintTest()
@@ -23,18 +24,19 @@
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'green';
-
ctx.save();
ctx.setTransform(1, 0, 0, 1, 50, 200);
// Test the the transform applies the matrix in the correct order.
ctx.transform(1, 0, 0, -1, 0, 0);
ctx.fillRect(0, 100, 200, 80);
ctx.restore();
+ if (window.testRunner) {
+ testRunner.notifyDone();
+ }
}
-
</script>
</head>
-<body onload="runRepaintTest()">
+<body onload="runAfterDisplay(repaintTest)">
<canvas id="canvas1"></canvas>
</body>
</html>
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-incremental-repaint.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-incremental-repaint.html
index 7e64d2e..e34ed3e 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-incremental-repaint.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-incremental-repaint.html
@@ -10,15 +10,16 @@
border: 20px solid black;
}
</style>
- <script src="resources/repaint.js"></script>
+ <script src="../../resources/run-after-display.js"></script>
<script type="text/javascript" charset="utf-8">
if (window.testRunner) {
testRunner.dumpAsTextWithPixelResults();
+ testRunner.waitUntilDone();
}
var appleImage;
-
+
function initializeCanvas()
{
var canvas = document.getElementById('canvas1');
@@ -41,7 +42,7 @@
ctx.fillStyle = 'black';
ctx.strokeStyle = 'green';
ctx.lineWidth = 12;
-
+
ctx.save();
ctx.scale(1.5, 0.8);
ctx.fillRect(30, 40, 70, 80);
@@ -62,7 +63,7 @@
// Test with stroke
canvas = document.getElementById('canvas3');
ctx = canvas.getContext('2d');
-
+
ctx.beginPath();
ctx.moveTo(100, 20);
ctx.bezierCurveTo(150, 20, 150, 120, 100, 120);
@@ -115,7 +116,7 @@
ctx.shadowColor = 'blue';
ctx.translate(60, 0);
ctx.drawImage(appleImage, 10, 10, 100, 100);
-
+
// clip test
canvas = document.getElementById('canvas8');
ctx = canvas.getContext('2d');
@@ -123,20 +124,20 @@
ctx.shadowOffsetY = 20;
ctx.shadowBlur = 40;
ctx.shadowColor = 'blue';
-
+
ctx.beginPath();
ctx.rect(50, 30, 80, 80);
ctx.closePath();
ctx.clip();
-
+
ctx.translate(40, 0);
ctx.drawImage(appleImage, 10, 10, 100, 100);
-
+
// ImageData test
canvas = document.getElementById('canvas9');
ctx = canvas.getContext('2d');
ctx.drawImage(appleImage, 10, 10, 100, 100);
-
+
var imageData = ctx.getImageData(15, 15, 90, 90);
// putImageData ignores shadow, transform and clip, but set the to test
@@ -150,15 +151,18 @@
ctx.clip();
ctx.putImageData(imageData, 150, 20);
+
+ if (window.testRunner)
+ testRunner.notifyDone();
}
-
+
function pageLoaded()
{
initializeCanvas();
appleImage = new Image();
appleImage.onload = function() {
- runRepaintTest();
+ runAfterDisplay(repaintTest);
}
appleImage.src = "resources/apple.gif";
}
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-resize-after-paint-without-layout.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-resize-after-paint-without-layout.html
index 306ab5c..c287029 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-resize-after-paint-without-layout.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-resize-after-paint-without-layout.html
@@ -12,23 +12,27 @@
height: 300px;
}
</style>
- <script src="resources/repaint.js"></script>
+ <script src="../../resources/run-after-display.js"></script>
<script>
- if (window.testRunner)
+ if (window.testRunner) {
testRunner.dumpAsTextWithPixelResults();
+ testRunner.waitUntilDone();
+ }
function runTest() {
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'red';
ctx.fillRect(0, 0, 300, 300);
- runRepaintTest();
+ runAfterDisplay(repaintTest);
}
function repaintTest() {
var canvas = document.getElementById('canvas');
// This changes the resolution of the canvas but keeps its layout size constant.
canvas.width = canvas.width / 2;
+ if (window.testRunner)
+ testRunner.notifyDone();
}
</script>
</head>
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/drawImage-with-broken-image.html b/third_party/WebKit/LayoutTests/fast/canvas/drawImage-with-broken-image.html
index 92b1778..3a9462cc 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/drawImage-with-broken-image.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/drawImage-with-broken-image.html
@@ -9,7 +9,7 @@
// Create an image with invalid data.
var invalidImage = new Image();
- invalidImage.src = 'resources/repaint.js';
+ invalidImage.src = 'resources/shadow-offset.js';
invalidImage.onerror = draw;
var ctx = document.createElement("canvas").getContext('2d');
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/setWidthResetAfterForcedRender.html b/third_party/WebKit/LayoutTests/fast/canvas/setWidthResetAfterForcedRender.html
index fa877cf..403176ad 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/setWidthResetAfterForcedRender.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/setWidthResetAfterForcedRender.html
@@ -2,20 +2,24 @@
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
-<script src="resources/repaint.js"></script>
+<script src="../../resources/run-after-display.js"></script>
<script>
-if (window.testRunner)
+if (window.testRunner) {
testRunner.dumpAsTextWithPixelResults();
+ testRunner.waitUntilDone();
+}
function repaintTest()
{
var canvas = document.getElementById('c1');
var offset = document.body.offsetLeft; // Forces layout
canvas.width = canvas.width; // Should wipe canvas clean
+ if (window.testRunner)
+ testRunner.notifyDone();
}
</script>
</head>
-<body onload="runRepaintTest();">
+<body onload="runAfterDisplay(repaintTest);">
<p><b>BUG ID:</b> <a href="https://bugs.webkit.org/show_bug.cgi?id=43341">Bugzilla bug 43341</a>
Setting canvas width after canvas already rendered resets canvas data appropriately, but doesn't repaint immediately.
<p id="success" style="background-color:palegreen; padding:3px;"><b>TEST PASS:</b>