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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/canvas/canvas-toBlob-defaultpng.html
diff --git a/LayoutTests/fast/canvas/canvas-toBlob-defaultpng.html b/LayoutTests/fast/canvas/canvas-toBlob-defaultpng.html
new file mode 100644
index 0000000000000000000000000000000000000000..69f9b9a95d2960f8ce0c1ad23fdfa04811fb138e
--- /dev/null
+++ b/LayoutTests/fast/canvas/canvas-toBlob-defaultpng.html
@@ -0,0 +1,39 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<script src = "../../resources/js-test.js"></ script>
+<script type = 'text/javascript'>
+if (window.testRunner)
+ testRunner.dumpAsText();
+
+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.
+var ctx = canvas.getContext("2d");
+ctx.fillStyle = "#FF0000";
+ctx.fillRect(0, 0, 150, 75);
+
+canvas.toBlob(function(blob) {
+ var newImg = document.createElement("img"),
Justin Novosad 2015/08/13 21:03:40 , -> ;
+ url = URL.createObjectURL(blob);
Justin Novosad 2015/08/13 21:03:39 indentation
+ newImg.onload = function()
+ {
+ // no longer need to read the blob so it's revoked
+ URL.revokeObjectURL(url);
Justin Novosad 2015/08/13 21:03:40 This will not be called because the test finishes
+ };
+ newImg.src = url;
+ document.body.appendChild(newImg);
+});
+
+function tryGetImageTag()
+{
+ var tags = document.getElementsByTagName('img');
Justin Novosad 2015/08/13 21:03:40 you should just make newImg global and use it dire
+ if (typeof tags == = "undefined")
+ return "";
+ else if (typeof tags[0] == = "undefined")
+ return "";
+ else
+ return tags[0].src.substring(0, 9);
+}
+
+shouldBecomeEqual("tryGetImageTag()", "'blob:null'", function(){}, 1000);
Justin Novosad 2015/08/13 21:03:40 Can you explain what exactly this tests, why is th
+
+if (window.testRunner)
+ 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
+</script>
« 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