Skip to content
Browse files

Fixes for broken tests

1) Fixed some issues in the capture tests that were failing.
2) Removed link to system tests as the API is not yet implemented
  • Loading branch information...
1 parent 42d2dfd commit c3b18497607957fb219d5e37ce442d444f1a6054 @macdonst committed May 11, 2011
Showing with 13 additions and 10 deletions.
  1. +1 −2 index.html
  2. +12 −8 tests/capture.tests.js
View
3 index.html
@@ -31,7 +31,6 @@
<script type="text/javascript" src="tests/sms.tests.js"></script>
<script type="text/javascript" src="tests/telephony.tests.js"></script>
<script type="text/javascript" src="tests/storage.tests.js"></script>
- <script type="text/javascript" src="tests/system.tests.js"></script>
</head>
<body>
<h1 id="qunit-header">PhoneGap API Spec</h1>
@@ -42,4 +41,4 @@ <h2 id="qunit-userAgent"></h2>
<!-- Populated by tests -->
</div>
</body>
-</html>
+</html>
View
20 tests/capture.tests.js
@@ -7,9 +7,9 @@ Tests.prototype.CaptureTests = function() {
});
test("should have the correct properties ", function() {
expect(3);
- ok(typeof navigator.device.capture.supportedAudioFormats != 'undefined' && navigator.device.capture.supportedAudioFormats != null , "there should be a supported audio formats property");
- ok(typeof navigator.device.capture.supportedImageFormats != 'undefined' && navigator.device.capture.supportedImageFormats != null , "there should be a supported image formats property");
- ok(typeof navigator.device.capture.supportedVideoFormats != 'undefined' && navigator.device.capture.supportedVideoFormats != null , "there should be a supported video formats 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);
@@ -28,33 +28,37 @@ Tests.prototype.CaptureTests = function() {
});
module('CaptureAudioOptions');
test("CaptureAudioOptions constructor should exist", function() {
- expect(2);
+ expect(4);
var options = new CaptureAudioOptions();
ok(options !== null, "CaptureAudioOptions object should not be null.");
ok(typeof options.limit !== 'undefined', "CaptureAudioOptions object should have a 'limit' property.");
+ 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(2);
+ expect(3);
var options = new CaptureImageOptions();
ok(options !== null, "CaptureImageOptions object should not be null.");
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(3);
+ expect(4);
var options = new CaptureVideoOptions();
ok(options !== null, "CaptureVideoOptions object should not be null.");
ok(typeof options.limit !== 'undefined', "CaptureVideoOptions object should have a 'limit' property.");
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);
equal(CaptureError.CAPTURE_INTERNAL_ERR, 0, "CaptureError.CAPTURE_INTERNAL_ERR should be defined");
equal(CaptureError.CAPTURE_APPLICATION_BUSY, 1, "CaptureError.CAPTURE_APPLICATION_BUSY should be defined");
- equal(CaptureError.CAPTURE_INVALID_ARGUMENT, 0, "CaptureError.CAPTURE_INVALID_ARGUMENT should be defined");
- equal(CaptureError.CAPTURE_NO_MEDIA_FILES, 0, "CaptureError.CAPTURE_NO_MEDIA_FILES should be defined");
+ equal(CaptureError.CAPTURE_INVALID_ARGUMENT, 2, "CaptureError.CAPTURE_INVALID_ARGUMENT should be defined");
+ equal(CaptureError.CAPTURE_NO_MEDIA_FILES, 3, "CaptureError.CAPTURE_NO_MEDIA_FILES should be defined");
});
test("CaptureError properties should exist", function() {
expect(2);

0 comments on commit c3b1849

Please sign in to comment.
Something went wrong with that request. Please try again.