local storage: fixes test transformation from data-uri to blob
@Camata please run the grunt tasks before opening a merge request. Jslint doesn't validate the patch currently.
@romain completely my bad, I commited too soon, thanks! Fixed and here's the interdiff:
--- a/test/jio.storage/localstorage.tests.js +++ b/test/jio.storage/localstorage.tests.js @@ -2,7 +2,7 @@ /*global sessionStorage, localStorage, Blob, document, btoa, atob, Uint8Array, unescape, HTMLCanvasElement, XMLHttpRequest*/ (function (jIO, sessionStorage, localStorage, QUnit, Blob, document, - btoa, unescape, HTMLCanvasElement, XMLHttpRequest) { + btoa, unescape, HTMLCanvasElement) { "use strict"; var test = QUnit.test, stop = QUnit.stop, @@ -365,7 +365,7 @@ 'toBlob', { value: function (callback, type, quality) { - var byte_string, mime_string, ia, + var byte_string, ia, i, data_uri = this.toDataURL(type, quality); if (data_uri.split(',')[0].indexOf('base64') >= 0) { @@ -374,12 +374,9 @@ byte_string = unescape(data_uri.split(',')[1]); } - // separate out the mime component - mime_string = data_uri.split(',')[0].split(':')[1].split(';')[0]; - // write the bytes of the string to a typed array ia = new Uint8Array(byte_string.length); - for (var i = 0; i < byte_string.length; i++) { + for (i = 0; i < byte_string.length; i += 1) { ia[i] = byte_string.charCodeAt(i); } @@ -508,4 +505,4 @@ }); }(jIO, sessionStorage, localStorage, QUnit, Blob, document, - btoa, unescape, HTMLCanvasElement, XMLHttpRequest)); + btoa, unescape, HTMLCanvasElement));
Added 1 commit:
- 88dd3e06 - local storage: fixes test transformation from data-uri to blob
@romain fixed.
merged
Please register or sign in to reply