Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ios): allow changing WebView read access when loading local file #11431

Merged
merged 6 commits into from Jan 23, 2020

Conversation

vijaysingh-axway
Copy link
Contributor

/* eslint no-unused-expressions: "off" */
'use strict';
var should = require('./utilities/assertions'),
utilities = require('./utilities/utilities');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ tests/Resources/ti.ui.webview.addontest.js line 11 – 'utilities' is assigned a value but never used. (no-unused-vars)

@build
Copy link
Contributor

build commented Jan 14, 2020

Fails
🚫 Tests have failed, see below for more information.
Messages
📖

💾 Here's the generated SDK zipfile.

📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.
📖 ❌ 2 tests have failed There are 2 tests failing and 701 skipped out of 7250 total tests.

Tests:

ClassnameNameTimeError
ios.ipad.Titanium.UI#fetchSemanticColor() (13.2.2)0.04
Error: expected Object {} to be '#ff1f1f'
fail@file:///Users/build/Library/Developer/CoreSimulator/Devices/480970E5-608F-4ABF-9DFE-32A4D2DCE2C8/data/Containers/Bundle/Application/94DD963E-6502-4DD8-82B9-8777D8EB32ED/mocha.app/node_modules/should/cjs/should.js:275:19
value@file:///Users/build/Library/Developer/CoreSimulator/Devices/480970E5-608F-4ABF-9DFE-32A4D2DCE2C8/data/Containers/Bundle/Application/94DD963E-6502-4DD8-82B9-8777D8EB32ED/mocha.app/node_modules/should/cjs/should.js:356:13
file:///Users/build/Library/Developer/CoreSimulator/Devices/480970E5-608F-4ABF-9DFE-32A4D2DCE2C8/data/Containers/Bundle/Application/94DD963E-6502-4DD8-82B9-8777D8EB32ED/mocha.app/ti.ui.test.js:221:52
file:///Users/build/Library/Developer/CoreSimulator/Devices/480970E5-608F-4ABF-9DFE-32A4D2DCE2C8/data/Containers/Bundle/Application/94DD963E-6502-4DD8-82B9-8777D8EB32ED/mocha.app/ti-mocha.js:6535:54167
file:///Users/build/Library/Developer/CoreSimulator/Devices/480970E5-608F-4ABF-9DFE-32A4D2DCE2C8/data/Containers/Bundle/Application/94DD963E-6502-4DD8-82B9-8777D8EB32ED/mocha.app/ti-mocha.js:6535:58607
file:///Users/build/Library/Developer/CoreSimulator/Devices/480970E5-608F-4ABF-9DFE-32A4D2DCE2C8/data/Containers/Bundle/Application/94DD963E-6502-4DD8-82B9-8777D8EB32ED/mocha.app/ti-mocha.js:6535:59452
next@file:///Users/build/Library/Developer/CoreSimulator/Devices/480970E5-608F-4ABF-9DFE-32A4D2DCE2C8/data/Containers/Bundle/Application/94DD963E-6502-4DD8-82B9-8777D8EB32ED/mocha.app/ti-mocha.js:6535:58015
file:///Users/build/Library/Developer/CoreSimulator/Devices/480970E5-608F-4ABF-9DFE-32A4D2DCE2C8/data/Containers/Bundle/Application/94DD963E-6502-4DD8-82B9-8777D8EB32ED/mocha.app/ti-mocha.js:6535:57979
next@file:///Users/build/Library/Developer/CoreSimulator/Devices/480970E5-608F-4ABF-9DFE-32A4D2DCE2C8/data/Containers/Bundle/Application/94DD963E-6502-4DD8-82B9-8777D8EB32ED/mocha.app/ti-mocha.js:6535:57667
file:///Users/build/Library/Developer/CoreSimulator/Devices/480970E5-608F-4ABF-9DFE-32A4D2DCE2C8/data/Containers/Bundle/Application/94DD963E-6502-4DD8-82B9-8777D8EB32ED/mocha.app/ti-mocha.js:6535:57763
timeslice@file:///Users/build/Library/Developer/CoreSimulator/Devices/480970E5-608F-4ABF-9DFE-32A4D2DCE2C8/data/Containers/Bundle/Application/94DD963E-6502-4DD8-82B9-8777D8EB32ED/mocha.app/ti-mocha.js:5764:23
ios.iphone.Titanium.UI#fetchSemanticColor() (13.2.2)0.002
Error: expected Object {} to be '#ff1f1f'
fail@file:///Users/build/Library/Developer/CoreSimulator/Devices/78D44998-B0DB-4017-8E11-0835A88D2333/data/Containers/Bundle/Application/0CC935BD-9C4D-490F-9261-B21E1ECF2AE6/mocha.app/node_modules/should/cjs/should.js:275:19
value@file:///Users/build/Library/Developer/CoreSimulator/Devices/78D44998-B0DB-4017-8E11-0835A88D2333/data/Containers/Bundle/Application/0CC935BD-9C4D-490F-9261-B21E1ECF2AE6/mocha.app/node_modules/should/cjs/should.js:356:13
file:///Users/build/Library/Developer/CoreSimulator/Devices/78D44998-B0DB-4017-8E11-0835A88D2333/data/Containers/Bundle/Application/0CC935BD-9C4D-490F-9261-B21E1ECF2AE6/mocha.app/ti.ui.test.js:221:52
file:///Users/build/Library/Developer/CoreSimulator/Devices/78D44998-B0DB-4017-8E11-0835A88D2333/data/Containers/Bundle/Application/0CC935BD-9C4D-490F-9261-B21E1ECF2AE6/mocha.app/ti-mocha.js:6535:54167
file:///Users/build/Library/Developer/CoreSimulator/Devices/78D44998-B0DB-4017-8E11-0835A88D2333/data/Containers/Bundle/Application/0CC935BD-9C4D-490F-9261-B21E1ECF2AE6/mocha.app/ti-mocha.js:6535:58607
file:///Users/build/Library/Developer/CoreSimulator/Devices/78D44998-B0DB-4017-8E11-0835A88D2333/data/Containers/Bundle/Application/0CC935BD-9C4D-490F-9261-B21E1ECF2AE6/mocha.app/ti-mocha.js:6535:59452
next@file:///Users/build/Library/Developer/CoreSimulator/Devices/78D44998-B0DB-4017-8E11-0835A88D2333/data/Containers/Bundle/Application/0CC935BD-9C4D-490F-9261-B21E1ECF2AE6/mocha.app/ti-mocha.js:6535:58015
file:///Users/build/Library/Developer/CoreSimulator/Devices/78D44998-B0DB-4017-8E11-0835A88D2333/data/Containers/Bundle/Application/0CC935BD-9C4D-490F-9261-B21E1ECF2AE6/mocha.app/ti-mocha.js:6535:57979
next@file:///Users/build/Library/Developer/CoreSimulator/Devices/78D44998-B0DB-4017-8E11-0835A88D2333/data/Containers/Bundle/Application/0CC935BD-9C4D-490F-9261-B21E1ECF2AE6/mocha.app/ti-mocha.js:6535:57667
file:///Users/build/Library/Developer/CoreSimulator/Devices/78D44998-B0DB-4017-8E11-0835A88D2333/data/Containers/Bundle/Application/0CC935BD-9C4D-490F-9261-B21E1ECF2AE6/mocha.app/ti-mocha.js:6535:57763
timeslice@file:///Users/build/Library/Developer/CoreSimulator/Devices/78D44998-B0DB-4017-8E11-0835A88D2333/data/Containers/Bundle/Application/0CC935BD-9C4D-490F-9261-B21E1ECF2AE6/mocha.app/ti-mocha.js:5764:23

