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

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: Basic Callback version of toBlob function of HTMLCanvasElement Implemented 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 <script src = "../../resources/js-test.js"></ script>
3 <script type = 'text/javascript'>
4 if (window.testRunner)
5 testRunner.dumpAsText();
6
7 canvas = document.createElement("canvas");
Justin Novosad 2015/08/13 21:03:40 var canvas
xlai (Olivia) 2015/08/20 19:46:43 Done for this and elsewhere.
8 var ctx = canvas.getContext("2d");
9 ctx.fillStyle = "#FF0000";
10 ctx.fillRect(0, 0, 150, 75);
11
12 canvas.toBlob(function(blob) {
13 var newImg = document.createElement("img"),
Justin Novosad 2015/08/13 21:03:40 , -> ;
14 url = URL.createObjectURL(blob);
Justin Novosad 2015/08/13 21:03:39 indentation
15 newImg.onload = function()
16 {
17 // no longer need to read the blob so it's revoked
18 URL.revokeObjectURL(url);
Justin Novosad 2015/08/13 21:03:40 This will not be called because the test finishes
19 };
20 newImg.src = url;
21 document.body.appendChild(newImg);
22 });
23
24 function tryGetImageTag()
25 {
26 var tags = document.getElementsByTagName('img');
Justin Novosad 2015/08/13 21:03:40 you should just make newImg global and use it dire
27 if (typeof tags == = "undefined")
28 return "";
29 else if (typeof tags[0] == = "undefined")
30 return "";
31 else
32 return tags[0].src.substring(0, 9);
33 }
34
35 shouldBecomeEqual("tryGetImageTag()", "'blob:null'", function(){}, 1000);
Justin Novosad 2015/08/13 21:03:40 Can you explain what exactly this tests, why is th
36
37 if (window.testRunner)
38 testRunner.notifyDone();
Justin Novosad 2015/08/13 21:03:39 This belongs in the shouldBecomeEqual completion h
xlai (Olivia) 2015/08/20 19:46:43 Deleted this. Changed the shouldBecomeEqual to sho
39 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/canvas/canvas-toBlob-defaultpng-expected.txt » ('j') | Source/core/fileapi/File.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698