You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2013/12/10 22:04:27 UTC
[1/3] spec commit: CB-5214 Make mobile spec tests on WP8 to run w/o
user interaction
Updated Branches:
refs/heads/master c1a2fead9 -> dc38b6a42
CB-5214 Make mobile spec tests on WP8 to run w/o user interaction
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/74523ac7
Tree: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/tree/74523ac7
Diff: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/diff/74523ac7
Branch: refs/heads/master
Commit: 74523ac738d7de84b634373b52703d6d99f366ca
Parents: 6719858
Author: sgrebnov <se...@gmail.com>
Authored: Tue Oct 29 16:17:13 2013 +0400
Committer: sgrebnov <se...@gmail.com>
Committed: Wed Dec 4 16:14:05 2013 +0400
----------------------------------------------------------------------
autotest/tests/contacts.tests.js | 20 +++++++++++++++++++-
autotest/tests/datauri.tests.js | 7 +++++++
2 files changed, 26 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/74523ac7/autotest/tests/contacts.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/contacts.tests.js b/autotest/tests/contacts.tests.js
index 2a1edb9..14459ed 100644
--- a/autotest/tests/contacts.tests.js
+++ b/autotest/tests/contacts.tests.js
@@ -23,7 +23,9 @@
// all of the setup/teardown test methods can reference the following variables to make sure to do the right cleanup
var gContactObj = null;
var gContactId = null;
-
+var isWP8 = function() {
+ return window.device && window.device.platform && window.device.platform.toLowerCase() == 'win32nt';
+};
var removeContact = function(){
if (gContactObj) {
gContactObj.remove(function(){},function(){
@@ -123,6 +125,10 @@ describe("Contacts (navigator.contacts)", function () {
afterEach(removeContact);
it("contacts.spec.6 should be able to find a contact by name", function() {
+
+ // this api requires manual user confirmation on WP8 so skip it
+ if (isWP8()) return;
+
var foundName = jasmine.createSpy().andCallFake(function(result) {
var bFound = false;
try {
@@ -322,6 +328,10 @@ describe("Contacts (navigator.contacts)", function () {
describe('save method', function () {
it("contacts.spec.20 should be able to save a contact", function() {
+
+ // this api requires manual user confirmation on WP8 so skip it
+ if (isWP8()) return;
+
var bDay = new Date(1976, 6,4);
gContactObj = navigator.contacts.create({"gender": "male", "note": "my note", "name": {"familyName": "Delete", "givenName": "Test"}, "emails": [{"value": "here@there.com"}, {"value": "there@here.com"}], "birthday": bDay});
@@ -352,6 +362,10 @@ describe("Contacts (navigator.contacts)", function () {
});
// HACK: there is a reliance between the previous and next test. This is bad form.
it("contacts.spec.21 update a contact", function() {
+
+ // this api requires manual user confirmation on WP8 so skip it
+ if (isWP8()) return;
+
expect(gContactObj).toBeDefined();
var bDay = new Date(1975, 5,4);
@@ -429,6 +443,10 @@ describe("Contacts (navigator.contacts)", function () {
describe("Round trip Contact tests (creating + save + delete + find).", function () {
it("contacts.spec.24 Creating, saving, finding a contact should work, removing it should work, after which we should not be able to find it, and we should not be able to delete it again.", function() {
+
+ // this api requires manual user confirmation on WP8 so skip it
+ if (isWP8()) return;
+
var done = false;
runs(function () {
gContactObj = new Contact();
http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/74523ac7/autotest/tests/datauri.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/datauri.tests.js b/autotest/tests/datauri.tests.js
index 6b806bc..a996667 100644
--- a/autotest/tests/datauri.tests.js
+++ b/autotest/tests/datauri.tests.js
@@ -16,8 +16,15 @@
* specific language governing permissions and limitations
* under the License.
*/
+var isWP8 = function() {
+ return window.device && window.device.platform && window.device.platform.toLowerCase() == 'win32nt';
+};
describe('data uris', function () {
it("datauri.spec.1 should work with iframes", function() {
+ // IE on WP8 considers 'data:' in frame.src string as protocol type
+ // so asks user to look for appropriating application in the market;
+ // temporary skipped since requires user interaction
+ if (isWP8()) return;
var gotFoo = false,
frame = document.createElement('iframe');
function onMessage(msg) {
[3/3] spec commit: Merge branch 'CB-5214' of
https://github.com/sgrebnov/cordova-mobile-spec
Posted by pu...@apache.org.
Merge branch 'CB-5214' of https://github.com/sgrebnov/cordova-mobile-spec
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/dc38b6a4
Tree: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/tree/dc38b6a4
Diff: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/diff/dc38b6a4
Branch: refs/heads/master
Commit: dc38b6a42afa6af7abcb5756f2410ec23eec9b42
Parents: c1a2fea 05ad828
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue Dec 10 13:04:02 2013 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue Dec 10 13:04:02 2013 -0800
----------------------------------------------------------------------
autotest/tests/contacts.tests.js | 21 +++++++++++++++++++--
autotest/tests/datauri.tests.js | 6 ++++++
2 files changed, 25 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
[2/3] spec commit: correct way to detect windows phone (both 7/8)
Posted by pu...@apache.org.
correct way to detect windows phone (both 7/8)
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/05ad8280
Tree: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/tree/05ad8280
Diff: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/diff/05ad8280
Branch: refs/heads/master
Commit: 05ad8280e5089cea4c90f09da04232e735427c6c
Parents: 74523ac
Author: sgrebnov <se...@gmail.com>
Authored: Wed Oct 30 17:58:49 2013 +0400
Committer: sgrebnov <se...@gmail.com>
Committed: Wed Dec 4 16:14:06 2013 +0400
----------------------------------------------------------------------
autotest/tests/contacts.tests.js | 25 ++++++++++++-------------
autotest/tests/datauri.tests.js | 9 ++++-----
2 files changed, 16 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/05ad8280/autotest/tests/contacts.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/contacts.tests.js b/autotest/tests/contacts.tests.js
index 14459ed..de2955e 100644
--- a/autotest/tests/contacts.tests.js
+++ b/autotest/tests/contacts.tests.js
@@ -21,11 +21,10 @@
// global to store a contact so it doesn't have to be created or retrieved multiple times
// all of the setup/teardown test methods can reference the following variables to make sure to do the right cleanup
-var gContactObj = null;
-var gContactId = null;
-var isWP8 = function() {
- return window.device && window.device.platform && window.device.platform.toLowerCase() == 'win32nt';
-};
+var gContactObj = null,
+ gContactId = null,
+ isWindowsPhone = cordova.platformId == 'windowsphone';
+
var removeContact = function(){
if (gContactObj) {
gContactObj.remove(function(){},function(){
@@ -126,8 +125,8 @@ describe("Contacts (navigator.contacts)", function () {
it("contacts.spec.6 should be able to find a contact by name", function() {
- // this api requires manual user confirmation on WP8 so skip it
- if (isWP8()) return;
+ // this api requires manual user confirmation on WP7/8 so skip it
+ if (isWindowsPhone) return;
var foundName = jasmine.createSpy().andCallFake(function(result) {
var bFound = false;
@@ -329,8 +328,8 @@ describe("Contacts (navigator.contacts)", function () {
describe('save method', function () {
it("contacts.spec.20 should be able to save a contact", function() {
- // this api requires manual user confirmation on WP8 so skip it
- if (isWP8()) return;
+ // this api requires manual user confirmation on WP7/8 so skip it
+ if (isWindowsPhone) return;
var bDay = new Date(1976, 6,4);
gContactObj = navigator.contacts.create({"gender": "male", "note": "my note", "name": {"familyName": "Delete", "givenName": "Test"}, "emails": [{"value": "here@there.com"}, {"value": "there@here.com"}], "birthday": bDay});
@@ -363,8 +362,8 @@ describe("Contacts (navigator.contacts)", function () {
// HACK: there is a reliance between the previous and next test. This is bad form.
it("contacts.spec.21 update a contact", function() {
- // this api requires manual user confirmation on WP8 so skip it
- if (isWP8()) return;
+ // this api requires manual user confirmation on WP7/8 so skip it
+ if (isWindowsPhone) return;
expect(gContactObj).toBeDefined();
@@ -444,8 +443,8 @@ describe("Contacts (navigator.contacts)", function () {
describe("Round trip Contact tests (creating + save + delete + find).", function () {
it("contacts.spec.24 Creating, saving, finding a contact should work, removing it should work, after which we should not be able to find it, and we should not be able to delete it again.", function() {
- // this api requires manual user confirmation on WP8 so skip it
- if (isWP8()) return;
+ // this api requires manual user confirmation on WP7/8 so skip it
+ if (isWindowsPhone) return;
var done = false;
runs(function () {
http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/05ad8280/autotest/tests/datauri.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/datauri.tests.js b/autotest/tests/datauri.tests.js
index a996667..08ebbbc 100644
--- a/autotest/tests/datauri.tests.js
+++ b/autotest/tests/datauri.tests.js
@@ -16,15 +16,14 @@
* specific language governing permissions and limitations
* under the License.
*/
-var isWP8 = function() {
- return window.device && window.device.platform && window.device.platform.toLowerCase() == 'win32nt';
-};
+var isWindowsPhone = cordova.platformId == 'windowsphone';
+
describe('data uris', function () {
it("datauri.spec.1 should work with iframes", function() {
- // IE on WP8 considers 'data:' in frame.src string as protocol type
+ // IE on WP7/8 considers 'data:' in frame.src string as protocol type
// so asks user to look for appropriating application in the market;
// temporary skipped since requires user interaction
- if (isWP8()) return;
+ if (isWindowsPhone) return;
var gotFoo = false,
frame = document.createElement('iframe');
function onMessage(msg) {