Skip to content

Commit e97fe90

Browse files
authored
test(android): fix tests to use cordova-android 10.x default https scheme (apache#518)
* test(android): fix tests to run on cordova-android 10.x that defaults to https scheme * style: add cordova to lint globals
1 parent ef301bc commit e97fe90

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

.eslintrc.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
root: true
22
extends: '@cordova/eslint-config/browser'
3+
globals:
4+
cordova: true
35

46
overrides:
5-
- files: [tests/**/*.js]
6-
extends: '@cordova/eslint-config/node-tests'
7+
- files: [tests/**/*.js]
8+
extends: '@cordova/eslint-config/node-tests'
9+
globals:
10+
cordova: true

tests/tests.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3435,9 +3435,14 @@ exports.defineAutoTests = function () {
34353435
/* These specs verify that FileEntries have a toNativeURL method
34363436
* which appears to be sane.
34373437
*/
3438-
var pathExpect = cordova.platformId === 'windowsphone' ? '//nativ' : 'file://'; // eslint-disable-line no-undef
3439-
3440-
if (isChrome) {
3438+
var pathExpect = 'file://';
3439+
3440+
if (cordova.platformId === 'android') {
3441+
// Starting from Cordova-Android 10.x, the app content is served from the https scheme
3442+
pathExpect = 'https://';
3443+
} else if (cordova.platformId === 'windowsphone') {
3444+
pathExpect = '//nativ';
3445+
} else if (isChrome) {
34413446
pathExpect = 'filesystem:http://';
34423447
}
34433448

0 commit comments

Comments
 (0)