www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 7ccf781add1eedcb57c3b4073672e6d9cb8d1224
parent 8812fd4401d77b138b2544420cde603f28bcda88
Author: Dan Stillman <dstillman@zotero.org>
Date:   Thu,  2 Mar 2017 15:30:32 -0500

Firefox 52 compatibility

Diffstat:
Mchrome/content/zotero/xpcom/storage/webdav.js | 2+-
Mchrome/content/zotero/xpcom/storage/zfs.js | 2+-
Mtest/tests/zfsTest.js | 13++++++++++++-
3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/chrome/content/zotero/xpcom/storage/webdav.js b/chrome/content/zotero/xpcom/storage/webdav.js @@ -520,7 +520,7 @@ Zotero.Sync.Storage.Mode.WebDAV.prototype = { var file = Zotero.getTempDirectory(); file.append(item.key + '.zip'); Components.utils.importGlobalProperties(["File"]); - file = new File(file); + file = File.createFromFileName ? File.createFromFileName(file.path) : new File(file); var uri = this._getItemURI(item); diff --git a/chrome/content/zotero/xpcom/storage/zfs.js b/chrome/content/zotero/xpcom/storage/zfs.js @@ -612,7 +612,7 @@ Zotero.Sync.Storage.Mode.ZFS.prototype = { var file = yield this._getUploadFile(item); Components.utils.importGlobalProperties(["File"]); - file = new File(file); + file = File.createFromFileName ? File.createFromFileName(file.path) : new File(file); var blob = new Blob([params.prefix, file, params.suffix]); diff --git a/test/tests/zfsTest.js b/test/tests/zfsTest.js @@ -392,7 +392,18 @@ describe("Zotero.Sync.Storage.Mode.ZFS", function () { // Upload single file to S3 else if (req.method == "POST" && req.url == baseURL + "pretend-s3/1") { assert.equal(req.requestHeaders["Content-Type"], contentType1 + fixSinonBug); - assert.equal(req.requestBody.size, (new Blob([prefix1, new File(file1), suffix1]).size)); + assert.equal( + req.requestBody.size, + (new Blob( + [ + prefix1, + File.createFromFileName + ? File.createFromFileName(file1.path) + : new File(file1), + suffix1 + ] + ).size) + ); req.respond(201, {}, ""); } // Upload multi-file ZIP to S3