You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sg...@apache.org on 2014/11/24 07:38:57 UTC
[1/2] cordova-plugin-contacts git commit: CB-7896 Pending tests for
Save and Find methods for windows cause they are not supported yet
Repository: cordova-plugin-contacts
Updated Branches:
refs/heads/master 5272778a5 -> 5e4ce8a48
CB-7896 Pending tests for Save and Find methods for windows cause they are not supported yet
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/commit/684a4513
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/tree/684a4513
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/diff/684a4513
Branch: refs/heads/master
Commit: 684a4513454224afd1abc80d94aebfd6c6c62f9d
Parents: 5272778
Author: maria.bukharina <ma...@akvelon.com>
Authored: Wed Oct 29 17:48:36 2014 +0300
Committer: sgrebnov <v-...@microsoft.com>
Committed: Mon Nov 24 09:27:10 2014 +0300
----------------------------------------------------------------------
tests/tests.js | 47 ++++++++++++++++++++++++++++++++++++++++-------
1 file changed, 40 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/blob/684a4513/tests/tests.js
----------------------------------------------------------------------
diff --git a/tests/tests.js b/tests/tests.js
index 0170d91..90fdee1 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -1,4 +1,4 @@
-/*
+/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -24,8 +24,9 @@ exports.defineAutoTests = function () {
// all of the setup/teardown test methods can reference the following variables to make sure to do the right cleanup
var gContactObj = null,
gContactId = null,
- isWindowsPhone = cordova.platformId == 'windowsphone';
-
+ isWindowsPhone8 = cordova.platformId == 'windowsphone',
+ isWindows = (cordova.platformId === "windows") || (navigator.appVersion.indexOf("MSAppHost/1.0") !== -1),
+ isWindowsPhone81 = (navigator.appVersion.indexOf("Windows Phone 8.1;") !== -1);
var fail = function(done) {
expect(true).toBe(false);
done();
@@ -51,6 +52,11 @@ exports.defineAutoTests = function () {
});
describe("find method", function() {
it("contacts.spec.3 success callback should be called with an array", function(done) {
+ // Find method is not supported on Windows platform
+ if (isWindows && !isWindowsPhone81) {
+ pending();
+ return;
+ }
var win = function(result) {
expect(result).toBeDefined();
expect(result instanceof Array).toBe(true);
@@ -63,6 +69,11 @@ exports.defineAutoTests = function () {
navigator.contacts.find(["displayName", "name", "phoneNumbers", "emails"], win, fail.bind(null, done), obj);
});
it("success callback should be called with an array, even if partial ContactFindOptions specified", function (done) {
+ // Find method is not supported on Windows platform
+ if (isWindows && !isWindowsPhone81) {
+ pending();
+ return;
+ }
var win = function (result) {
expect(result).toBeDefined();
expect(result instanceof Array).toBe(true);
@@ -99,7 +110,14 @@ exports.defineAutoTests = function () {
afterEach(removeContact);
it("contacts.spec.6 should be able to find a contact by name", function (done) {
- if (isWindowsPhone) {
+ // Find method is not supported on Windows Store apps.
+ // also this test will be skipped for Windows Phone 8.1 because function "save" not supported on WP8.1
+ if (isWindows) {
+ pending();
+ return;
+ }
+
+ if (isWindowsPhone8) {
done();
return;
}
@@ -275,7 +293,12 @@ exports.defineAutoTests = function () {
});
describe('save method', function () {
it("contacts.spec.20 should be able to save a contact", function (done) {
- if (isWindowsPhone) {
+ // Save method is not supported on Windows platform
+ if (isWindows) {
+ pending();
+ return;
+ }
+ if (isWindowsPhone8) {
done();
return;
}
@@ -302,7 +325,12 @@ exports.defineAutoTests = function () {
});
// HACK: there is a reliance between the previous and next test. This is bad form.
it("contacts.spec.21 update a contact", function (done) {
- if (isWindowsPhone) {
+ // Save method is not supported on Windows platform
+ if (isWindows) {
+ pending();
+ return;
+ }
+ if (isWindowsPhone8) {
done();
return;
}
@@ -361,7 +389,12 @@ exports.defineAutoTests = function () {
afterEach(removeContact);
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 (done) {
- if (isWindowsPhone) {
+ // Save method is not supported on Windows platform
+ if (isWindows) {
+ pending();
+ return;
+ }
+ if (isWindowsPhone8) {
done();
return;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[2/2] cordova-plugin-contacts git commit: CB-7896 Better way to
detect Windows and WidnowsPhone81
Posted by sg...@apache.org.
CB-7896 Better way to detect Windows and WidnowsPhone81
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/commit/5e4ce8a4
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/tree/5e4ce8a4
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/diff/5e4ce8a4
Branch: refs/heads/master
Commit: 5e4ce8a48f39ef9c7ec74ed5e5f0909efff794e7
Parents: 684a451
Author: sgrebnov <v-...@microsoft.com>
Authored: Mon Nov 24 09:36:37 2014 +0300
Committer: sgrebnov <v-...@microsoft.com>
Committed: Mon Nov 24 09:36:37 2014 +0300
----------------------------------------------------------------------
tests/tests.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/blob/5e4ce8a4/tests/tests.js
----------------------------------------------------------------------
diff --git a/tests/tests.js b/tests/tests.js
index 90fdee1..be0ac32 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -25,8 +25,8 @@ exports.defineAutoTests = function () {
var gContactObj = null,
gContactId = null,
isWindowsPhone8 = cordova.platformId == 'windowsphone',
- isWindows = (cordova.platformId === "windows") || (navigator.appVersion.indexOf("MSAppHost/1.0") !== -1),
- isWindowsPhone81 = (navigator.appVersion.indexOf("Windows Phone 8.1;") !== -1);
+ isWindows = (cordova.platformId === "windows") || (cordova.platformId === "windows8"),
+ isWindowsPhone81 = isWindows && WinJS.Utilities.isPhone;
var fail = function(done) {
expect(true).toBe(false);
done();
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org