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

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: 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 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..053023f13cc780701e2ba7bc12270b6715765f35
--- /dev/null
+++ b/LayoutTests/fast/canvas/canvas-toBlob-defaultpng.html
@@ -0,0 +1,32 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src = "../../resources/testharness.js"></script>
+<script src= "../../resources/testharnessreport.js"></script>
+<p>Test whether we can create object url from canvas.toBlob and put it in image</p>
+<script type = 'text/javascript'>
+var newImg;
+
+function tryTestToBlob()
+{
+ test(function() {
+ var canvas = document.createElement("canvas");
+ var ctx = canvas.getContext("2d");
+ ctx.fillStyle = "#FF0000";
+ ctx.fillRect(0, 0, 150, 75);
+
+ canvas.toBlob(function(blob) {
Justin Novosad 2015/08/20 20:38:42 This needs to be written as an asynchronous test.
+ newImg = document.createElement("img");
+ url = URL.createObjectURL(blob);
+ newImg.src = url;
+ document.body.appendChild(newImg);
+ assert_equals(newImg.src.substring(0, 9), "blob:null",
+ "The img is created as blob:null");
+ });
+ }, "toBlob function running successfully");
+}
+</script>
+</head>
+<body onload="tryTestToBlob()">
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698