From 92c57a0f24826722311b9ca50f93ad33711b8438 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Fri, 29 Oct 2010 10:00:21 -0700 Subject: [PATCH] Added toDataURL() test for other formats --- test/canvas.test.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/canvas.test.js b/test/canvas.test.js index e4f4b5f..2e7d33e 100644 --- a/test/canvas.test.js +++ b/test/canvas.test.js @@ -570,6 +570,15 @@ module.exports = { + 'AAABJRU5ErkJggg=='; assert.equal(str, canvas.toDataURL(), 'Canvas#toDataURL() failed'); + assert.equal(str, canvas.toDataURL('image/png'), 'Canvas#toDataURL() failed'); + + var err; + try { + canvas.toDataURL('image/jpeg'); + } catch (e) { + err = e; + } + assert.equal('currently only image/png is supported', err.message); }, 'test PNGStream': function(assert, beforeExit){