You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bh...@apache.org on 2013/12/12 21:23:33 UTC

spec commit: CB-5637 [BlackBerry10] Skip tests for features not supported by platform

Updated Branches:
  refs/heads/master e50d30927 -> 575ca52a3


CB-5637 [BlackBerry10] Skip tests for features not supported by platform


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

Branch: refs/heads/master
Commit: 575ca52a31f51342317974ab20c68b420e836689
Parents: e50d309
Author: Bryan Higgins <bh...@blackberry.com>
Authored: Thu Dec 12 15:22:29 2013 -0500
Committer: Bryan Higgins <bh...@blackberry.com>
Committed: Thu Dec 12 15:22:29 2013 -0500

----------------------------------------------------------------------
 autotest/tests/contacts.tests.js      |  8 ++++++--
 autotest/tests/globalization.tests.js |  6 ++++++
 autotest/tests/media.tests.js         | 18 +++++++++++++++++-
 3 files changed, 29 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/575ca52a/autotest/tests/contacts.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/contacts.tests.js b/autotest/tests/contacts.tests.js
index de2955e..73a605c 100644
--- a/autotest/tests/contacts.tests.js
+++ b/autotest/tests/contacts.tests.js
@@ -336,7 +336,9 @@ describe("Contacts (navigator.contacts)", function () {
 
             var saveSuccess = jasmine.createSpy().andCallFake(function(obj) {
                     expect(obj).toBeDefined();
-                    expect(obj.note).toBe('my note');
+                    if (cordova.platformId !== 'blackberry10') {
+                        expect(obj.note).toBe('my note');
+                    }
                     expect(obj.name.familyName).toBe('Delete');
                     expect(obj.name.givenName).toBe('Test');
                     expect(obj.emails.length).toBe(2);
@@ -373,7 +375,9 @@ describe("Contacts (navigator.contacts)", function () {
             var win = jasmine.createSpy().andCallFake(function(obj) {
                     expect(obj).toBeDefined();
                     expect(obj.id).toBe(gContactObj.id);
-                    expect(obj.note).toBe(noteText);
+                    if (cordova.platformId !== 'blackberry10') {
+                        expect(obj.note).toBe(noteText);
+                    }
                     expect(obj.birthday.toDateString()).toBe(bDay.toDateString());
                     expect(obj.emails.length).toBe(1);
                     expect(obj.emails[0].value).toBe('here@there.com');

http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/575ca52a/autotest/tests/globalization.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/globalization.tests.js b/autotest/tests/globalization.tests.js
index 5cf2ec8..ddc7c3c 100644
--- a/autotest/tests/globalization.tests.js
+++ b/autotest/tests/globalization.tests.js
@@ -17,6 +17,12 @@
  * under the License.
 */
 describe('Globalization (navigator.globalization)', function () {
+
+    //not supported on bb10
+    if (cordova.platformId === 'blackberry10') {
+        return;
+    }
+
     it("globalization.spec.1 should exist", function() {
         expect(navigator.globalization).toBeDefined();
     });

http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/575ca52a/autotest/tests/media.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/media.tests.js b/autotest/tests/media.tests.js
index 19883ba..393ca00 100644
--- a/autotest/tests/media.tests.js
+++ b/autotest/tests/media.tests.js
@@ -129,6 +129,11 @@ describe('Media', function () {
                 expect(result).toBeDefined();
                 expect(result.code).toBe(MediaError.MEDIA_ERR_ABORTED);
             });
+
+        //bb10 dialog pops up, preventing tests from running
+        if (cordova.platformId === 'blackberry10') {
+            return;
+        }
             
         runs(function () {
             badMedia = new Media("invalid.file.name", win,fail);
@@ -159,7 +164,13 @@ describe('Media', function () {
                 });
 
         media1.play();
-        waitsFor(function () { return mediaState==Media.MEDIA_RUNNING; }, 10000);
+
+        if (cordova.platformId !== 'blackberry10') {
+            waitsFor(function () { return mediaState==Media.MEDIA_RUNNING; }, 10000);
+        } else {
+            waits(5000);
+        }
+
         // make sure we are at least one second into the file
         waits(1000);
         runs(function () {
@@ -174,6 +185,11 @@ describe('Media', function () {
     });
 
     it("media.spec.13 duration should be set properly", function() {
+
+        if (cordova.platformId === 'blackberry10') {
+            return;
+        }
+
         var win = jasmine.createSpy();
         var fail = jasmine.createSpy();
         var mediaState=Media.MEDIA_STOPPED;