cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject spec commit: CB-7380 update tests for file URL
Date Tue, 26 Aug 2014 15:53:15 GMT
Repository: cordova-mobile-spec
Updated Branches:
  refs/heads/master 82c92e2f5 -> 25ce0e4a8


CB-7380 update tests for file URL

It was previously checking that a file URL would fail, but file URLs should
always be accepted otherwise local loading into the webview won't work. So
the file URL test was broken into 2 separate tests. The first was changed to
expect success on an empty whitelist against a file URL, and the pattern match
part of the original file URL test was put in a second (new) test to use
an HTTP URL.


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/25ce0e4a
Tree: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/tree/25ce0e4a
Diff: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/diff/25ce0e4a

Branch: refs/heads/master
Commit: 25ce0e4a8b4df629204a83ed958e19dcc92e5c26
Parents: 82c92e2
Author: Marcel Kinard <cmarcelk@gmail.com>
Authored: Tue Aug 26 11:45:19 2014 -0400
Committer: Marcel Kinard <cmarcelk@gmail.com>
Committed: Tue Aug 26 11:51:17 2014 -0400

----------------------------------------------------------------------
 www/autotest/tests/whitelist.tests.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/25ce0e4a/www/autotest/tests/whitelist.tests.js
----------------------------------------------------------------------
diff --git a/www/autotest/tests/whitelist.tests.js b/www/autotest/tests/whitelist.tests.js
index 2790d52..876d632 100644
--- a/www/autotest/tests/whitelist.tests.js
+++ b/www/autotest/tests/whitelist.tests.js
@@ -87,7 +87,8 @@ describe('Whitelist API (cordova.whitelist)', function () {
 
         itShouldMatch('file:///foo', ['file:///foo*']);
         itShouldMatch('file:///foo/bar.html', ['file:///foo*']);
-        itShouldNotMatch('file:///etc/foo', ['file:///foo*']);
+        itShouldMatch('file:///foo.html', [ ]);
+        itShouldNotMatch('http://www.apache.org/etc/foo', ['http://www.apache.org/foo*']);
         itShouldNotMatch('http://www.apache.org/foo', ['file:///foo*']);
 
         itShouldMatch('http://www.apache.org/', ['*://www.apache.org/*']);


Mime
View raw message