Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
[spec] fixing spec app
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Willoughby committed May 30, 2013
1 parent ab95b13 commit 52ce70d
Showing 1 changed file with 37 additions and 16 deletions.
53 changes: 37 additions & 16 deletions spec/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@


<html>

<head>
<title>Cordova: Camera API Specs</title>
<title>Cordova: API Specs</title>

<meta name="viewport" content="width=device-width, height=device-height, user-scalable=yes, initial-scale=1.0;" />

Expand All @@ -37,6 +36,7 @@
<script type="text/javascript" src="html/SpecView.js"></script>
<script type="text/javascript" src="html/SuiteView.js"></script>
<script type="text/javascript" src="html/TrivialReporter.js"></script>
<script type="text/javascript" src="jasmine-jsreporter.js"></script>

<!-- Source -->
<script type="text/javascript" src="cordova.js"></script>
Expand All @@ -49,20 +49,41 @@
<script type="text/javascript" src="barcodescanner.tests.js"></script>

<script type="text/javascript">
document.addEventListener('deviceready', function () {
var jasmineEnv = jasmine.getEnv();
jasmineEnv.updateInterval = 1000;

var htmlReporter = new jasmine.HtmlReporter();

jasmineEnv.addReporter(htmlReporter);

jasmineEnv.specFilter = function(spec) {
return htmlReporter.specFilter(spec);
};

jasmineEnv.execute();
}, false);
var root, temp_root, persistent_root;

document.addEventListener('deviceready', function () {
// one-time retrieval of the root file system entry
var onError = function(e) {
console.log('[ERROR] Problem setting up root filesystem for test running! Error to follow.');
console.log(JSON.stringify(e));
};

window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
function(fileSystem) {
console.log('File API test Init: Setting PERSISTENT FS.');
root = fileSystem.root; // set in file.tests.js
persistent_root = root;

// Once root is set up, fire off tests
var jasmineEnv = jasmine.getEnv();
jasmineEnv.updateInterval = 1000;

var htmlReporter = new jasmine.HtmlReporter(); var jr = new jasmine.JSReporter("http://ec2-184-72-173-33.compute-1.amazonaws.com:5984");

jasmineEnv.addReporter(htmlReporter);jasmineEnv.addReporter(jr);

jasmineEnv.specFilter = function(spec) {
return htmlReporter.specFilter(spec);
};

jasmineEnv.execute();
}, onError);
window.requestFileSystem(LocalFileSystem.TEMPORARY, 0,
function(fileSystem) {
console.log('File API test Init: Setting TEMPORARY FS.');
temp_root = fileSystem.root; // set in file.tests.js
}, onError);
}, false);
</script>
</head>

Expand Down

0 comments on commit 52ce70d

Please sign in to comment.