cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [1/3] spec commit: CB-8131 Rewrote non plugin auto tests for Jasmine 2.0 (close #113)
Date Sun, 18 Jan 2015 02:14:58 GMT
Repository: cordova-mobile-spec
Updated Branches:
  refs/heads/master 5ef89275f -> 16019c59b


http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/16019c59/www/autotest/tests/localXHR.tests.js
----------------------------------------------------------------------
diff --git a/www/autotest/tests/localXHR.tests.js b/www/autotest/tests/localXHR.tests.js
deleted file mode 100644
index 19847a9..0000000
--- a/www/autotest/tests/localXHR.tests.js
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- *
-*/
-
-describe("XMLHttpRequest", function () {
-
-    var createXHR = function (url, bAsync, win, lose) {
-        var xhr = new XMLHttpRequest();
-        xhr.open("GET", url, bAsync);
-        xhr.onload = win;
-        xhr.onerror = lose;
-        xhr.send();
-        return xhr;
-    }
-
-        it("XMLHttpRequest.spec.1 should exist", function () {
-            expect(window.XMLHttpRequest).toBeDefined();
-            expect(window.XMLHttpRequest.UNSENT).toBe(0);
-            expect(window.XMLHttpRequest.OPENED).toBe(1);
-            expect(window.XMLHttpRequest.HEADERS_RECEIVED).toBe(2);
-            expect(window.XMLHttpRequest.LOADING).toBe(3);
-            expect(window.XMLHttpRequest.DONE).toBe(4);
-        });
-
-        it("XMLHttpRequest.spec.2 should be able to create new XHR", function () {
-
-        	var xhr = new XMLHttpRequest();
-        	expect(xhr).toBeDefined();
-
-    // abort
-        	expect(xhr.abort).toBeDefined();
-        	expect(typeof xhr.abort == 'function').toBe(true);
-
-    // getResponseHeader
-        	expect(xhr.getResponseHeader).toBeDefined();
-        	expect(typeof xhr.getResponseHeader == 'function').toBe(true);
-
-    // getAllResponseHeaders
-        	expect(xhr.getAllResponseHeaders).toBeDefined();
-        	expect(typeof xhr.getAllResponseHeaders == 'function').toBe(true);
-
-    // overrideMimeType
-        	expect(xhr.overrideMimeType).toBeDefined();
-        	expect(typeof xhr.overrideMimeType == 'function').toBe(true);
-        	return;
-    // open
-        	expect(xhr.open).toBeDefined();
-        	expect(typeof xhr.open == 'function').toBe(true);
-    // send
-        	expect(xhr.send).toBeDefined();
-        	expect(typeof xhr.send == 'function').toBe(true);
-    // setRequestHeader
-        	expect(xhr.setRequestHeader).toBeDefined();
-        	expect(typeof xhr.setRequestHeader == 'function').toBe(true);
-        });
-
-        it("XMLHttpRequest.spec.2 should be able to load the current page", function () {
-            var win = jasmine.createSpy().andCallFake(function (res) {});
-            var lose = createDoNotCallSpy('xhrFail');
-            var xhr = createXHR("localXHR.html", true, win, lose);
-            waitsForAny(win, lose);
-
-        });
-
-        it("XMLHttpRequest.spec.9 calls onload from successful http get", function () {
-            var win = jasmine.createSpy().andCallFake(function (res) { });
-            var lose = createDoNotCallSpy('xhrFail');
-            var xhr = createXHR("http://cordova-filetransfer.jitsu.com", true, win, lose);
-            waitsForAny(win, lose);
-        });
-
-        it("XMLHttpRequest.spec.3 should be able to load the current page", function () {
-            var win = jasmine.createSpy().andCallFake(function (res) {});
-            var lose = createDoNotCallSpy('xhrFail');
-            var xhr = createXHR(window.location.href, true, win, lose);
-            waitsForAny(win, lose);
-        });
-
-        it("XMLHttpRequest.spec.4 should be able to load the parent folder page ../index.html",
function () {
-            var win = jasmine.createSpy().andCallFake(function (res) {});
-            var lose = createDoNotCallSpy('xhrFail');
-            var xhr = createXHR("../index.html", true, win, lose);
-            waitsForAny(win, lose);
-        });
-
-        it("XMLHttpRequest.spec.5 should be able to load the current page ./???.html", function
() {
-            var win = jasmine.createSpy().andCallFake(function (res) { });
-            var lose = createDoNotCallSpy('xhrFail');
-            var fileName = window.location.href.split('#')[0].split('/').pop();
-            var xhr = createXHR("./" + fileName, true, win, lose);
-            waitsForAny(win, lose);
-        });
-
-        it("XMLHttpRequest.spec.6 should be able to load the current page with hash-part
added", function () {
-            var win = jasmine.createSpy().andCallFake(function (res) { });
-            var lose = createDoNotCallSpy('xhrFail');
-            var fileName = window.location.href + "#asd/asd/asdasd";
-            var xhr = createXHR(fileName, true, win, lose);
-            waitsForAny(win, lose);
-        });
-
-    it("XMLHttpRequest.spec.10 overlapping async calls are not muxed", function () {
-
-        var order = "";
-
-        var winA = jasmine.createSpy("spyWinA").andCallFake(function(){
-            order += "A";  
-        });
-        var winB = jasmine.createSpy("spyWinB").andCallFake(function(){
-            order += "B";  
-        });
-        var lose = createDoNotCallSpy('xhrFail');
-        var fileName = window.location.href.split('#')[0].split('/').pop();
-        createXHR(fileName, true, winA, lose);
-        createXHR(fileName, false, winB, lose);
-
-        waitsFor(function () {
-            return lose.wasCalled ||
-                (winA.wasCalled && winB.wasCalled);
-        }, "Expecting both callbacks to be called.", Tests.TEST_TIMEOUT);
-
-        runs(function () {
-            expect(lose).not.toHaveBeenCalled();
-            expect(winA).toHaveBeenCalled();
-            expect(winB).toHaveBeenCalled();
-            console.log("order = " + order);
-        });
-    });
-
-
-});
-
-// only add these tests if we are testing on windows phone
-
-if (/Windows Phone/.exec(navigator.userAgent)) {
-
-    var createXHR = function (url, bAsync, win, lose) {
-        var xhr = new XMLHttpRequest();
-        xhr.open("GET", url, bAsync);
-        xhr.onload = win;
-        xhr.onerror = lose;
-        xhr.send();
-        return xhr;
-    }
-
-    describe("XMLHttpRequest Windows Phone", function () {
-
-        console.log("running special windows tests");
-        it("XMLHttpRequest.spec.7 should be able to load the (WP8 backwards compatability)
root page www/index.html", function () {
-            var win = jasmine.createSpy().andCallFake(function (res) { });
-            var lose = createDoNotCallSpy('xhrFail');
-            var xhr = createXHR("www/index.html", true, win, lose);
-            waitsForAny(win, lose);
-        });
-
-        it("XMLHttpRequest.spec.8 should be able to load the (WP7 backwards compatability)
root page app/www/index.html", function () {
-            var win = jasmine.createSpy().andCallFake(function (res) { });
-            var lose = createDoNotCallSpy('xhrFail');
-            var xhr = createXHR("app/www/index.html", true, win, lose);
-            waitsForAny(win, lose);
-        });
-
-        it("XMLHttpRequest.spec.11 should be able to load the current page using window.location
with extra / [CB-6299]", function () {
-            var path = window.location.protocol + "/" + window.location.toString().substr(window.location.protocol.length);
-            var win = jasmine.createSpy().andCallFake(function (res) { });
-            var lose = createDoNotCallSpy('xhrFail');
-            var xhr = createXHR(path, true, win, lose);
-            waitsForAny(win, lose);
-        });
-
-    });
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/16019c59/www/autotest/tests/platform.tests.js
----------------------------------------------------------------------
diff --git a/www/autotest/tests/platform.tests.js b/www/autotest/tests/platform.tests.js
deleted file mode 100644
index 4a1c1a4..0000000
--- a/www/autotest/tests/platform.tests.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- *
-*/
-
-describe('Platform (cordova)', function () {
-    it("platform.spec.1 should exist", function() {
-        expect(cordova).toBeDefined();
-    });
-
-    it("platform.spec.2 exec method should exist", function() {
-        expect(cordova.exec).toBeDefined();
-        expect(typeof cordova.exec).toBe('function');
-    });
-});

