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

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: Changes based on second code reviews 2 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..6b748e923680f054a7afc0b6734f43328dcfba0a
--- /dev/null
+++ b/LayoutTests/fast/canvas/canvas-toBlob-defaultpng.html
@@ -0,0 +1,27 @@
+<img id="myImg" onload="testDone()">
+<script src = "../../resources/js-test.js"></script>
xlai (Olivia) 2015/08/21 18:40:05 Using asynchronous testing from js-test testing fr
+<script type = 'text/javascript'>
+if (window.testRunner) {
+ testRunner.dumpAsTextWithPixelResults();
Justin Novosad 2015/08/21 18:53:43 This should not be a pixel test. We only use pixel
+ testRunner.waitUntilDone();
+}
+
+function testDone() {
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+
+var newImg = document.getElementById("myImg");
+var canvas = document.createElement("canvas");
+var ctx = canvas.getContext("2d");
+ctx.fillStyle = "#FF0000";
+ctx.fillRect(0, 0, 150, 75);
+
+canvas.toBlob(function(blob) {
+ url = URL.createObjectURL(blob);
+ newImg.src = url;
+});
+</script>
+</head>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698