incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject git commit: added tests for MediaFile
Date Fri, 20 Jan 2012 06:10:26 GMT
Updated Branches:
  refs/heads/master 02f328c39 -> 5f1270415


added tests for MediaFile


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/commit/5f127041
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/tree/5f127041
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/diff/5f127041

Branch: refs/heads/master
Commit: 5f12704150e149584cf9b92017538ad51fb62b44
Parents: 02f328c
Author: Fil Maj <filip.maj@nitobi.com>
Authored: Thu Jan 19 22:11:11 2012 -0800
Committer: Fil Maj <filip.maj@nitobi.com>
Committed: Thu Jan 19 22:11:11 2012 -0800

----------------------------------------------------------------------
 autotest/tests/capture.tests.js |   37 ++++++++++++++++++++++++---------
 1 files changed, 27 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/blob/5f127041/autotest/tests/capture.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/capture.tests.js b/autotest/tests/capture.tests.js
index 63ce04f..746b6f9 100644
--- a/autotest/tests/capture.tests.js
+++ b/autotest/tests/capture.tests.js
@@ -2,31 +2,32 @@ Tests.prototype.CaptureTests = function() {
     module('Capture (navigator.device.capture)');
     test("should exist", function() {
         expect(2);
-        ok(navigator.device != null, "navigator.device should not be null.");
-        ok(navigator.device.capture != null, "navigator.device.capture should not be null.");
+        ok(navigator.device !== null, "navigator.device should not be null.");
+        ok(navigator.device.capture !== null, "navigator.device.capture should not be null.");
     });
     test("should have the correct properties ", function() {
         expect(3);
-        ok(typeof navigator.device.capture.supportedAudioModes != 'undefined' &&
navigator.device.capture.supportedAudioModes != null , "there should be a supported audio
modes property");
-        ok(typeof navigator.device.capture.supportedImageModes != 'undefined' &&
navigator.device.capture.supportedImageModes != null , "there should be a supported image
modes property");
-        ok(typeof navigator.device.capture.supportedVideoModes != 'undefined' &&
navigator.device.capture.supportedVideoModes != null , "there should be a supported video
modes property");
+        ok(typeof navigator.device.capture.supportedAudioModes != 'undefined' &&
navigator.device.capture.supportedAudioModes !== null , "there should be a supported audio
modes property");
+        ok(typeof navigator.device.capture.supportedImageModes != 'undefined' &&
navigator.device.capture.supportedImageModes !== null , "there should be a supported image
modes property");
+        ok(typeof navigator.device.capture.supportedVideoModes != 'undefined' &&
navigator.device.capture.supportedVideoModes !== null , "there should be a supported video
modes property");
     });
     test("should contain a captureAudio function", function() {
         expect(2);
-        ok(typeof navigator.device.capture.captureAudio != 'undefined' && navigator.device.capture.captureAudio
!= null, "navigator.device.capture.captureAudio should not be null.");
+        ok(typeof navigator.device.capture.captureAudio != 'undefined' && navigator.device.capture.captureAudio
!== null, "navigator.device.capture.captureAudio should not be null.");
         ok(typeof navigator.device.capture.captureAudio == 'function', "navigator.device.capture.captureAudio
should be a function.");
     });
     test("should contain a captureImage function", function() {
         expect(2);
-        ok(typeof navigator.device.capture.captureImage != 'undefined' && navigator.device.capture.captureImage
!= null, "navigator.device.capture.captureImage should not be null.");
+        ok(typeof navigator.device.capture.captureImage != 'undefined' && navigator.device.capture.captureImage
!== null, "navigator.device.capture.captureImage should not be null.");
         ok(typeof navigator.device.capture.captureImage == 'function', "navigator.device.capture.captureImage
should be a function.");
     });
     test("should contain a captureVideo function", function() {
         expect(2);
-        ok(typeof navigator.device.capture.captureVideo != 'undefined' && navigator.device.capture.captureVideo
!= null, "navigator.device.capture.captureVideo should not be null.");
+        ok(typeof navigator.device.capture.captureVideo != 'undefined' && navigator.device.capture.captureVideo
!== null, "navigator.device.capture.captureVideo should not be null.");
         ok(typeof navigator.device.capture.captureVideo == 'function', "navigator.device.capture.captureVideo
should be a function.");
     });
-	module('CaptureAudioOptions');
+
+    module('CaptureAudioOptions');
     test("CaptureAudioOptions constructor should exist", function() {
         expect(4);
         var options = new CaptureAudioOptions();
@@ -35,6 +36,7 @@ Tests.prototype.CaptureTests = function() {
         ok(typeof options.duration !== 'undefined', "CaptureAudioOptions object should have
a 'duration' property.");
         ok(typeof options.mode !== 'undefined', "CaptureAudioOptions object should have a
'mode' property.");
     });
+
     module('CaptureImageOptions');
     test("CaptureImageOptions constructor should exist", function() {
         expect(3);
@@ -43,6 +45,7 @@ Tests.prototype.CaptureTests = function() {
         ok(typeof options.limit !== 'undefined', "CaptureImageOptions object should have
a 'limit' property.");
         ok(typeof options.mode !== 'undefined', "CaptureImageOptions object should have a
'mode' property.");
     });
+
     module('CaptureVideoOptions');
     test("CaptureVideoOptions constructor should exist", function() {
         expect(4);
@@ -52,6 +55,7 @@ Tests.prototype.CaptureTests = function() {
         ok(typeof options.duration !== 'undefined', "CaptureVideoOptions object should have
a 'duration' property.");
         ok(typeof options.mode !== 'undefined', "CaptureVideoOptions object should have a
'mode' property.");
     });
+
     module('CaptureError interface');
     test("CaptureError constants should be defined", function() {
         expect(4);
@@ -66,6 +70,7 @@ Tests.prototype.CaptureTests = function() {
         ok(error !== null, "CaptureError object should not be null.");
         ok(typeof error.code !== 'undefined', "CaptureError object should have a 'code' property.");
     });
+
     module('MediaFileData');
     test("MediaFileData constructor should exist", function() {
         expect(6);
@@ -77,4 +82,16 @@ Tests.prototype.CaptureTests = function() {
         ok(typeof fileData.height !== 'undefined', "MediaFileData object should have a 'height'
property.");
         ok(typeof fileData.width !== 'undefined', "MediaFileData object should have a 'width'
property.");
     });
-};
\ No newline at end of file
+
+    module('MediaFile');
+    test("MediaFile constructor should exist", function() {
+        expect(6);
+        var fileData = new MediaFileData();
+        ok(fileData !== null, "MediaFileData object should not be null.");
+        ok(typeof fileData.name !== 'undefined', "MediaFile object should have a 'name' property.");
+        ok(typeof fileData.fullPath !== 'undefined', "MediaFile object should have a 'fullPath'
property.");
+        ok(typeof fileData.type !== 'undefined', "MediaFile object should have a 'type' property.");
+        ok(typeof fileData.lastModifiedDate !== 'undefined', "MediaFile object should have
a 'lastModifiedDate' property.");
+        ok(typeof fileData.size !== 'undefined', "MediaFile object should have a 'size' property.");
+    });
+};


Mime
View raw message