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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-toBlob-invalid.html

Issue 1496683005: Make callback arg non-nullable on canvas.toBlob (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small correction Created 5 years 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/canvas/canvas-toBlob-invalid-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/canvas/canvas-toBlob-invalid.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-toBlob-invalid.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-toBlob-invalid.html
new file mode 100644
index 0000000000000000000000000000000000000000..c4633f273419f458f2126c1a95c83018b7f7c9c7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-toBlob-invalid.html
@@ -0,0 +1,18 @@
+<script src="../../resources/js-test.js"></script>
+<script type='text/javascript'>
+description("Test the handling of invalid arguments in canvas toBlob().");
+
+var canvas = document.createElement('canvas');
+var ctx = canvas.getContext("2d");
+ctx.strokeStyle = "red";
+ctx.strokeRect(0, 0, 50, 50);
+
+shouldThrow("canvas.toBlob();");
+shouldThrow("canvas.toBlob(null);");
+shouldThrow("canvas.toBlob(undefined);");
Noel Gordon 2015/12/11 01:01:45 The way it's going, we should add shouldThrow("c
+// Passing the callback argument without blob handle silently fails.
+shouldNotThrow("canvas.toBlob(function() {});");
+
+// Invalid quality argument will fall back to default value
+shouldNotThrow("canvas.toBlob(function(blob) {}, 'image/jpeg', 500)");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/canvas/canvas-toBlob-invalid-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698