Bug 1640663 [wpt PR 23091] - [2dcontext] Add a test for drawing an empty canvas to another canvas., a=testonly
authorJuFeng Zhang <zjffun@gmail.com>
Tue, 26 May 2020 11:15:40 +0000
changeset 532377 055b79d094712c756595e627c651cf30cad98b72
parent 532376 f435c8b5b184c4b8241a8ea61fe3a66293f9bf07
child 532378 d0e83d3b768080e481c489edcfc67407a213c377
push id37455
push userapavel@mozilla.com
push dateWed, 27 May 2020 21:33:21 +0000
treeherdermozilla-central@50d550c87f07 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1640663, 23091
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1640663 [wpt PR 23091] - [2dcontext] Add a test for drawing an empty canvas to another canvas., a=testonly Automatic update from web-platform-tests [2dcontext] Add a test for drawing an empty canvas to antoher canvas. (#23091) -- wpt-commits: 90926cc410763f112d35afac1891961e22f65a26 wpt-pr: 23091
testing/web-platform/tests/html/canvas/element/drawing-images-to-the-canvas/2d.drawImage.canvas.html
testing/web-platform/tests/html/canvas/tools/tests2d.yaml
--- a/testing/web-platform/tests/html/canvas/element/drawing-images-to-the-canvas/2d.drawImage.canvas.html
+++ b/testing/web-platform/tests/html/canvas/element/drawing-images-to-the-canvas/2d.drawImage.canvas.html
@@ -29,12 +29,19 @@ ctx2.fillRect(0, 0, 100, 50);
 ctx.fillStyle = '#f00';
 ctx.drawImage(canvas2, 0, 0);
 
 _assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2);
 _assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2);
 _assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2);
 _assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2);
 
+ctx.drawImage(document.createElement('canvas'), 0, 0);
+
+_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2);
+
 
 });
 </script>
 
--- a/testing/web-platform/tests/html/canvas/tools/tests2d.yaml
+++ b/testing/web-platform/tests/html/canvas/tools/tests2d.yaml
@@ -8881,16 +8881,23 @@
 
     ctx.fillStyle = '#f00';
     ctx.drawImage(canvas2, 0, 0);
 
     @assert pixel 0,0 ==~ 0,255,0,255;
     @assert pixel 99,0 ==~ 0,255,0,255;
     @assert pixel 0,49 ==~ 0,255,0,255;
     @assert pixel 99,49 ==~ 0,255,0,255;
+
+    ctx.drawImage(document.createElement('canvas'), 0, 0);
+
+    @assert pixel 0,0 ==~ 0,255,0,255;
+    @assert pixel 99,0 ==~ 0,255,0,255;
+    @assert pixel 0,49 ==~ 0,255,0,255;
+    @assert pixel 99,49 ==~ 0,255,0,255;
   expected: green
 
 - name: 2d.drawImage.self.1
   testing:
     - 2d.drawImage.self
   code: |
     ctx.fillStyle = '#0f0';
     ctx.fillRect(0, 0, 50, 50);