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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-toBlob-invalid.js

Issue 1496683005: Make callback arg non-nullable on canvas.toBlob (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding layout test 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 unified diff | Download patch
OLDNEW
(Empty)
1 description("Test the handling of invalid arguments in canvas toBlob().");
2
3 var canvas = document.createElement('canvas');
4 var ctx = canvas.getContext("2d");
5 ctx.strokeStyle = "red";
6 ctx.strokeRect(0, 0, 50, 50);
7
8 shouldThrow("canvas.toBlob();");
9 shouldThrow("canvas.toBlob(null);");
10 shouldThrow("canvas.toBlob(undefined);");
11 // Passing the callback argument without blob handle silently fails.
12 shouldNotThrow("canvas.toBlob(function() {});");
13
14 // Invalid quality argument will fall back to default value
15 shouldNotThrow("canvas.toBlob(function(blob) {}, 'image/jpeg', 500)");
16
17
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698