From ab19cc4fa788fb5589ffa04d338e311f68790df9 Mon Sep 17 00:00:00 2001 From: Dan Silivestru Date: Thu, 31 Jan 2013 14:44:19 -0500 Subject: [PATCH] Merged deprecated blobWriter fix and fixed tests Merged pull request from @maxme Fixed failing tests for changes made update the creation of a new Blob to include type setting --- lib/client/platform/cordova/2.0.0/bridge/file.js | 2 +- test/unit/client/cordova/file.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/client/platform/cordova/2.0.0/bridge/file.js b/lib/client/platform/cordova/2.0.0/bridge/file.js index 51cc8723..1bace5fe 100644 --- a/lib/client/platform/cordova/2.0.0/bridge/file.js +++ b/lib/client/platform/cordova/2.0.0/bridge/file.js @@ -247,7 +247,7 @@ module.exports = { sourcepath = cleanPath(sourcepath); // Create a blob for the text to be written - blob = new Blob([text]); + blob = new Blob([text], {type: "text/plain"}); // Get the FileEntry, create if necessary fs.root.getFile(sourcepath, {create: true}, function (entry) { diff --git a/test/unit/client/cordova/file.js b/test/unit/client/cordova/file.js index 4c9cf2a1..006bc463 100644 --- a/test/unit/client/cordova/file.js +++ b/test/unit/client/cordova/file.js @@ -138,6 +138,8 @@ describe("Cordova file bridge", function () { }); window.webkitResolveLocalFileSystemURL = webkitResolveLocalFileSystemURLSpy; + global.Blob = Blob; + window.WebKitBlobBuilder = function () { return { _blobBuffer: "",