Skip to content
This repository has been archived by the owner on May 13, 2021. It is now read-only.

Commit

Permalink
Changed manifest transformations for Windows 10 Hosted Apps. By defau…
Browse files Browse the repository at this point in the history
…lt, WindowsRuntimeAccess attribute of ACUR rules is set to 'all' if no access type is specified in mjs_api_access
  • Loading branch information
mrodriguez committed Nov 19, 2015
1 parent 00abe4b commit 831e57d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/platformUtils/windows10Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function replaceManifestValues(w3cManifestInfo, content) {
return false;
}

tryAddAcurToList(acurList, { match: apiRule.match, runtimeAccess: apiRule.access });
tryAddAcurToList(acurList, { match: apiRule.match, runtimeAccess: apiRule.access || 'all' });
});
}

Expand Down
36 changes: 36 additions & 0 deletions test/manifestTools/transformations/windows10.js
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,42 @@ describe('transformation: Windows 10 Manifest', function () {
});
});

it('Should add ACUR from mjs_api_access with default access type \'all\' if no access type is specified', function (done) {
var siteUrl = 'http://url.com/something?query';
var shortName = 'shortName';

var originalManifestInfo = {
content: {
'start_url': siteUrl,
'short_name': shortName,
'mjs_api_access': [
{ 'match': 'http://url.com/somepath/', 'platform': 'windows10'}
]
}
};

transformation.convertFromBase(originalManifestInfo, function (err, result) {
should.not.exist(err);
should.exist(result);
/*jshint -W030 */
result.should.have.property('content').which.is.an.Object;
result.should.have.property('format', 'windows10');

var manifest = result.content;

manifest.should.have.property('rawData');

var expectedContentUriRules = '<uap:ApplicationContentUriRules>' +
'<uap:Rule Type="include" WindowsRuntimeAccess="none" Match="http://url.com/" />' +
'<uap:Rule Type="include" WindowsRuntimeAccess="all" Match="http://url.com/somepath/" />' +
'</uap:ApplicationContentUriRules>';

manifest.rawData.replace(/[\t\r\n]/g, '').indexOf(expectedContentUriRules).should.be.above(-1);

done();
});
});

it('Should not add ACUR from mjs_api_access if windows10 is not in platform', function (done) {
var siteUrl = 'http://url.com/something?query';
var shortName = 'shortName';
Expand Down

0 comments on commit 831e57d

Please sign in to comment.