Skip to content
This repository has been archived by the owner on Sep 4, 2019. It is now read-only.

Commit

Permalink
This commit enhances the automated test suite available for testing
Browse files Browse the repository at this point in the history
webworks whitelisting.

It includes changes to the domains used by the test-app for the
whitelisting tests and updates the config.xml to have it pass.

It also includes several addional apps to test other aspects of
whitelisting that could not be done from a single app.

Additionally it includes some unit test additions to make sure we have
complete coverage.

Reviewed By: Jeffrey Heifetz <jheifetz@rim.com>
Tested By: Igor Shneur <ishneur@rim.com>
  • Loading branch information
sleroux authored and Jeffrey Heifetz committed Oct 31, 2012
1 parent 8783d1f commit c227981
Show file tree
Hide file tree
Showing 32 changed files with 11,652 additions and 561 deletions.
1 change: 1 addition & 0 deletions .jshintignore
Expand Up @@ -13,3 +13,4 @@ ext/blackberry.example.test
lib/pps/ppsUtils.js
lib/jnext.js
test/test-app
test/functional/Apps
59 changes: 59 additions & 0 deletions test/functional/Apps/ExternalStartup/config.xml
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<widget xmlns=" http://www.w3.org/ns/widgets"
xmlns:rim="http://www.blackberry.com/ns/widgets"
version="1.0.0"
id="ExternalStartup">

<name>External Domain Test</name>

<description>Tests cross domain requests with a external access uri domain</description>

<content src="http://smoketest-vmyyz.labyyz.testnet.rim.net:8080/external.html"/>

<author rim:copyright="Copyright 1998-2011 My Corp" email="hello.bob@blah.com" href="http://www.blah.com">Research In Motion Ltd.</author>

<access uri="http://smoketest-vmyyz.labyyz.testnet.rim.net/burger.png?*" />
<access uri="http://smoketest-vmyyz.labyyz.testnet.rim.net/favicon.ico" />
<access uri="http://smoketest-vmyyz.labyyz.testnet.rim.net/general_whitelisted.js?*" />
<access uri="http://smoketest-vmyyz.labyyz.testnet.rim.net/index.html" />
<access uri="http://smoketest-vmyyz.labyyz.testnet.rim.net/webapi_whitelisted.js?*" />
<access uri="http://smoketest-vmyyz.labyyz.testnet.rim.net/css" />
<access uri="http://smoketest-vmyyz.labyyz.testnet.rim.net/js" />
<access uri="http://smoketest-vmyyz.labyyz.testnet.rim.net/spec" />

<access uri="http://smoketest-vmyyz.labyyz.testnet.rim.net/js/helpers.js">
<feature id="blackberry.app" />
<feature id="blackberry.io" />
</access>

<access uri="http://smoketest-vmyyz.labyyz.testnet.rim.net/a/webworks.html">
<feature id="blackberry.app" />
</access>

<access uri="http://smoketest-vmyyz.labyyz.testnet.rim.net/external.html">
<feature id="blackberry.app" />
<feature id="blackberry.io" />
</access>

<feature id="blackberry.app" />

<access uri="file:///accounts/1000/shared/documents/textData.txt" />

<license href="http://www.apache.org/licenses/LICENSE-2.0">
Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
#http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and limitations under the License.
</license>

<rim:permissions>
<rim:permit>access_shared</rim:permit>
</rim:permissions>
</widget>

19 changes: 19 additions & 0 deletions test/functional/Apps/ExternalStartup/index.html
@@ -0,0 +1,19 @@
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Local External Startup Page</title>

<script type="text/javascript" src="local:///chrome/webworks.js"></script>
<script type="text/javascript">
function postBlackberryId(e) {
e.source.postMessage(blackberry.app.id, event.origin);
}

document.addEventListener('webworksready', function () {
// Post to parent to indicate we are ready
window.addEventListener('message', postBlackberryId, false);
parent.postMessage('wwready', "*");
});
</script>
</head>
</html>

0 comments on commit c227981

Please sign in to comment.