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

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: Modifications based on feedback from Patch Set 3 including Layout Tests and Rebaseline of Mac and Win Created 5 years, 4 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 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src = "../../resources/testharness.js"></script>
5 <script src= "../../resources/testharnessreport.js"></script>
6 <p>Test whether we can create object url from canvas.toBlob and put it in image< /p>
7 <script type = 'text/javascript'>
8 var newImg;
9
10 function tryTestToBlob()
11 {
12 test(function() {
13 var canvas = document.createElement("canvas");
14 var ctx = canvas.getContext("2d");
15 ctx.fillStyle = "#FF0000";
16 ctx.fillRect(0, 0, 150, 75);
17
18 canvas.toBlob(function(blob) {
Justin Novosad 2015/08/20 20:38:42 This needs to be written as an asynchronous test.
19 newImg = document.createElement("img");
20 url = URL.createObjectURL(blob);
21 newImg.src = url;
22 document.body.appendChild(newImg);
23 assert_equals(newImg.src.substring(0, 9), "blob:null",
24 "The img is created as blob:null");
25 });
26 }, "toBlob function running successfully");
27 }
28 </script>
29 </head>
30 <body onload="tryTestToBlob()">
31 </body>
32 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698