You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2014/11/14 00:46:37 UTC

[1/3] cordova-plugin-file git commit: CB-7917 Made tests file.spec.114 - 116 pass for windows platform

Repository: cordova-plugin-file
Updated Branches:
  refs/heads/master f357d81d2 -> 82f803ea0


CB-7917 Made tests file.spec.114 - 116 pass for windows platform


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/commit/94029fb7
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/94029fb7
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/94029fb7

Branch: refs/heads/master
Commit: 94029fb7a2409d28d399c65ad50afe0c97aba30a
Parents: 8ef744d
Author: maria.bukharina <ma...@akvelon.com>
Authored: Fri Oct 31 15:54:56 2014 +0300
Committer: maria.bukharina <ma...@akvelon.com>
Committed: Fri Oct 31 15:54:56 2014 +0300

----------------------------------------------------------------------
 tests/tests.js | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/94029fb7/tests/tests.js
----------------------------------------------------------------------
diff --git a/tests/tests.js b/tests/tests.js
index 6d625b9..99fd46e 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -1,4 +1,4 @@
-/*
+/*
  *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements. See the NOTICE file
@@ -18,6 +18,8 @@
  *
  */
 exports.defineAutoTests = function () {
+    var isWindows = (cordova.platformId == "windows") || (navigator.appVersion.indexOf("MSAppHost/1.0") !== -1);
+
     describe('File API', function () {
         // Adding a Jasmine helper matcher, to report errors when comparing to FileError better.
         var fileErrorMap = {
@@ -2674,7 +2676,7 @@ exports.defineAutoTests = function () {
                     }, function (fileEntry) {
                         expect(fileEntry).toBeDefined();
                         expect(fileEntry.name).toBe(fileName);
-                        expect(fileEntry.fullPath).toCanonicallyMatch('/' + fileName);
+                        expect(fileEntry.fullPath).toCanonicallyMatch(root.fullPath +'/' + fileName);
                         // cleanup
                         deleteEntry(fileName);
                         done();
@@ -2722,14 +2724,19 @@ exports.defineAutoTests = function () {
             var pathExpect = cordova.platformId === 'windowsphone' ? "//nativ" : "file://";
             it("file.spec.114 fileEntry should have a toNativeURL method", function (done) {
                 var fileName = "native.file.uri";
+                if (isWindows) {
+                    var rootPath = root.fullPath;
+                    pathExpect = rootPath.substr(0, rootPath.indexOf(":"));
+                }
                 // create a new file entry
                 createFile(fileName, function (entry) {
                     expect(entry.toNativeURL).toBeDefined();
                     expect(entry.name).toCanonicallyMatch(fileName);
                     expect(typeof entry.toNativeURL).toBe('function');
                     var nativeURL = entry.toNativeURL();
+                    var indexOfRoot = isWindows ? rootPath.indexOf(":") : 7;
                     expect(typeof nativeURL).toBe("string");
-                    expect(nativeURL.substring(0, 7)).toEqual(pathExpect);
+                    expect(nativeURL.substring(0, indexOfRoot)).toEqual(pathExpect);
                     expect(nativeURL.substring(nativeURL.length - fileName.length)).toEqual(fileName);
                     // cleanup
                     deleteEntry(fileName);
@@ -2746,8 +2753,9 @@ exports.defineAutoTests = function () {
                     expect(entries[0].toNativeURL).toBeDefined();
                     expect(typeof entries[0].toNativeURL).toBe('function');
                     var nativeURL = entries[0].toNativeURL();
+                    var indexOfRoot = (isWindows) ? nativeURL.indexOf(":") : 7;
                     expect(typeof nativeURL).toBe("string");
-                    expect(nativeURL.substring(0, 7)).toEqual(pathExpect);
+                    expect(nativeURL.substring(0, indexOfRoot)).toEqual(pathExpect);
                     expect(nativeURL.substring(nativeURL.length - fileName.length)).toEqual(fileName);
                     // cleanup
                     directory.removeRecursively(null, null);
@@ -2774,8 +2782,9 @@ exports.defineAutoTests = function () {
                         expect(entry.name).toCanonicallyMatch(fileName);
                         expect(typeof entry.toNativeURL).toBe('function');
                         var nativeURL = entry.toNativeURL();
+                        var indexOfRoot = (isWindows) ? nativeURL.indexOf(":") : 7;
                         expect(typeof nativeURL).toBe("string");
-                        expect(nativeURL.substring(0, 7)).toEqual(pathExpect);
+                        expect(nativeURL.substring(0, indexOfRoot)).toEqual(pathExpect);
                         expect(nativeURL.substring(nativeURL.length - fileName.length)).toEqual(fileName);
                         // cleanup
                         deleteEntry(fileName);
@@ -2821,7 +2830,7 @@ exports.defineAutoTests = function () {
                 // create a new file entry
                 createFile(fileName, function (entry) {
                     resolveLocalFileSystemURL(entry.toNativeURL(), function (fileEntry) {
-                        expect(fileEntry.fullPath).toCanonicallyMatch("/" + fileName);
+                        expect(fileEntry.fullPath).toCanonicallyMatch(root.fullPath + "/" + fileName);
                         // cleanup
                         deleteEntry(fileName);
                         done();
@@ -2835,7 +2844,7 @@ exports.defineAutoTests = function () {
                     var url = entry.toNativeURL();
                     url = url.replace("///", "//localhost/");
                     resolveLocalFileSystemURL(url, function (fileEntry) {
-                        expect(fileEntry.fullPath).toCanonicallyMatch("/" + fileName);
+                        expect(fileEntry.fullPath).toCanonicallyMatch(root.fullPath + "/" + fileName);
                         // cleanup
                         deleteEntry(fileName);
                         done();
@@ -2849,7 +2858,7 @@ exports.defineAutoTests = function () {
                     var url = entry.toNativeURL();
                     url = url + "?test/test";
                     resolveLocalFileSystemURL(url, function (fileEntry) {
-                        expect(fileEntry.fullPath).toCanonicallyMatch("/" + fileName);
+                        expect(fileEntry.fullPath).toCanonicallyMatch(root.fullPath + "/" + fileName);
                         // cleanup
                         deleteEntry(fileName);
                         done();
@@ -2863,7 +2872,7 @@ exports.defineAutoTests = function () {
                     var url = entry.toNativeURL();
                     url = url.replace("///", "//localhost/") + "?test/test";
                     resolveLocalFileSystemURL(url, function (fileEntry) {
-                        expect(fileEntry.fullPath).toCanonicallyMatch("/" + fileName);
+                        expect(fileEntry.fullPath).toCanonicallyMatch(root.fullPath + "/" + fileName);
                         // cleanup
                         deleteEntry(fileName);
                         done();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[3/3] cordova-plugin-file git commit: Drop the BOM

Posted by pu...@apache.org.
Drop the BOM


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/commit/82f803ea
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/82f803ea
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/82f803ea

Branch: refs/heads/master
Commit: 82f803ea0d61cde051dcffd27b21dc0ed92a0fdf
Parents: 9b0d4da
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Nov 13 15:46:03 2014 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Nov 13 15:46:03 2014 -0800

----------------------------------------------------------------------
 tests/tests.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/82f803ea/tests/tests.js
----------------------------------------------------------------------
diff --git a/tests/tests.js b/tests/tests.js
index b91a64f..6c85e06 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -1,4 +1,4 @@
-/*
+/*
  *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements. See the NOTICE file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[2/3] cordova-plugin-file git commit: Merge branch 'CB-7917' of https://github.com/MSOpenTech/cordova-plugin-file

Posted by pu...@apache.org.
Merge branch 'CB-7917' of https://github.com/MSOpenTech/cordova-plugin-file


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/commit/9b0d4da9
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/9b0d4da9
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/9b0d4da9

Branch: refs/heads/master
Commit: 9b0d4da9419c7e710b5be10eb5925687c1b4a074
Parents: f357d81 94029fb
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Nov 13 15:44:14 2014 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Nov 13 15:44:14 2014 -0800

----------------------------------------------------------------------
 tests/tests.js | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/9b0d4da9/tests/tests.js
----------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org