You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by kn...@apache.org on 2019/03/08 06:37:07 UTC

[cordova-plugin-file] branch travis_tests updated: add some logs

This is an automated email from the ASF dual-hosted git repository.

knaito pushed a commit to branch travis_tests
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-file.git


The following commit(s) were added to refs/heads/travis_tests by this push:
     new 9d455d8  add some logs
9d455d8 is described below

commit 9d455d8ef96f08c0c149a36fde684afcce588c5d
Author: knaito <kn...@asial.co.jp>
AuthorDate: Fri Mar 8 15:36:36 2019 +0900

    add some logs
---
 src/browser/FileProxy.js | 8 ++++++++
 tests/tests.js           | 6 +++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/browser/FileProxy.js b/src/browser/FileProxy.js
index 66ad46b..a88f0f7 100644
--- a/src/browser/FileProxy.js
+++ b/src/browser/FileProxy.js
@@ -511,6 +511,7 @@
         };
 
         exports.resolveLocalFileSystemURI = function (successCallback, errorCallback, args) {
+            window.customLog('log', 'resolveLocalFileSystemURI is called');
             var path = args[0];
 
             // Ignore parameters
@@ -529,6 +530,7 @@
                 }
                 return;
             }
+            window.customLog('log', 'resolveLocalFileSystemURI is called step 1');
 
             // support for cdvfile
             if (path.trim().substr(0, 7) === 'cdvfile') {
@@ -555,6 +557,8 @@
                 }
             }
 
+            window.customLog('log', 'resolveLocalFileSystemURI is called step 2');
+
             // to avoid path form of '///path/to/file'
             function handlePathSlashes (path) {
                 var cutIndex = 0;
@@ -567,12 +571,15 @@
                 return path.substr(cutIndex);
             }
 
+            window.customLog('log', 'resolveLocalFileSystemURI is called step 3 : ' + path);
+
             // Handle localhost containing paths (see specs )
             if (path.indexOf('file://localhost/') === 0) {
                 path = path.replace('file://localhost/', 'file:///');
             }
 
             if (path.indexOf(pathsPrefix.dataDirectory) === 0) {
+                window.customLog('log', 'resolveLocalFileSystemURI is called step 4');
                 path = path.substring(pathsPrefix.dataDirectory.length - 1);
                 path = handlePathSlashes(path);
 
@@ -583,6 +590,7 @@
                     }, [pathsPrefix.dataDirectory, path, {create: false}]);
                 }, errorCallback, [LocalFileSystem.PERSISTENT]);
             } else if (path.indexOf(pathsPrefix.cacheDirectory) === 0) {
+                window.customLog('log', 'resolveLocalFileSystemURI is called step 5');
                 path = path.substring(pathsPrefix.cacheDirectory.length - 1);
                 path = handlePathSlashes(path);
 
diff --git a/tests/tests.js b/tests/tests.js
index ff1f939..edc22bb 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -33,7 +33,7 @@ exports.defineAutoTests = function () {
     /* eslint-enable no-undef */
     var MEDIUM_TIMEOUT = 15000;
 
-    var customLog = function (eventName, eventObject) {
+    window.customLog = function (eventName, eventObject) {
         window._jasmineParamedicProxyCache.push({
             eventName: eventName,
             eventObject: eventObject
@@ -320,8 +320,8 @@ exports.defineAutoTests = function () {
                         deleteEntry(fileName, done);
                     };
                     createFile(fileName, function (entry) {
-                        customLog('log', '----- entry.toURL() ----');
-                        customLog('log', entry.toURL());
+                        window.customLog('log', '----- entry.toURL() ----');
+                        window.customLog('log', entry.toURL());
                         window.resolveLocalFileSystemURL(entry.toURL(), win, failed.bind(null, done, 'window.resolveLocalFileSystemURL - Error resolving file URL: ' + entry.toURL()));
                     }, failed.bind(null, done, 'createFile - Error creating file: ' + fileName), failed.bind(null, done, 'createFile - Error creating file: ' + fileName));
                 });


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