http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/16019c59/www/autotest/tests/storage.tests.js
----------------------------------------------------------------------
diff --git a/www/autotest/tests/storage.tests.js b/www/autotest/tests/storage.tests.js
deleted file mode 100644
index 4f4bd5b..0000000
--- a/www/autotest/tests/storage.tests.js
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- *
-*/
-
-describe("Session Storage", function () {
-    it("storage.spec.1 should exist", function () {
-        expect(window.sessionStorage).toBeDefined();
-        expect(typeof window.sessionStorage.length).not.toBe('undefined');
-        expect(typeof(window.sessionStorage.key)).toBe('function');
-        expect(typeof(window.sessionStorage.getItem)).toBe('function');
-        expect(typeof(window.sessionStorage.setItem)).toBe('function');
-        expect(typeof(window.sessionStorage.removeItem)).toBe('function');
-        expect(typeof(window.sessionStorage.clear)).toBe('function');
-    });
-
-    it("storage.spec.2 check length", function () {
-        expect(window.sessionStorage.length).toBe(0);
-        window.sessionStorage.setItem("key","value");
-        expect(window.sessionStorage.length).toBe(1);
-        window.sessionStorage.removeItem("key");   
-        expect(window.sessionStorage.length).toBe(0);
-    });
-
-    it("storage.spec.3 check key", function () {
-        expect(window.sessionStorage.key(0)).toBe(null);
-        window.sessionStorage.setItem("test","value");
-        expect(window.sessionStorage.key(0)).toBe("test");
-        window.sessionStorage.removeItem("test");   
-        expect(window.sessionStorage.key(0)).toBe(null);
-    });
-
-    it("storage.spec.4 check getItem", function() {
-        expect(window.sessionStorage.getItem("item")).toBe(null);
-        window.sessionStorage.setItem("item","value");
-        expect(window.sessionStorage.getItem("item")).toBe("value");
-        window.sessionStorage.removeItem("item");   
-        expect(window.sessionStorage.getItem("item")).toBe(null);
-    });
-
-    it("storage.spec.5 check setItem", function() {
-        expect(window.sessionStorage.getItem("item")).toBe(null);
-        window.sessionStorage.setItem("item","value");
-        expect(window.sessionStorage.getItem("item")).toBe("value");
-        window.sessionStorage.setItem("item","newval");
-        expect(window.sessionStorage.getItem("item")).toBe("newval");
-        window.sessionStorage.removeItem("item");   
-        expect(window.sessionStorage.getItem("item")).toBe(null);
-    });
-
-    it("storage.spec.6 can remove an item", function () {
-        expect(window.sessionStorage.getItem("item")).toBe(null);
-        window.sessionStorage.setItem("item","value");
-        expect(window.sessionStorage.getItem("item")).toBe("value");
-        window.sessionStorage.removeItem("item");   
-        expect(window.sessionStorage.getItem("item")).toBe(null);
-    });
-
-    it("storage.spec.7 check clear", function() {
-        window.sessionStorage.setItem("item1","value");
-        window.sessionStorage.setItem("item2","value");
-        window.sessionStorage.setItem("item3","value");
-        expect(window.sessionStorage.length).toBe(3);
-        window.sessionStorage.clear();
-        expect(window.sessionStorage.length).toBe(0);
-    });
-
-    it("storage.spec.8 check dot notation", function() {
-        expect(window.sessionStorage.item).not.toBeDefined();
-        window.sessionStorage.item = "value";
-        expect(window.sessionStorage.item).toBe("value");
-        window.sessionStorage.removeItem("item");   
-        expect(window.sessionStorage.item).not.toBeDefined();
-    });
-
-    describe("Local Storage", function () {
-        it("storage.spec.9 should exist", function() {
-            expect(window.localStorage).toBeDefined();
-            expect(window.localStorage.length).toBeDefined();
-            expect(typeof window.localStorage.key).toBe("function");
-            expect(typeof window.localStorage.getItem).toBe("function");
-            expect(typeof window.localStorage.setItem).toBe("function");
-            expect(typeof window.localStorage.removeItem).toBe("function");
-            expect(typeof window.localStorage.clear).toBe("function");
-        });  
-
-        it("storage.spec.10 check length", function() {
-            expect(window.localStorage.length).toBe(0);
-            window.localStorage.setItem("key","value");
-            expect(window.localStorage.length).toBe(1);
-            window.localStorage.removeItem("key");   
-            expect(window.localStorage.length).toBe(0);
-        });
-
-        it("storage.spec.11 check key", function() {
-            expect(window.localStorage.key(0)).toBe(null);
-            window.localStorage.setItem("test","value");
-            expect(window.localStorage.key(0)).toBe("test");
-            window.localStorage.removeItem("test");   
-            expect(window.localStorage.key(0)).toBe(null);
-        });
-
-        it("storage.spec.4 check getItem", function() {
-            expect(window.localStorage.getItem("item")).toBe(null);
-            window.localStorage.setItem("item","value");
-            expect(window.localStorage.getItem("item")).toBe("value");
-            window.localStorage.removeItem("item");   
-            expect(window.localStorage.getItem("item")).toBe(null);
-        });
-
-        it("storage.spec.5 check setItem", function() {
-            expect(window.localStorage.getItem("item")).toBe(null);
-            window.localStorage.setItem("item","value");
-            expect(window.localStorage.getItem("item")).toBe("value");
-            window.localStorage.setItem("item","newval");
-            expect(window.localStorage.getItem("item")).toBe("newval");
-            window.localStorage.removeItem("item");   
-            expect(window.localStorage.getItem("item")).toBe(null);
-        });
-
-        it("storage.spec.14 check removeItem", function() {
-            expect(window.localStorage.getItem("item")).toBe(null);
-            window.localStorage.setItem("item","value");
-            expect(window.localStorage.getItem("item")).toBe("value");
-            window.localStorage.removeItem("item");   
-            expect(window.localStorage.getItem("item")).toBe(null);
-        });
-
-        it("storage.spec.7 check clear", function() {
-            expect(window.localStorage.getItem("item1")).toBe(null);
-            expect(window.localStorage.getItem("item2")).toBe(null);
-            expect(window.localStorage.getItem("item3")).toBe(null);
-            window.localStorage.setItem("item1","value");
-            window.localStorage.setItem("item2","value");
-            window.localStorage.setItem("item3","value");
-            expect(window.localStorage.getItem("item1")).toBe("value");
-            expect(window.localStorage.getItem("item2")).toBe("value");
-            expect(window.localStorage.getItem("item3")).toBe("value");
-            expect(window.localStorage.length).toBe(3);
-            window.localStorage.clear();
-            expect(window.localStorage.length).toBe(0);
-            expect(window.localStorage.getItem("item1")).toBe(null);
-            expect(window.localStorage.getItem("item2")).toBe(null);
-            expect(window.localStorage.getItem("item3")).toBe(null);
-        });
-
-        it("storage.spec.8 check dot notation", function() {
-            expect(window.localStorage.item).not.toBeDefined();
-            window.localStorage.item = "value";
-            expect(window.localStorage.item).toBe("value");
-            window.localStorage.removeItem("item");   
-            expect(window.localStorage.item).not.toBeDefined();
-        });
-    });
-
-    describe("HTML 5 Storage", function () {
-        it("storage.spec.9 should exist", function() {
-            expect(window.openDatabase);
-            
-        });
-        
-        it("storage.spec.17 should contain an openDatabase function", function() {
-            expect(window.openDatabase).toBeDefined();
-            expect(typeof window.openDatabase == 'function').toBe(true);
-        });
-
-        it("storage.spec.18 Should be able to create and drop tables", function() {
-            var win = jasmine.createSpy('win');
-            var fail1 = createDoNotCallSpy('fail1');
-            var fail2 = createDoNotCallSpy('fail2');
-            var db = openDatabase("Database", "1.0", "HTML5 Database API example", 5*1024*1024);
-            db.transaction(function(t) {
-                t.executeSql('CREATE TABLE IF NOT EXISTS foo(id int, name varchar(255));');
-                t.executeSql('CREATE TABLE IF NOT EXISTS foo2(id int, name varchar(255));');
-            }, fail1, step2);
-            function step2() {
-              db.transaction(function(t) {
-                  t.executeSql('DROP TABLE foo;');
-                  t.executeSql('DROP TABLE foo2');
-              }, fail2, win);
-            }
-            waitsForAny(win, fail1, fail2);
-        });
-    });
-});

