You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by er...@apache.org on 2022/03/30 07:19:10 UTC

[cordova-plugin-file] branch master updated: test(android): fix tests to use cordova-android 10.x default https scheme (#518)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new e97fe90  test(android): fix tests to use cordova-android 10.x default https scheme (#518)
e97fe90 is described below

commit e97fe9044fe4f8bfb1d934b285f739665a3efdf9
Author: エリス <er...@users.noreply.github.com>
AuthorDate: Wed Mar 30 16:19:05 2022 +0900

    test(android): fix tests to use cordova-android 10.x default https scheme (#518)
    
    * test(android): fix tests to run on cordova-android 10.x that defaults to https scheme
    * style: add cordova to lint globals
---
 .eslintrc.yml  |  8 ++++++--
 tests/tests.js | 11 ++++++++---
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/.eslintrc.yml b/.eslintrc.yml
index 902048d..b6f153d 100644
--- a/.eslintrc.yml
+++ b/.eslintrc.yml
@@ -1,6 +1,10 @@
 root: true
 extends: '@cordova/eslint-config/browser'
+globals:
+  cordova: true
 
 overrides:
-    - files: [tests/**/*.js]
-      extends: '@cordova/eslint-config/node-tests'
+  - files: [tests/**/*.js]
+    extends: '@cordova/eslint-config/node-tests'
+    globals:
+      cordova: true
diff --git a/tests/tests.js b/tests/tests.js
index 80862c3..b442cd9 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -3435,9 +3435,14 @@ exports.defineAutoTests = function () {
             /* These specs verify that FileEntries have a toNativeURL method
              * which appears to be sane.
              */
-            var pathExpect = cordova.platformId === 'windowsphone' ? '//nativ' : 'file://'; // eslint-disable-line no-undef
-
-            if (isChrome) {
+            var pathExpect = 'file://';
+
+            if (cordova.platformId === 'android') {
+                // Starting from Cordova-Android 10.x, the app content is served from the https scheme
+                pathExpect = 'https://';
+            } else if (cordova.platformId === 'windowsphone') {
+                pathExpect = '//nativ';
+            } else if (isChrome) {
                 pathExpect = 'filesystem:http://';
             }
 

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