Skip to content
Permalink
Browse files
[CB-4094] Add some new whitelist tests: Ports, credentials, custom pr…
…otocols
  • Loading branch information
clelland committed Jul 15, 2013
1 parent 9cc9b48 commit aba5de441ed5641caa4f9b761addf05d3590631a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
@@ -93,7 +93,22 @@ describe('Whitelist API (cordova.whitelist)', function () {
itShouldMatch('http://www.apache.org/', ['*://www.apache.org/*']);
itShouldMatch('https://www.apache.org/', ['*://www.apache.org/*']);
itShouldMatch('ftp://www.apache.org/', ['*://www.apache.org/*']);
itShouldMatch('file://www.apache.org/', ['*://www.apache.org/*']);
itShouldMatch('content://www.apache.org/', ['*://www.apache.org/*']);
itShouldMatch('foo://www.apache.org/', ['*://www.apache.org/*']);
itShouldNotMatch('http://www.apache.com/', ['*://www.apache.org/*']);

itShouldMatch('http://www.apache.org/', ['*.apache.org']);
itShouldMatch('https://www.apache.org/', ['*.apache.org']);
itShouldNotMatch('ftp://www.apache.org/', ['*.apache.org']);

itShouldMatch('http://www.apache.org:81/', ['http://www.apache.org:81/*']);
itShouldMatch('http://user:pass@www.apache.org:81/foo/bar.html', ['http://www.apache.org:81/*']);
itShouldNotMatch('http://www.apache.org:80/', ['http://www.apache.org:81/*']);
itShouldNotMatch('http://www.apache.org/', ['http://www.apache.org:81/*']);
itShouldNotMatch('http://www.apache.org:foo/', ['http://www.apache.org:81/*']);
itShouldNotMatch('http://www.apache.org:81@www.apache.org/', ['http://www.apache.org:81/*']);
itShouldNotMatch('http://www.apache.org:81@www.evil.com/', ['http://www.apache.org:81/*']);
});

describe("Test function", function() {
@@ -93,7 +93,22 @@ describe('Whitelist API (cordova.whitelist)', function () {
itShouldMatch('http://www.apache.org/', ['*://www.apache.org/*']);
itShouldMatch('https://www.apache.org/', ['*://www.apache.org/*']);
itShouldMatch('ftp://www.apache.org/', ['*://www.apache.org/*']);
itShouldMatch('file://www.apache.org/', ['*://www.apache.org/*']);
itShouldMatch('content://www.apache.org/', ['*://www.apache.org/*']);
itShouldMatch('foo://www.apache.org/', ['*://www.apache.org/*']);
itShouldNotMatch('http://www.apache.com/', ['*://www.apache.org/*']);

itShouldMatch('http://www.apache.org/', ['*.apache.org']);
itShouldMatch('https://www.apache.org/', ['*.apache.org']);
itShouldNotMatch('ftp://www.apache.org/', ['*.apache.org']);

itShouldMatch('http://www.apache.org:81/', ['http://www.apache.org:81/*']);
itShouldMatch('http://user:pass@www.apache.org:81/foo/bar.html', ['http://www.apache.org:81/*']);
itShouldNotMatch('http://www.apache.org:80/', ['http://www.apache.org:81/*']);
itShouldNotMatch('http://www.apache.org/', ['http://www.apache.org:81/*']);
itShouldNotMatch('http://www.apache.org:foo/', ['http://www.apache.org:81/*']);
itShouldNotMatch('http://www.apache.org:81@www.apache.org/', ['http://www.apache.org:81/*']);
itShouldNotMatch('http://www.apache.org:81@www.evil.com/', ['http://www.apache.org:81/*']);
});

describe("Test function", function() {

0 comments on commit aba5de4

Please sign in to comment.