http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/16019c59/www/autotest/tests/whitelist.tests.js
----------------------------------------------------------------------
diff --git a/www/autotest/tests/whitelist.tests.js b/www/autotest/tests/whitelist.tests.js
deleted file mode 100644
index c39b86b..0000000
--- a/www/autotest/tests/whitelist.tests.js
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- *
-*/
-
-describe('Whitelist API (cordova.whitelist)', function () {
-    it("should exist", function() {
-        expect(cordova.whitelist).toBeDefined();
-    });
-
-    describe("Match function", function() {
-        function expectMatchWithResult(result) {
-            return (function(url, patterns, description) {
-                description = description || ((result ? "should accept " : "should reject
") + url + " for " + JSON.stringify(patterns));
-                it(description, function() {
-                    var cb = jasmine.createSpy();
-                    runs(function() {
-                        cordova.whitelist.match(url, patterns, cb);
-                    });
-                    waitsFor(function() { return cb.wasCalled; }, "success callback never
called", Tests.TEST_TIMEOUT);
-                    runs(function() {
-                        expect(cb).toHaveBeenCalledWith(result);
-                    });
-                });
-            });
-        }
-
-        var itShouldMatch = expectMatchWithResult(true);
-        var itShouldNotMatch = expectMatchWithResult(false);
-
-        it("should exist", function() {
-            expect(cordova.whitelist.match).toBeDefined();
-            expect(typeof cordova.whitelist.match).toBe("function");
-        });
-
-        itShouldMatch('http://www.apache.org/',['*'], "should accept any domain for *");
-        itShouldNotMatch('http://www.apache.org/',[], "should not accept any domain for []");
-
-        itShouldMatch('http://apache.org/', ['http://*.apache.org']);
-        itShouldMatch('http://www.apache.org/', ['http://*.apache.org']);
-        itShouldMatch('http://www.apache.org/some/path', ['http://*.apache.org']);
-        itShouldMatch('http://some.domain.under.apache.org/', ['http://*.apache.org']);
-        itShouldMatch('http://user:pass@apache.org/', ['http://*.apache.org']);
-        itShouldMatch('http://user:pass@www.apache.org/', ['http://*.apache.org']);
-        itShouldMatch('http://www.apache.org/?some=params', ['http://*.apache.org']);
-        itShouldNotMatch('http://apache.com/', ['http://*.apache.org']);
-        itShouldNotMatch('http://www.evil.com/?url=www.apache.org', ['http://*.apache.org']);
-        itShouldNotMatch('http://www.evil.com/?url=http://www.apache.org', ['http://*.apache.org']);
-        itShouldNotMatch('http://www.evil.com/?url=http%3A%2F%2Fwww%2Eapache%2Eorg', ['http://*.apache.org']);
-        itShouldNotMatch('https://apache.org/', ['http://*.apache.org']);
-        itShouldNotMatch('http://www.apache.org:pass@evil.com/', ['http://*.apache.org']);
-        itShouldNotMatch('http://www.apache.org.evil.com/', ['http://*.apache.org']);
-
-        itShouldMatch('http://www.apache.org/',['http://*.apache.org','https://*.apache.org']);
-        itShouldMatch('https://www.apache.org/',['http://*.apache.org','https://*.apache.org']);
-        itShouldNotMatch('ftp://www.apache.org/',['http://*.apache.org','https://*.apache.org']);
-        itShouldNotMatch('http://www.apache.com/',['http://*.apache.org','https://*.apache.org']);
-
-        itShouldMatch('http://www.apache.org/',['http://www.apache.org']);
-        itShouldNotMatch('http://build.apache.org/',['http://www.apache.org']);
-        itShouldNotMatch('http://apache.org/',['http://www.apache.org']);
-
-        itShouldMatch('http://www.apache.org/', ['http://*/*']);
-        itShouldMatch('http://www.apache.org/foo/bar.html', ['http://*/*']);
-
-        itShouldMatch('http://www.apache.org/foo', ['http://*/foo*']);
-        itShouldMatch('http://www.apache.org/foo/bar.html', ['http://*/foo*']);
-        itShouldNotMatch('http://www.apache.org/', ['http://*/foo*']);
-
-        itShouldMatch('file:///foo', ['file:///*']);
-
-        itShouldMatch('file:///foo', ['file:///foo*']);
-        itShouldMatch('file:///foo/bar.html', ['file:///foo*']);
-        itShouldNotMatch('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/*']);
-        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/*']);
-
-        itShouldMatch('http://www.APAche.org/', ['*.apache.org']);
-        itShouldMatch('http://WWw.apache.org/', ['*.apache.org']);
-        itShouldMatch('http://www.apache.org/', ['*.APACHE.ORG']);
-        itShouldMatch('HTTP://www.apache.org/', ['*.apache.org']);
-        itShouldMatch('HTTP://www.apache.org/', ['http://*.apache.org']);
-        itShouldMatch('http://www.apache.org/', ['HTTP://*.apache.org']);
-
-        itShouldMatch('http://www.apache.org/foo/', ['*://*.apache.org/foo/*']);
-        itShouldMatch('http://www.apache.org/foo/bar', ['*://*.apache.org/foo/*']);
-        itShouldNotMatch('http://www.apache.org/bar/foo/', ['*://*.apache.org/foo/*']);
-        itShouldNotMatch('http://www.apache.org/Foo/', ['*://*.apache.org/foo/*']);
-        itShouldNotMatch('http://www.apache.org/Foo/bar', ['*://*.apache.org/foo/*']);
-
-    });
-
-    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/16019c59/www/index.html
----------------------------------------------------------------------
diff --git a/www/index.html b/www/index.html
index f8442da..943b4ec 100644
--- a/www/index.html
+++ b/www/index.html
@@ -45,7 +45,6 @@ Model: <span id="model"> </span>
 Width: <span id="width">  </span>,   Height: <span id="height"></span>,
Color Depth: <span id="colorDepth"></span>
 User-Agent: <span id="user-agent"> </span></div>
     <a href="cdvtests/index.html#?showBack" class="btn large">Plugin Tests (Automatic
and Manual)</a>
-    <a href="autotest/index.html" class="btn large">Non-plugin Automatic Tests</a>
     <a href="battery/index.html" class="btn large">Battery</a>
     <a href="benchmarks/index.html" class="btn large">Benchmarks</a>
     <a href="events/index.html" class="btn large">Events</a>


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


Mime
View raw message