Generated by 🚫 dangerJS against fc92192

@janvennemann
Copy link
Contributor

@vijaysingh-axway I was wondering, how does the Unit test verify the new property? I don't see any test HTML files or anything that actually try to load something from a parent directory for example that require assetsDirectory to be set. It just listens for the load event, but that would have worked before as well, wouldn't it?

@vijaysingh-axway
Copy link
Contributor Author

@janvennemann Updated unit test.

tests/Resources/ti.ui.webview.addontest.js Show resolved Hide resolved
var resourceDir = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory);

var htmlFile = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'html', 'example.html');
var cssFile = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'folder with spaces', 'comingSoon.html');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a CSS file, update the variable name to avoid confusion.

var cssFile = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'folder with spaces', 'comingSoon.html');

var htmlInCache = Ti.Filesystem.getFile(cacheDir.nativePath, 'html', 'example.html');
var cssInCache = Ti.Filesystem.getFile(cacheDir.nativePath, 'folder with spaces', 'comingSoon.html');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also not a CSS file, update the variable name to avoid confusion.

/* eslint-env mocha */
/* eslint no-unused-expressions: "off" */
'use strict';
var should = require('./utilities/assertions'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ tests/Resources/ti.ui.webview.addontest.js line 10 – 'should' is assigned a value but never used. (no-unused-vars)

@tidev tidev deleted a comment from janvennemann Jan 21, 2020
@lokeshchdhry
Copy link
Contributor

FR Passed.

Studio Ver: 6.0.0.201911251516
SDK Ver: 9.0.0 local build
OS Ver: 10.14.5
Xcode Ver: Xcode 11.3
Appc NPM: 4.2.15
Appc CLI: 7.1.2
Daemon Ver: 1.1.3
Ti CLI Ver: 5.2.2
Alloy Ver: 1.14.4
Node Ver: 12.13.1
NPM Ver: 6.12.1
Java Ver: 11.0.1
IOS Devices: ⇨ iPhone 13.3

@sgtcoolguy sgtcoolguy merged commit dd7b319 into tidev:master Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants