cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject spec commit: [CB-4094] Add some new whitelist tests: Ports, credentials, custom protocols
Date Mon, 15 Jul 2013 14:53:22 GMT
Updated Branches:
  refs/heads/master 9cc9b4883 -> aba5de441


[CB-4094] Add some new whitelist tests: Ports, credentials, custom protocols


Project: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/commit/aba5de44
Tree: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/tree/aba5de44
Diff: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/diff/aba5de44

Branch: refs/heads/master
Commit: aba5de441ed5641caa4f9b761addf05d3590631a
Parents: 9cc9b48
Author: Ian Clelland <iclelland@chromium.org>
Authored: Mon Jul 15 10:26:59 2013 -0400
Committer: Ian Clelland <iclelland@chromium.org>
Committed: Mon Jul 15 10:52:13 2013 -0400

----------------------------------------------------------------------
 autotest/tests/whitelist.tests.js                    | 15 +++++++++++++++
 .../test/autotest/tests/whitelist.tests.js           | 15 +++++++++++++++
 2 files changed, 30 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/aba5de44/autotest/tests/whitelist.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/whitelist.tests.js b/autotest/tests/whitelist.tests.js
index b1021b2..6035191 100644
--- a/autotest/tests/whitelist.tests.js
+++ b/autotest/tests/whitelist.tests.js
@@ -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() {

http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/aba5de44/cordova-plugin-whitelist/test/autotest/tests/whitelist.tests.js
----------------------------------------------------------------------
diff --git a/cordova-plugin-whitelist/test/autotest/tests/whitelist.tests.js b/cordova-plugin-whitelist/test/autotest/tests/whitelist.tests.js
index b1021b2..6035191 100644
--- a/cordova-plugin-whitelist/test/autotest/tests/whitelist.tests.js
+++ b/cordova-plugin-whitelist/test/autotest/tests/whitelist.tests.js
@@ -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() {


Mime
View raw message