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

Side by Side Diff: LayoutTests/fast/canvas/canvas-toBlob-defaultpng.html

Issue 1257253004: [HTMLCanvasElement.toBlob] Default callback version without scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: A small change from thread safe bind to common bind based on Kinuko's review Created 5 years, 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 <script src = "../../resources/js-test.js"></script>
2 <script type = 'text/javascript'>
3 description("Test that verifies whether the image data survives the toBlob proce ss");
4
5 if (window.testRunner) {
6 testRunner.dumpAsText();
7 testRunner.waitUntilDone();
8 }
9
10 var canvas = document.createElement("canvas");
11 var ctx = canvas.getContext("2d");
12 ctx.fillStyle = "#FF0000";
13 ctx.fillRect(0, 0, 150, 75);
14 var canvas2 = document.createElement("canvas");
15 var ctx2 = canvas2.getContext("2d");
16
17 var newImg = new Image();
18 newImg.onload = function() {
19 ctx2.drawImage(newImg, 0, 0, 150, 75);
20 //Randomly pick a pixel to check whether they match
Noel Gordon 2015/08/28 08:53:47 This doesn't appear to be random pixel pick (it al
xlai (Olivia) 2015/08/28 19:54:19 Acknowledged for randomized pixel picking.
21 shouldBe('ctx.getImageData(0, 0, 150, 75).data[4]', 'ctx2.getImageData(0, 0, 150, 75).data[4]');
22 if (window.testRunner)
23 testRunner.notifyDone();
24 }
25
26 canvas.toBlob(function(blob) {
27 url = URL.createObjectURL(blob);
28 newImg.src = url;
29 });
30
31 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698