You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ia...@apache.org on 2014/10/30 20:37:40 UTC

spec commit: CB-7913: Remove whitelist tests from mobilespec

Repository: cordova-mobile-spec
Updated Branches:
  refs/heads/unplug-whitelist [created] 9a2655b43


CB-7913: Remove whitelist tests from mobilespec


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

Branch: refs/heads/unplug-whitelist
Commit: 9a2655b437bea6c8addc2bf2b4b0f118f701dcb4
Parents: 605d369
Author: Ian Clelland <ic...@chromium.org>
Authored: Thu Oct 30 15:37:23 2014 -0400
Committer: Ian Clelland <ic...@chromium.org>
Committed: Thu Oct 30 15:37:23 2014 -0400

----------------------------------------------------------------------
 .../src/android/WhitelistAPI.java               |  5 ---
 .../src/ios/CDVWhitelistAPI.h                   |  1 -
 .../src/ios/CDVWhitelistAPI.m                   | 11 ------
 .../test/autotest/tests/whitelist.tests.js      | 40 --------------------
 cordova-plugin-whitelist/www/whitelist.js       |  4 --
 5 files changed, 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/9a2655b4/cordova-plugin-whitelist/src/android/WhitelistAPI.java
----------------------------------------------------------------------
diff --git a/cordova-plugin-whitelist/src/android/WhitelistAPI.java b/cordova-plugin-whitelist/src/android/WhitelistAPI.java
index 1d67992..3ccf7ef 100644
--- a/cordova-plugin-whitelist/src/android/WhitelistAPI.java
+++ b/cordova-plugin-whitelist/src/android/WhitelistAPI.java
@@ -48,11 +48,6 @@ public class WhitelistAPI extends CordovaPlugin {
             boolean isAllowed = whitelist.isUrlWhiteListed(url);
             callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, isAllowed));
             return true;
-        } else if (action.equals("URLIsAllowed")) {
-            String url = args.getString(0);
-            boolean isAllowed = Config.isUrlWhiteListed(url);
-            callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, isAllowed));
-            return true;
         }
         return false;
     }

http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/9a2655b4/cordova-plugin-whitelist/src/ios/CDVWhitelistAPI.h
----------------------------------------------------------------------
diff --git a/cordova-plugin-whitelist/src/ios/CDVWhitelistAPI.h b/cordova-plugin-whitelist/src/ios/CDVWhitelistAPI.h
index 01b1028..463699a 100644
--- a/cordova-plugin-whitelist/src/ios/CDVWhitelistAPI.h
+++ b/cordova-plugin-whitelist/src/ios/CDVWhitelistAPI.h
@@ -24,6 +24,5 @@
 {}
 
 - (void)URLMatchesPatterns:(CDVInvokedUrlCommand*)command;
-- (void)URLIsAllowed:(CDVInvokedUrlCommand*)command;
 
 @end

http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/9a2655b4/cordova-plugin-whitelist/src/ios/CDVWhitelistAPI.m
----------------------------------------------------------------------
diff --git a/cordova-plugin-whitelist/src/ios/CDVWhitelistAPI.m b/cordova-plugin-whitelist/src/ios/CDVWhitelistAPI.m
index 13b89ee..bda8286 100644
--- a/cordova-plugin-whitelist/src/ios/CDVWhitelistAPI.m
+++ b/cordova-plugin-whitelist/src/ios/CDVWhitelistAPI.m
@@ -34,15 +34,4 @@
     [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
 }
 
-- (void)URLIsAllowed:(CDVInvokedUrlCommand*)command
-{
-    NSString *url = [command argumentAtIndex:0];
-
-    CDVWhitelist* whitelist = [(CDVViewController *)self.viewController whitelist];
-
-    bool isAllowed = [whitelist URLIsAllowed:[NSURL URLWithString:url]];
-    CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:isAllowed];
-    [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
-}
-
 @end

http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/9a2655b4/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 6035191..b6d22c2 100644
--- a/cordova-plugin-whitelist/test/autotest/tests/whitelist.tests.js
+++ b/cordova-plugin-whitelist/test/autotest/tests/whitelist.tests.js
@@ -111,44 +111,4 @@ describe('Whitelist API (cordova.whitelist)', function () {
         itShouldNotMatch('http://www.apache.org:81@www.evil.com/', ['http://www.apache.org:81/*']);
     });
 
-    describe("Test function", function() {
-        function expectTestWithResult(result) {
-            return (function(url, description) {
-                description = description || ((result ? "should accept " : "should reject ") + url);
-                it(description, function() {
-                    var cb = jasmine.createSpy();
-                    runs(function() {
-                        cordova.whitelist.test(url, cb);
-                    });
-                    waitsFor(function() { return cb.wasCalled; }, "success callback never called", Tests.TEST_TIMEOUT);
-                    runs(function() {
-                        expect(cb).toHaveBeenCalledWith(result);
-                    });
-                });
-            });
-        }
-
-        var itShouldAccept = expectTestWithResult(true);
-        var itShouldReject = expectTestWithResult(false);
-
-        it("should exist", function() {
-            expect(cordova.whitelist.test).toBeDefined();
-            expect(typeof cordova.whitelist.test).toBe("function");
-        });
-
-        itShouldAccept('http://apache.org');
-        itShouldAccept('http://apache.org/');
-        itShouldAccept('http://www.apache.org/');
-        itShouldAccept('http://www.apache.org/some/path');
-        itShouldAccept('http://some.domain.under.apache.org/');
-        itShouldAccept('http://user:pass@apache.org/');
-        itShouldAccept('http://user:pass@www.apache.org/');
-        itShouldAccept('https://www.apache.org/');
-        itShouldReject('ftp://www.apache.org/');
-        itShouldReject('http://www.apache.com/');
-        itShouldReject('http://www.apache.org:pass@evil.com/');
-        itShouldReject('http://www.apache.org.evil.com/');
-        itShouldAccept('file:///foo');
-        itShouldAccept('content:///foo');
-    });
 });

http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/9a2655b4/cordova-plugin-whitelist/www/whitelist.js
----------------------------------------------------------------------
diff --git a/cordova-plugin-whitelist/www/whitelist.js b/cordova-plugin-whitelist/www/whitelist.js
index b342c0f..614bc95 100644
--- a/cordova-plugin-whitelist/www/whitelist.js
+++ b/cordova-plugin-whitelist/www/whitelist.js
@@ -26,9 +26,5 @@ module.exports = {
     match: function(url, patterns, callback) {
         //argscheck.checkArgs('fF', 'Whitelist.match', arguments);
         exec(callback, callback, "WhitelistAPI", "URLMatchesPatterns", [url, patterns]);
-    },
-    test: function(url, callback) {
-        //argscheck.checkArgs('fF', 'Whitelist.test', arguments);
-        exec(callback, callback, "WhitelistAPI", "URLIsAllowed", [url]);
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org