Skip to content

Commit

Permalink
Fixes for broken tests
Browse files Browse the repository at this point in the history
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
macdonst committed May 11, 2011
1 parent 42d2dfd commit c3b1849
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
3 changes: 1 addition & 2 deletions index.html
Expand Up @@ -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>
Expand All @@ -42,4 +41,4 @@ <h2 id="qunit-userAgent"></h2>
<!-- Populated by tests -->
</div>
</body>
</html>
</html>
20 changes: 12 additions & 8 deletions tests/capture.tests.js
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit c3b1849

Please sign in to comment.