You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by lo...@apache.org on 2013/04/08 23:45:22 UTC
[1/2] [CB-2913] squashed commits of toetag script,
tags jasmine unit tests with unique id
Updated Branches:
refs/heads/master 93f50aea9 -> ef604562b
http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/ef604562/autotest/tests/filetransfer.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/filetransfer.tests.js b/autotest/tests/filetransfer.tests.js
index bdc83d9..1759983 100644
--- a/autotest/tests/filetransfer.tests.js
+++ b/autotest/tests/filetransfer.tests.js
@@ -83,17 +83,17 @@ describe('FileTransfer', function() {
waitsFor(function() { return spy.wasCalled; }, Tests.TEST_TIMEOUT);
};
- it("should exist and be constructable", function() {
+ it("filetransfer.spec.1 should exist and be constructable", function() {
var ft = new FileTransfer();
expect(ft).toBeDefined();
});
- it("should contain proper functions", function() {
+ it("filetransfer.spec.2 should contain proper functions", function() {
var ft = new FileTransfer();
expect(typeof ft.upload).toBe('function');
expect(typeof ft.download).toBe('function');
});
describe('FileTransferError', function() {
- it("FileTransferError constants should be defined", function() {
+ it("filetransfer.spec.3 FileTransferError constants should be defined", function() {
expect(FileTransferError.FILE_NOT_FOUND_ERR).toBe(1);
expect(FileTransferError.INVALID_URL_ERR).toBe(2);
expect(FileTransferError.CONNECTION_ERR).toBe(3);
@@ -108,7 +108,7 @@ describe('FileTransfer', function() {
// <access origin="apache.org" subdomains="true" />
// <access origin="cordova-filetransfer.jitsu.com"/>
- it("should be able to download a file using http", function() {
+ it("filetransfer.spec.4 should be able to download a file using http", function() {
var fail = createDoNotCallSpy('downloadFail');
var remoteFile = server + "/robots.txt"
var localFileName = remoteFile.substring(remoteFile.lastIndexOf('/')+1);
@@ -132,7 +132,7 @@ describe('FileTransfer', function() {
waitsForAny(downloadWin, fail);
});
- it("should be able to download a file using http basic auth", function() {
+ it("filetransfer.spec.5 should be able to download a file using http basic auth", function() {
var fail = createDoNotCallSpy('downloadFail');
var remoteFile = server_with_credentials + "/download_basic_auth"
var localFileName = remoteFile.substring(remoteFile.lastIndexOf('/')+1);
@@ -156,7 +156,7 @@ describe('FileTransfer', function() {
waitsForAny(downloadWin, fail);
});
- it("should get http status on basic auth failure", function() {
+ it("filetransfer.spec.6 should get http status on basic auth failure", function() {
var downloadWin = createDoNotCallSpy('downloadWin');
var remoteFile = server + "/download_basic_auth";
@@ -176,7 +176,7 @@ describe('FileTransfer', function() {
waitsForAny(downloadWin, downloadFail);
});
- it("should be able to download a file using file:// (when hosted from file://)", function() {
+ it("filetransfer.spec.7 should be able to download a file using file:// (when hosted from file://)", function() {
var fail = createDoNotCallSpy('downloadFail');
var remoteFile = window.location.href.replace(/\?.*/, '').replace(/ /g, '%20');
var localFileName = remoteFile.substring(remoteFile.lastIndexOf('/')+1);
@@ -204,7 +204,7 @@ describe('FileTransfer', function() {
waitsForAny(downloadWin, fail);
});
- it("should be able to download a file using https", function() {
+ it("filetransfer.spec.8 should be able to download a file using https", function() {
var remoteFile = "https://www.apache.org/licenses/";
var localFileName = 'httpstest.html';
var downloadFail = createDoNotCallSpy('downloadFail', 'Ensure ' + remoteFile + ' is in the white-list');
@@ -226,7 +226,7 @@ describe('FileTransfer', function() {
waitsForAny(fileWin, downloadFail, fileFail);
});
- it("should not leave partial file due to abort", function() {
+ it("filetransfer.spec.9 should not leave partial file due to abort", function() {
var downloadWin = createDoNotCallSpy('downloadWin');
var remoteFile = 'http://cordova.apache.org/downloads/BlueZedEx.mp3';
var localFileName = remoteFile.substring(remoteFile.lastIndexOf('/')+1);
@@ -252,7 +252,7 @@ describe('FileTransfer', function() {
waitsForAny(downloadWin, downloadFail);
});
- it("should be stopped by abort() right away", function() {
+ it("filetransfer.spec.10 should be stopped by abort() right away", function() {
var downloadWin = createDoNotCallSpy('downloadWin');
var remoteFile = 'http://cordova.apache.org/downloads/BlueZedEx.mp3';
var localFileName = remoteFile.substring(remoteFile.lastIndexOf('/')+1);
@@ -276,7 +276,7 @@ describe('FileTransfer', function() {
waitsForAny(downloadWin, downloadFail);
});
- it("should call the error callback on abort()", function() {
+ it("filetransfer.spec.11 should call the error callback on abort()", function() {
var downloadWin = createDoNotCallSpy('downloadWin');
var downloadFail = jasmine.createSpy().andCallFake(function(e) { console.log("Abort called") });
var remoteFile = 'http://cordova.apache.org/downloads/BlueZedEx.mp3';
@@ -296,7 +296,7 @@ describe('FileTransfer', function() {
waitsForAny(downloadFail);
});
- it("should get http status on failure", function() {
+ it("filetransfer.spec.12 should get http status on failure", function() {
var downloadWin = createDoNotCallSpy('downloadWin');
var remoteFile = server + "/404";
@@ -316,7 +316,7 @@ describe('FileTransfer', function() {
waitsForAny(downloadWin, downloadFail);
});
- it("should get response body on failure", function() {
+ it("filetransfer.spec.13 should get response body on failure", function() {
var downloadWin = createDoNotCallSpy('downloadWin');
var remoteFile = server + "/404";
@@ -336,7 +336,7 @@ describe('FileTransfer', function() {
waitsForAny(downloadWin, downloadFail);
});
- it("should handle malformed urls", function() {
+ it("filetransfer.spec.14 should handle malformed urls", function() {
var downloadWin = createDoNotCallSpy('downloadWin');
var remoteFile = getMalformedUrl();
@@ -359,7 +359,7 @@ describe('FileTransfer', function() {
waitsForAny(downloadWin, downloadFail);
});
- it("should handle unknown host", function() {
+ it("filetransfer.spec.15 should handle unknown host", function() {
var downloadWin = createDoNotCallSpy('downloadWin');
var remoteFile = "http://foobar.apache.org/index.html";
@@ -375,7 +375,7 @@ describe('FileTransfer', function() {
waitsForAny(downloadWin, downloadFail);
});
- it("should handle bad file path", function() {
+ it("filetransfer.spec.16 should handle bad file path", function() {
var downloadWin = createDoNotCallSpy('downloadWin');
var remoteFile = server;
@@ -391,7 +391,7 @@ describe('FileTransfer', function() {
waitsForAny(downloadWin, downloadFail);
});
- it("progress should work with gzip encoding", function() {
+ it("filetransfer.spec.17 progress should work with gzip encoding", function() {
var downloadFail = createDoNotCallSpy('downloadFail');
var remoteFile = "http://www.apache.org/";
var localFileName = "index.html";
@@ -418,7 +418,7 @@ describe('FileTransfer', function() {
});
});
describe('upload method', function() {
- it("should be able to upload a file", function() {
+ it("filetransfer.spec.18 should be able to upload a file", function() {
var remoteFile = server + "/upload";
var localFileName = "upload.txt";
var fileContents = 'This file should upload';
@@ -469,7 +469,7 @@ describe('FileTransfer', function() {
expect(lastProgressEvent).not.toBeNull('expected progress events');
});
});
- it("should be able to upload a file with http basic auth", function() {
+ it("filetransfer.spec.19 should be able to upload a file with http basic auth", function() {
var remoteFile = server_with_credentials + "/upload_basic_auth";
var localFileName = "upload.txt";
var fileContents = 'This file should upload';
@@ -520,7 +520,7 @@ describe('FileTransfer', function() {
expect(lastProgressEvent).not.toBeNull('expected progress events');
});
});
- it("should get http status on basic auth failure", function() {
+ it("filetransfer.spec.6 should get http status on basic auth failure", function() {
var fileFail = createDoNotCallSpy('fileFail');
var uploadWin = createDoNotCallSpy('uploadWin');
@@ -551,7 +551,7 @@ describe('FileTransfer', function() {
waitsForAny(uploadWin, uploadFail, fileFail);
});
- it("should be stopped by abort() right away.", function() {
+ it("filetransfer.spec.21 should be stopped by abort() right away.", function() {
var remoteFile = server + "/upload";
var localFileName = "upload.txt";
@@ -589,7 +589,7 @@ describe('FileTransfer', function() {
waitsForAny(uploadWin, uploadFail, fileFail);
});
- it("should get http status on failure", function() {
+ it("filetransfer.spec.12 should get http status on failure", function() {
var fileFail = createDoNotCallSpy('fileFail');
var uploadWin = createDoNotCallSpy('uploadWin');
@@ -620,7 +620,7 @@ describe('FileTransfer', function() {
waitsForAny(uploadWin, uploadFail, fileFail);
});
- it("should handle malformed urls", function() {
+ it("filetransfer.spec.14 should handle malformed urls", function() {
var fileFail = createDoNotCallSpy('fileFail');
var uploadWin = createDoNotCallSpy('uploadWin');
@@ -644,7 +644,7 @@ describe('FileTransfer', function() {
waitsForAny(uploadWin, uploadFail, fileFail);
});
- it("should handle unknown host", function() {
+ it("filetransfer.spec.15 should handle unknown host", function() {
var fileFail = createDoNotCallSpy('fileFail');
var uploadWin = createDoNotCallSpy('uploadWin');
@@ -668,7 +668,7 @@ describe('FileTransfer', function() {
waitsForAny(uploadWin, uploadFail, fileFail);
});
- it("should handle missing file", function() {
+ it("filetransfer.spec.25 should handle missing file", function() {
var uploadWin = createDoNotCallSpy('uploadWin');
var remoteFile = server + "/upload";
@@ -686,7 +686,7 @@ describe('FileTransfer', function() {
waitsForAny(uploadWin, uploadFail);
});
- it("should handle bad file path", function() {
+ it("filetransfer.spec.16 should handle bad file path", function() {
var uploadWin = createDoNotCallSpy('uploadWin');
var remoteFile = server + "/upload";
@@ -703,7 +703,7 @@ describe('FileTransfer', function() {
waitsForAny(uploadWin, uploadFail);
});
- it("should be able to set custom headers", function() {
+ it("filetransfer.spec.27 should be able to set custom headers", function() {
var remoteFile = "http://whatheaders.com";
var localFileName = "upload.txt";
http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/ef604562/autotest/tests/geolocation.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/geolocation.tests.js b/autotest/tests/geolocation.tests.js
index f2a7d0f..6837f44 100644
--- a/autotest/tests/geolocation.tests.js
+++ b/autotest/tests/geolocation.tests.js
@@ -20,28 +20,28 @@
*/
describe('Geolocation (navigator.geolocation)', function () {
- it("should exist", function() {
+ it("geolocation.spec.1 should exist", function() {
expect(navigator.geolocation).toBeDefined();
});
- it("should contain a getCurrentPosition function", function() {
+ it("geolocation.spec.2 should contain a getCurrentPosition function", function() {
expect(typeof navigator.geolocation.getCurrentPosition).toBeDefined();
expect(typeof navigator.geolocation.getCurrentPosition == 'function').toBe(true);
});
- it("should contain a watchPosition function", function() {
+ it("geolocation.spec.3 should contain a watchPosition function", function() {
expect(typeof navigator.geolocation.watchPosition).toBeDefined();
expect(typeof navigator.geolocation.watchPosition == 'function').toBe(true);
});
- it("should contain a clearWatch function", function() {
+ it("geolocation.spec.4 should contain a clearWatch function", function() {
expect(typeof navigator.geolocation.clearWatch).toBeDefined();
expect(typeof navigator.geolocation.clearWatch == 'function').toBe(true);
});
describe('getCurrentPosition method', function() {
describe('error callback', function() {
- it("should be called if we set timeout to 0 and maximumAge to a very small number", function() {
+ it("geolocation.spec.5 should be called if we set timeout to 0 and maximumAge to a very small number", function() {
console.log("Here I am");
var win = jasmine.createSpy(),
fail = jasmine.createSpy();
@@ -62,7 +62,7 @@ describe('Geolocation (navigator.geolocation)', function () {
});
describe('success callback', function() {
- it("should be called with a Position object", function() {
+ it("geolocation.spec.6 should be called with a Position object", function() {
var win = jasmine.createSpy().andCallFake(function(p) {
expect(p.coords).toBeDefined();
expect(p.timestamp).toBeDefined();
@@ -91,7 +91,7 @@ describe('Geolocation (navigator.geolocation)', function () {
afterEach(function() {
navigator.geolocation.clearWatch(errorWatch);
});
- it("should be called if we set timeout to 0 and maximumAge to a very small number", function() {
+ it("geolocation.spec.5 should be called if we set timeout to 0 and maximumAge to a very small number", function() {
var win = jasmine.createSpy(),
fail = jasmine.createSpy();
@@ -116,7 +116,7 @@ describe('Geolocation (navigator.geolocation)', function () {
afterEach(function() {
navigator.geolocation.clearWatch(successWatch);
});
- it("should be called with a Position object", function() {
+ it("geolocation.spec.6 should be called with a Position object", function() {
var win = jasmine.createSpy().andCallFake(function(p) {
expect(p.coords).toBeDefined();
expect(p.timestamp).toBeDefined();
http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/ef604562/autotest/tests/globalization.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/globalization.tests.js b/autotest/tests/globalization.tests.js
index 6903aee..bc43b4a 100644
--- a/autotest/tests/globalization.tests.js
+++ b/autotest/tests/globalization.tests.js
@@ -1,14 +1,14 @@
describe('Globalization (navigator.globalization)', function () {
- it("should exist", function() {
+ it("globalization.spec.1 should exist", function() {
expect(navigator.globalization).toBeDefined();
});
describe("getLocaleName", function() {
- it("should exist", function() {
+ it("globalization.spec.1 should exist", function() {
expect(typeof navigator.globalization.getLocaleName).toBeDefined();
expect(typeof navigator.globalization.getLocaleName == 'function').toBe(true);
});
- it("getLocaleName success callback should be called with a Properties object", function() {
+ it("globalization.spec.3 getLocaleName success callback should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -31,11 +31,11 @@ describe('Globalization (navigator.globalization)', function () {
});
describe("dateToString", function() {
- it("should exist", function() {
+ it("globalization.spec.1 should exist", function() {
expect(typeof navigator.globalization.dateToString).toBeDefined();
expect(typeof navigator.globalization.dateToString == 'function').toBe(true);
});
- it("dateToString using default options, success callback should be called with a Properties object", function() {
+ it("globalization.spec.5 dateToString using default options, success callback should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -55,7 +55,7 @@ describe('Globalization (navigator.globalization)', function () {
expect(fail).not.toHaveBeenCalled();
});
});
- it("dateToString using formatLength=short and selector=date options, success callback should be called with a Properties object", function() {
+ it("globalization.spec.6 dateToString using formatLength=short and selector=date options, success callback should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -75,7 +75,7 @@ describe('Globalization (navigator.globalization)', function () {
expect(fail).not.toHaveBeenCalled();
});
});
- it("dateToString using formatLength=full and selector=date options, success callback should be called with a Properties object", function() {
+ it("globalization.spec.7 dateToString using formatLength=full and selector=date options, success callback should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -95,7 +95,7 @@ describe('Globalization (navigator.globalization)', function () {
expect(fail).not.toHaveBeenCalled();
});
});
- it("dateToString using formatLength=medium and selector=date and time(default) options, success callback should be called with a Properties object", function() {
+ it("globalization.spec.8 dateToString using formatLength=medium and selector=date and time(default) options, success callback should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -115,7 +115,7 @@ describe('Globalization (navigator.globalization)', function () {
expect(fail).not.toHaveBeenCalled();
});
});
- it("dateToString using formatLength=long and selector=date and time(default) options, success callback should be called with a Properties object", function() {
+ it("globalization.spec.9 dateToString using formatLength=long and selector=date and time(default) options, success callback should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -135,7 +135,7 @@ describe('Globalization (navigator.globalization)', function () {
expect(fail).not.toHaveBeenCalled();
});
});
- it("dateToString using formatLength=full and selector=date and time(default) options, success callback should be called with a Properties object", function() {
+ it("globalization.spec.10 dateToString using formatLength=full and selector=date and time(default) options, success callback should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -158,11 +158,11 @@ describe('Globalization (navigator.globalization)', function () {
});
describe("stringToDate", function() {
- it("should exist", function() {
+ it("globalization.spec.1 should exist", function() {
expect(typeof navigator.globalization.stringToDate).toBeDefined();
expect(typeof navigator.globalization.stringToDate == 'function').toBe(true);
});
- it("stringToDate using default options, success callback should be called with a Properties object", function() {
+ it("globalization.spec.12 stringToDate using default options, success callback should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -203,7 +203,7 @@ describe('Globalization (navigator.globalization)', function () {
expect(fail).not.toHaveBeenCalled();
});
});
- it("stringToDate using formatLength=short and selector=date options, success callback should be called with a Properties object", function() {
+ it("globalization.spec.13 stringToDate using formatLength=short and selector=date options, success callback should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -244,7 +244,7 @@ describe('Globalization (navigator.globalization)', function () {
expect(fail).not.toHaveBeenCalled();
});
});
- it("stringToDate using formatLength=full and selector=date options, success callback should be called with a Properties object", function() {
+ it("globalization.spec.14 stringToDate using formatLength=full and selector=date options, success callback should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -284,7 +284,7 @@ describe('Globalization (navigator.globalization)', function () {
expect(fail).not.toHaveBeenCalled();
});
});
- it("stringToDate using invalid date, error callback should be called with a GlobalizationError object", function() {
+ it("globalization.spec.15 stringToDate using invalid date, error callback should be called with a GlobalizationError object", function() {
var win = jasmine.createSpy(),
fail = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
@@ -310,11 +310,11 @@ describe('Globalization (navigator.globalization)', function () {
});
describe("getDatePattern", function() {
- it("should exist", function() {
+ it("globalization.spec.1 should exist", function() {
expect(typeof navigator.globalization.getDatePattern).toBeDefined();
expect(typeof navigator.globalization.getDatePattern == 'function').toBe(true);
});
- it("getDatePattern using default options, success callback should be called with a Properties object", function() {
+ it("globalization.spec.17 getDatePattern using default options, success callback should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -341,7 +341,7 @@ describe('Globalization (navigator.globalization)', function () {
expect(fail).not.toHaveBeenCalled();
});
});
- it("getDatePattern using formatLength=medium and selector=date options, success callback should be called with a Properties object", function() {
+ it("globalization.spec.18 getDatePattern using formatLength=medium and selector=date options, success callback should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -371,11 +371,11 @@ describe('Globalization (navigator.globalization)', function () {
});
describe("getDateNames", function() {
- it("should exist", function() {
+ it("globalization.spec.1 should exist", function() {
expect(typeof navigator.globalization.getDateNames).toBeDefined();
expect(typeof navigator.globalization.getDateNames == 'function').toBe(true);
});
- it("getDateNames using default options, success callback should be called with a Properties object", function() {
+ it("globalization.spec.20 getDateNames using default options, success callback should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -396,7 +396,7 @@ describe('Globalization (navigator.globalization)', function () {
expect(fail).not.toHaveBeenCalled();
});
});
- it("getDateNames using type=narrow and item=days options, success callback should be called with a Properties object", function() {
+ it("globalization.spec.21 getDateNames using type=narrow and item=days options, success callback should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -417,7 +417,7 @@ describe('Globalization (navigator.globalization)', function () {
expect(fail).not.toHaveBeenCalled();
});
});
- it("getDateNames using type=narrow and item=months options, success callback should be called with a Properties object", function() {
+ it("globalization.spec.22 getDateNames using type=narrow and item=months options, success callback should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -438,7 +438,7 @@ describe('Globalization (navigator.globalization)', function () {
expect(fail).not.toHaveBeenCalled();
});
});
- it("getDateNames using type=wide and item=days options, success callback should be called with a Properties object", function() {
+ it("globalization.spec.23 getDateNames using type=wide and item=days options, success callback should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -459,7 +459,7 @@ describe('Globalization (navigator.globalization)', function () {
expect(fail).not.toHaveBeenCalled();
});
});
- it("getDateNames using type=wide and item=months options, success callback should be called with a Properties object", function() {
+ it("globalization.spec.24 getDateNames using type=wide and item=months options, success callback should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -483,11 +483,11 @@ describe('Globalization (navigator.globalization)', function () {
});
describe("isDayLightSavingsTime", function() {
- it("should exist", function() {
+ it("globalization.spec.1 should exist", function() {
expect(typeof navigator.globalization.isDayLightSavingsTime).toBeDefined();
expect(typeof navigator.globalization.isDayLightSavingsTime == 'function').toBe(true);
});
- it("isDayLightSavingsTime using default options, success callback should be called with a Properties object", function() {
+ it("globalization.spec.26 isDayLightSavingsTime using default options, success callback should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -509,11 +509,11 @@ describe('Globalization (navigator.globalization)', function () {
});
describe("getFirstDayOfWeek", function() {
- it("should exist", function() {
+ it("globalization.spec.1 should exist", function() {
expect(typeof navigator.globalization.getFirstDayOfWeek).toBeDefined();
expect(typeof navigator.globalization.getFirstDayOfWeek == 'function').toBe(true);
});
- it("getFirstDayOfWeek success callback should be called with a Properties object", function() {
+ it("globalization.spec.28 getFirstDayOfWeek success callback should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -535,11 +535,11 @@ describe('Globalization (navigator.globalization)', function () {
});
describe("numberToString", function() {
- it("should exist", function() {
+ it("globalization.spec.1 should exist", function() {
expect(typeof navigator.globalization.numberToString).toBeDefined();
expect(typeof navigator.globalization.numberToString == 'function').toBe(true);
});
- it("numberToString using default options, should be called with a Properties object", function() {
+ it("globalization.spec.30 numberToString using default options, should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -559,7 +559,7 @@ describe('Globalization (navigator.globalization)', function () {
expect(fail).not.toHaveBeenCalled();
});
});
- it("numberToString using type=percent options, should be called with a Properties object", function() {
+ it("globalization.spec.31 numberToString using type=percent options, should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -579,7 +579,7 @@ describe('Globalization (navigator.globalization)', function () {
expect(fail).not.toHaveBeenCalled();
});
});
- it("numberToString using type=currency options, should be called with a Properties object", function() {
+ it("globalization.spec.32 numberToString using type=currency options, should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -602,11 +602,11 @@ describe('Globalization (navigator.globalization)', function () {
});
describe("stringToNumber", function() {
- it("should exist", function() {
+ it("globalization.spec.1 should exist", function() {
expect(typeof navigator.globalization.stringToNumber).toBeDefined();
expect(typeof navigator.globalization.stringToNumber == 'function').toBe(true);
});
- it("stringToNumber using default options, should be called with a Properties object", function() {
+ it("globalization.spec.34 stringToNumber using default options, should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -630,7 +630,7 @@ describe('Globalization (navigator.globalization)', function () {
expect(fail).not.toHaveBeenCalled();
});
});
- it("stringToNumber using type=percent options, should be called with a Properties object", function() {
+ it("globalization.spec.35 stringToNumber using type=percent options, should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -657,11 +657,11 @@ describe('Globalization (navigator.globalization)', function () {
});
describe("getNumberPattern", function() {
- it("should exist", function() {
+ it("globalization.spec.1 should exist", function() {
expect(typeof navigator.globalization.getNumberPattern).toBeDefined();
expect(typeof navigator.globalization.getNumberPattern == 'function').toBe(true);
});
- it("getNumberPattern using default options, success callback should be called with a Properties object", function() {
+ it("globalization.spec.37 getNumberPattern using default options, success callback should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -696,7 +696,7 @@ describe('Globalization (navigator.globalization)', function () {
expect(fail).not.toHaveBeenCalled();
});
});
- it("getNumberPattern using type=percent, success callback should be called with a Properties object", function() {
+ it("globalization.spec.38 getNumberPattern using type=percent, success callback should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -731,7 +731,7 @@ describe('Globalization (navigator.globalization)', function () {
expect(fail).not.toHaveBeenCalled();
});
});
- it("getNumberPattern using type=currency, success callback should be called with a Properties object", function() {
+ it("globalization.spec.39 getNumberPattern using type=currency, success callback should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -769,11 +769,11 @@ describe('Globalization (navigator.globalization)', function () {
});
describe("getCurrencyPattern", function() {
- it("should exist", function() {
+ it("globalization.spec.1 should exist", function() {
expect(typeof navigator.globalization.getCurrencyPattern).toBeDefined();
expect(typeof navigator.globalization.getCurrencyPattern == 'function').toBe(true);
});
- it("getCurrencyPattern using EUR for currency, success callback should be called with a Properties object", function() {
+ it("globalization.spec.41 getCurrencyPattern using EUR for currency, success callback should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
@@ -805,4 +805,4 @@ describe('Globalization (navigator.globalization)', function () {
});
});
});
-});
\ No newline at end of file
+});
http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/ef604562/autotest/tests/media.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/media.tests.js b/autotest/tests/media.tests.js
index b143e0a..8e484dc 100644
--- a/autotest/tests/media.tests.js
+++ b/autotest/tests/media.tests.js
@@ -25,7 +25,7 @@ describe('Media', function () {
expect(typeof Media).toBe("function");
});
- it("should have the following properties", function() {
+ it("media.spec.1 should have the following properties", function() {
var media1 = new Media("dummy");
expect(media1.id).toBeDefined();
expect(media1.src).toBeDefined();
@@ -43,70 +43,70 @@ describe('Media', function () {
expect(MediaError.MEDIA_ERR_NONE_SUPPORTED).toBe(4);
});
- it("should contain a play function", function() {
+ it("media.spec.2 should contain a play function", function() {
var media1 = new Media();
expect(media1.play).toBeDefined();
expect(typeof media1.play).toBe('function');
media1.release();
});
- it("should contain a stop function", function() {
+ it("media.spec.3 should contain a stop function", function() {
var media1 = new Media();
expect(media1.stop).toBeDefined();
expect(typeof media1.stop).toBe('function');
media1.release();
});
- it("should contain a seekTo function", function() {
+ it("media.spec.4 should contain a seekTo function", function() {
var media1 = new Media();
expect(media1.seekTo).toBeDefined();
expect(typeof media1.seekTo).toBe('function');
media1.release();
});
- it("should contain a pause function", function() {
+ it("media.spec.5 should contain a pause function", function() {
var media1 = new Media();
expect(media1.pause).toBeDefined();
expect(typeof media1.pause).toBe('function');
media1.release();
});
- it("should contain a getDuration function", function() {
+ it("media.spec.6 should contain a getDuration function", function() {
var media1 = new Media();
expect(media1.getDuration).toBeDefined();
expect(typeof media1.getDuration).toBe('function');
media1.release();
});
- it("should contain a getCurrentPosition function", function() {
+ it("media.spec.7 should contain a getCurrentPosition function", function() {
var media1 = new Media();
expect(media1.getCurrentPosition).toBeDefined();
expect(typeof media1.getCurrentPosition).toBe('function');
media1.release();
});
- it("should contain a startRecord function", function() {
+ it("media.spec.8 should contain a startRecord function", function() {
var media1 = new Media();
expect(media1.startRecord).toBeDefined();
expect(typeof media1.startRecord).toBe('function');
media1.release();
});
- it("should contain a stopRecord function", function() {
+ it("media.spec.9 should contain a stopRecord function", function() {
var media1 = new Media();
expect(media1.stopRecord).toBeDefined();
expect(typeof media1.stopRecord).toBe('function');
media1.release();
});
- it("should contain a release function", function() {
+ it("media.spec.10 should contain a release function", function() {
var media1 = new Media();
expect(media1.release).toBeDefined();
expect(typeof media1.release).toBe('function');
media1.release();
});
- it("should contain a setVolume function", function() {
+ it("media.spec.11 should contain a setVolume function", function() {
var media1 = new Media();
expect(media1.setVolume).toBeDefined();
expect(typeof media1.setVolume).toBe('function');
@@ -134,7 +134,7 @@ describe('Media', function () {
});
});
- it("position should be set properly", function() {
+ it("media.spec.12 position should be set properly", function() {
var media1 = new Media("http://cordova.apache.org/downloads/BlueZedEx.mp3"),
test = jasmine.createSpy().andCallFake(function(position) {
console.log("position = " + position);
@@ -154,7 +154,7 @@ describe('Media', function () {
waitsFor(function () { return test.wasCalled; }, Tests.TEST_TIMEOUT);
});
- it("duration should be set properly", function() {
+ it("media.spec.13 duration should be set properly", function() {
var media1 = new Media("http://cordova.apache.org/downloads/BlueZedEx.mp3");
media1.play();
waits(5000);
http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/ef604562/autotest/tests/network.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/network.tests.js b/autotest/tests/network.tests.js
index dd93a59..8399b26 100644
--- a/autotest/tests/network.tests.js
+++ b/autotest/tests/network.tests.js
@@ -20,12 +20,12 @@
*/
describe('Network (navigator.connection)', function () {
- it("should exist", function() {
+ it("network.spec.1 should exist", function() {
expect(navigator.network && navigator.network.connection).toBeDefined();
expect(navigator.connection).toBeDefined();
});
- it("should be set to a valid value", function() {
+ it("network.spec.2 should be set to a valid value", function() {
var validValues = {
'unknown': 1,
'ethernet': 1,
@@ -38,11 +38,11 @@ describe('Network (navigator.connection)', function () {
expect(validValues[navigator.connection.type]).toBe(1);
});
- it("should have the same value in deprecated and non-deprecated apis", function() {
+ it("network.spec.3 should have the same value in deprecated and non-deprecated apis", function() {
expect(navigator.network.connection.type).toBe(navigator.connection.type);
});
- it("should define constants for connection status", function() {
+ it("network.spec.4 should define constants for connection status", function() {
expect(Connection.UNKNOWN).toBe("unknown");
expect(Connection.ETHERNET).toBe("ethernet");
expect(Connection.WIFI).toBe("wifi");
http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/ef604562/autotest/tests/platform.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/platform.tests.js b/autotest/tests/platform.tests.js
index 0ec7018..4a1c1a4 100644
--- a/autotest/tests/platform.tests.js
+++ b/autotest/tests/platform.tests.js
@@ -20,11 +20,11 @@
*/
describe('Platform (cordova)', function () {
- it("should exist", function() {
+ it("platform.spec.1 should exist", function() {
expect(cordova).toBeDefined();
});
- it("exec method should exist", function() {
+ it("platform.spec.2 exec method should exist", function() {
expect(cordova.exec).toBeDefined();
expect(typeof cordova.exec).toBe('function');
});
http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/ef604562/autotest/tests/storage.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/storage.tests.js b/autotest/tests/storage.tests.js
index a613087..0294063 100644
--- a/autotest/tests/storage.tests.js
+++ b/autotest/tests/storage.tests.js
@@ -20,7 +20,7 @@
*/
describe("Session Storage", function () {
- it("should exist", function () {
+ it("storage.spec.1 should exist", function () {
expect(window.sessionStorage).toBeDefined();
expect(typeof window.sessionStorage.length).not.toBe('undefined');
expect(typeof(window.sessionStorage.key)).toBe('function');
@@ -30,7 +30,7 @@ describe("Session Storage", function () {
expect(typeof(window.sessionStorage.clear)).toBe('function');
});
- it("check length", function () {
+ it("storage.spec.2 check length", function () {
expect(window.sessionStorage.length).toBe(0);
window.sessionStorage.setItem("key","value");
expect(window.sessionStorage.length).toBe(1);
@@ -38,7 +38,7 @@ describe("Session Storage", function () {
expect(window.sessionStorage.length).toBe(0);
});
- it("check key", function () {
+ it("storage.spec.3 check key", function () {
expect(window.sessionStorage.key(0)).toBe(null);
window.sessionStorage.setItem("test","value");
expect(window.sessionStorage.key(0)).toBe("test");
@@ -46,7 +46,7 @@ describe("Session Storage", function () {
expect(window.sessionStorage.key(0)).toBe(null);
});
- it("check getItem", function() {
+ it("storage.spec.4 check getItem", function() {
expect(window.sessionStorage.getItem("item")).toBe(null);
window.sessionStorage.setItem("item","value");
expect(window.sessionStorage.getItem("item")).toBe("value");
@@ -54,7 +54,7 @@ describe("Session Storage", function () {
expect(window.sessionStorage.getItem("item")).toBe(null);
});
- it("check setItem", function() {
+ it("storage.spec.5 check setItem", function() {
expect(window.sessionStorage.getItem("item")).toBe(null);
window.sessionStorage.setItem("item","value");
expect(window.sessionStorage.getItem("item")).toBe("value");
@@ -64,7 +64,7 @@ describe("Session Storage", function () {
expect(window.sessionStorage.getItem("item")).toBe(null);
});
- it("can remove an item", function () {
+ it("storage.spec.6 can remove an item", function () {
expect(window.sessionStorage.getItem("item")).toBe(null);
window.sessionStorage.setItem("item","value");
expect(window.sessionStorage.getItem("item")).toBe("value");
@@ -72,7 +72,7 @@ describe("Session Storage", function () {
expect(window.sessionStorage.getItem("item")).toBe(null);
});
- it("check clear", function() {
+ it("storage.spec.7 check clear", function() {
window.sessionStorage.setItem("item1","value");
window.sessionStorage.setItem("item2","value");
window.sessionStorage.setItem("item3","value");
@@ -81,7 +81,7 @@ describe("Session Storage", function () {
expect(window.sessionStorage.length).toBe(0);
});
- it("check dot notation", function() {
+ it("storage.spec.8 check dot notation", function() {
expect(window.sessionStorage.item).not.toBeDefined();
window.sessionStorage.item = "value";
expect(window.sessionStorage.item).toBe("value");
@@ -90,7 +90,7 @@ describe("Session Storage", function () {
});
describe("Local Storage", function () {
- it("should exist", function() {
+ it("storage.spec.9 should exist", function() {
expect(window.localStorage).toBeDefined();
expect(window.localStorage.length).toBeDefined();
expect(typeof window.localStorage.key).toBe("function");
@@ -100,7 +100,7 @@ describe("Session Storage", function () {
expect(typeof window.localStorage.clear).toBe("function");
});
- it("check length", function() {
+ it("storage.spec.10 check length", function() {
expect(window.localStorage.length).toBe(0);
window.localStorage.setItem("key","value");
expect(window.localStorage.length).toBe(1);
@@ -108,7 +108,7 @@ describe("Session Storage", function () {
expect(window.localStorage.length).toBe(0);
});
- it("check key", function() {
+ it("storage.spec.11 check key", function() {
expect(window.localStorage.key(0)).toBe(null);
window.localStorage.setItem("test","value");
expect(window.localStorage.key(0)).toBe("test");
@@ -116,7 +116,7 @@ describe("Session Storage", function () {
expect(window.localStorage.key(0)).toBe(null);
});
- it("check getItem", function() {
+ it("storage.spec.4 check getItem", function() {
expect(window.localStorage.getItem("item")).toBe(null);
window.localStorage.setItem("item","value");
expect(window.localStorage.getItem("item")).toBe("value");
@@ -124,7 +124,7 @@ describe("Session Storage", function () {
expect(window.localStorage.getItem("item")).toBe(null);
});
- it("check setItem", function() {
+ it("storage.spec.5 check setItem", function() {
expect(window.localStorage.getItem("item")).toBe(null);
window.localStorage.setItem("item","value");
expect(window.localStorage.getItem("item")).toBe("value");
@@ -134,7 +134,7 @@ describe("Session Storage", function () {
expect(window.localStorage.getItem("item")).toBe(null);
});
- it("check removeItem", function() {
+ it("storage.spec.14 check removeItem", function() {
expect(window.localStorage.getItem("item")).toBe(null);
window.localStorage.setItem("item","value");
expect(window.localStorage.getItem("item")).toBe("value");
@@ -142,7 +142,7 @@ describe("Session Storage", function () {
expect(window.localStorage.getItem("item")).toBe(null);
});
- it("check clear", function() {
+ it("storage.spec.7 check clear", function() {
expect(window.localStorage.getItem("item1")).toBe(null);
expect(window.localStorage.getItem("item2")).toBe(null);
expect(window.localStorage.getItem("item3")).toBe(null);
@@ -160,7 +160,7 @@ describe("Session Storage", function () {
expect(window.localStorage.getItem("item3")).toBe(null);
});
- it("check dot notation", function() {
+ it("storage.spec.8 check dot notation", function() {
expect(window.localStorage.item).not.toBeDefined();
window.localStorage.item = "value";
expect(window.localStorage.item).toBe("value");
@@ -170,11 +170,11 @@ describe("Session Storage", function () {
});
describe("HTML 5 Storage", function () {
- it("should exist", function() {
+ it("storage.spec.9 should exist", function() {
expect(window.openDatabase);
});
- it("Should be able to create and drop tables", function() {
+ it("storage.spec.18 Should be able to create and drop tables", function() {
var win = jasmine.createSpy('win');
var fail1 = createDoNotCallSpy('fail1');
var fail2 = createDoNotCallSpy('fail2');
http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/ef604562/bin/toetag
----------------------------------------------------------------------
diff --git a/bin/toetag b/bin/toetag
new file mode 100755
index 0000000..a1ae2b4
--- /dev/null
+++ b/bin/toetag
@@ -0,0 +1,83 @@
+##
+ #
+ # Licensed to the Apache Software Foundation (ASF) under one
+ # or more contributor license agreements. See the NOTICE file
+ # distributed with this work for additional information
+ # regarding copyright ownership. The ASF licenses this file
+ # to you under the Apache License, Version 2.0 (the
+ # "License"); you may not use this file except in compliance
+ # with the License. You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing,
+ # software distributed under the License is distributed on an
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ # KIND, either express or implied. See the License for the
+ # specific language governing permissions and limitations
+ # under the License.
+ #
+##
+
+
+##
+ #
+ #
+ #
+##
+
+defaultpath="../autotest/tests/"
+
+##
+ # regex
+##
+# regex for id'ing a spec
+specreg="^[ \t]*it(\".*"
+# regex for id'ing a tagged spec
+tagged=".*spec\.[0-9]*"
+# default suite name
+suitename="SUITE"
+
+toetagtargets() {
+ for file in ${targets[@]}
+ do
+ echo toetagging $file
+ suitename $file
+ echo Suite Name: $suitename
+ found=$(grep -c "$specreg" $defaultpath$file)
+ foundtagged=$(grep -c "$tagged" $defaultpath$file)
+ echo found $found specs to toetag
+ echo found $foundtagged specs already tagged
+ tagcode=0
+ declare -i tagcode
+ temp=$IFS
+ IFS="
+"
+ totag=$(grep $specreg $defaultpath$file | grep -v $tagged)
+ for line in $totag
+ do
+ tagcode=$tagcode+1
+ modline=$(echo "$line" | sed s/it\(\"/it\(\"$suitename.spec.$tagcode\ /)
+ echo "$line"
+ sed -i '.bak' s#"$line"#"$modline"# $defaultpath$file
+ done
+ echo
+ IFS=$temp
+ echo
+ echo
+ done
+}
+
+##
+ # suite name is first segment of file name delimited by '.'
+##
+suitename() {
+ temp=$IFS
+ IFS='.'
+ read -ra suitename <<< "$1"
+ IFS=$temp
+}
+
+# read all entries in default_path
+read -a targets <<< $(ls $defaultpath)
+toetagtargets
[2/2] spec commit: [CB-2913] squashed commits of toetag script,
tags jasmine unit tests with unique id
Posted by lo...@apache.org.
[CB-2913] squashed commits of toetag script, tags jasmine unit tests with unique id
[CB-2913] initial commit of toetag script
toetag parses unit tests, adding a spec id
grep commands and regex in place
[CB-2913] toetag script
toetag iterates through the default directory,
gives test sane names, should handle adding tests sanely
slow, too much grep
[CB-2913] toetag inserts in place
works with (around) ios sed/stdin security,
produces backup (.bak) files for files that have changed
inserts tag id's in place
[CB-2913] escaped regex protecting multiple tag inclusion
[CB-2913] escaped replace string so no characters are interpreted as sed flags or regex
[CB-2913] reactivated dir search for js files
[CB-2913] switched sed delimiter to avoid f-up with certain test names
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/ef604562
Tree: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/tree/ef604562
Diff: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/diff/ef604562
Branch: refs/heads/master
Commit: ef604562b780b066d6cdd4858f154d44890d8566
Parents: 93f50ae
Author: lorinbeer <lo...@adobe.com>
Authored: Fri Apr 5 14:19:08 2013 -0700
Committer: lorinbeer <lo...@adobe.com>
Committed: Mon Apr 8 14:44:40 2013 -0700
----------------------------------------------------------------------
autotest/tests/accelerometer.tests.js | 22 ++--
autotest/tests/battery.tests.js | 2 +-
autotest/tests/camera.tests.js | 10 +-
autotest/tests/capture.tests.js | 24 ++--
autotest/tests/compass.tests.js | 18 ++--
autotest/tests/contacts.tests.js | 50 ++++----
autotest/tests/datauri.tests.js | 4 +-
autotest/tests/file.tests.js | 206 ++++++++++++++--------------
autotest/tests/filetransfer.tests.js | 54 ++++----
autotest/tests/geolocation.tests.js | 16 +-
autotest/tests/globalization.tests.js | 84 ++++++------
autotest/tests/media.tests.js | 26 ++--
autotest/tests/network.tests.js | 8 +-
autotest/tests/platform.tests.js | 4 +-
autotest/tests/storage.tests.js | 36 +++---
bin/toetag | 83 +++++++++++
16 files changed, 365 insertions(+), 282 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/ef604562/autotest/tests/accelerometer.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/accelerometer.tests.js b/autotest/tests/accelerometer.tests.js
index 6898338..d758473 100644
--- a/autotest/tests/accelerometer.tests.js
+++ b/autotest/tests/accelerometer.tests.js
@@ -20,17 +20,17 @@
*/
describe('Accelerometer (navigator.accelerometer)', function () {
- it("should exist", function () {
+ it("accelerometer.spec.1 should exist", function () {
expect(navigator.accelerometer).toBeDefined();
});
describe("getCurrentAcceleration", function() {
- it("should exist", function() {
+ it("accelerometer.spec.2 should exist", function() {
expect(typeof navigator.accelerometer.getCurrentAcceleration).toBeDefined();
expect(typeof navigator.accelerometer.getCurrentAcceleration == 'function').toBe(true);
});
- it("success callback should be called with an Acceleration object", function() {
+ it("accelerometer.spec.3 success callback should be called with an Acceleration object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(a.x).toBeDefined();
@@ -55,7 +55,7 @@ describe('Accelerometer (navigator.accelerometer)', function () {
});
});
- it("success callback Acceleration object should have (reasonable) values for x, y and z expressed in m/s^2", function() {
+ it("accelerometer.spec.4 success callback Acceleration object should have (reasonable) values for x, y and z expressed in m/s^2", function() {
var reasonableThreshold = 15;
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a.x).toBeLessThan(reasonableThreshold);
@@ -78,7 +78,7 @@ describe('Accelerometer (navigator.accelerometer)', function () {
});
});
- it("success callback Acceleration object should return a recent timestamp", function() {
+ it("accelerometer.spec.5 success callback Acceleration object should return a recent timestamp", function() {
var veryRecently = (new Date()).getTime();
// Need to check that dates returned are not vastly greater than a recent time stamp.
// In case the timestamps returned are ridiculously high
@@ -108,11 +108,11 @@ describe('Accelerometer (navigator.accelerometer)', function () {
navigator.accelerometer.clearWatch(id);
});
- it("should exist", function() {
+ it("accelerometer.spec.2 should exist", function() {
expect(navigator.accelerometer.watchAcceleration).toBeDefined();
expect(typeof navigator.accelerometer.watchAcceleration == 'function').toBe(true);
});
- it("success callback should be called with an Acceleration object", function() {
+ it("accelerometer.spec.3 success callback should be called with an Acceleration object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(a.x).toBeDefined();
@@ -137,7 +137,7 @@ describe('Accelerometer (navigator.accelerometer)', function () {
});
});
- it("success callback Acceleration object should have (reasonable) values for x, y and z expressed in m/s^2", function() {
+ it("accelerometer.spec.4 success callback Acceleration object should have (reasonable) values for x, y and z expressed in m/s^2", function() {
var reasonableThreshold = 15;
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a.x).toBeLessThan(reasonableThreshold);
@@ -160,7 +160,7 @@ describe('Accelerometer (navigator.accelerometer)', function () {
});
});
- it("success callback Acceleration object should return a recent timestamp", function() {
+ it("accelerometer.spec.5 success callback Acceleration object should return a recent timestamp", function() {
var veryRecently = (new Date()).getTime();
// Need to check that dates returned are not vastly greater than a recent time stamp.
// In case the timestamps returned are ridiculously high
@@ -184,12 +184,12 @@ describe('Accelerometer (navigator.accelerometer)', function () {
});
describe("clearWatch", function() {
- it("should exist", function() {
+ it("accelerometer.spec.2 should exist", function() {
expect(navigator.accelerometer.clearWatch).toBeDefined();
expect(typeof navigator.accelerometer.clearWatch == 'function').toBe(true);
});
- it("should clear an existing watch", function() {
+ it("accelerometer.spec.11 should clear an existing watch", function() {
var id,
win = jasmine.createSpy();
http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/ef604562/autotest/tests/battery.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/battery.tests.js b/autotest/tests/battery.tests.js
index d5118ee..6646429 100644
--- a/autotest/tests/battery.tests.js
+++ b/autotest/tests/battery.tests.js
@@ -20,7 +20,7 @@
*/
describe('Battery (navigator.battery)', function () {;
- it("should exist", function() {
+ it("battery.spec.1 should exist", function() {
expect(navigator.battery).toBeDefined();
});
});
http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/ef604562/autotest/tests/camera.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/camera.tests.js b/autotest/tests/camera.tests.js
index ccc351b..ee5bacd 100644
--- a/autotest/tests/camera.tests.js
+++ b/autotest/tests/camera.tests.js
@@ -31,11 +31,11 @@ describe('Camera (navigator.camera)', function () {
});
describe('Camera Constants (window.Camera + navigator.camera)', function () {
- it("window.Camera should exist", function() {
+ it("camera.spec.1 window.Camera should exist", function() {
expect(window.Camera).toBeDefined();
});
- it("should contain three DestinationType constants", function() {
+ it("camera.spec.2 should contain three DestinationType constants", function() {
expect(Camera.DestinationType.DATA_URL).toBe(0);
expect(Camera.DestinationType.FILE_URI).toBe(1);
expect(Camera.DestinationType.NATIVE_URI).toBe(2);
@@ -44,14 +44,14 @@ describe('Camera Constants (window.Camera + navigator.camera)', function () {
expect(navigator.camera.DestinationType.NATIVE_URI).toBe(2);
});
- it("should contain two EncodingType constants", function() {
+ it("camera.spec.3 should contain two EncodingType constants", function() {
expect(Camera.EncodingType.JPEG).toBe(0);
expect(Camera.EncodingType.PNG).toBe(1);
expect(navigator.camera.EncodingType.JPEG).toBe(0);
expect(navigator.camera.EncodingType.PNG).toBe(1);
});
- it("should contain three MediaType constants", function() {
+ it("camera.spec.4 should contain three MediaType constants", function() {
expect(Camera.MediaType.PICTURE).toBe(0);
expect(Camera.MediaType.VIDEO).toBe(1);
expect(Camera.MediaType.ALLMEDIA).toBe(2);
@@ -59,7 +59,7 @@ describe('Camera Constants (window.Camera + navigator.camera)', function () {
expect(navigator.camera.MediaType.VIDEO).toBe(1);
expect(navigator.camera.MediaType.ALLMEDIA).toBe(2);
});
- it("should contain three PictureSourceType constants", function() {
+ it("camera.spec.5 should contain three PictureSourceType constants", function() {
expect(Camera.PictureSourceType.PHOTOLIBRARY).toBe(0);
expect(Camera.PictureSourceType.CAMERA).toBe(1);
expect(Camera.PictureSourceType.SAVEDPHOTOALBUM).toBe(2);
http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/ef604562/autotest/tests/capture.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/capture.tests.js b/autotest/tests/capture.tests.js
index 38540ac..25483dc 100644
--- a/autotest/tests/capture.tests.js
+++ b/autotest/tests/capture.tests.js
@@ -20,34 +20,34 @@
*/
describe('Capture (navigator.device.capture)', function () {
- it("should exist", function() {
+ it("capture.spec.1 should exist", function() {
expect(navigator.device).toBeDefined();
expect(navigator.device.capture).toBeDefined();
});
- it("should have the correct properties ", function() {
+ it("capture.spec.2 should have the correct properties ", function() {
expect(navigator.device.capture.supportedAudioModes).toBeDefined();
expect(navigator.device.capture.supportedImageModes).toBeDefined();
expect(navigator.device.capture.supportedVideoModes).toBeDefined();
});
- it("should contain a captureAudio function", function() {
+ it("capture.spec.3 should contain a captureAudio function", function() {
expect(navigator.device.capture.captureAudio).toBeDefined();
expect(typeof navigator.device.capture.captureAudio == 'function').toBe(true);
});
- it("should contain a captureImage function", function() {
+ it("capture.spec.4 should contain a captureImage function", function() {
expect(navigator.device.capture.captureImage).toBeDefined();
expect(typeof navigator.device.capture.captureImage == 'function').toBe(true);
});
- it("should contain a captureVideo function", function() {
+ it("capture.spec.5 should contain a captureVideo function", function() {
expect(navigator.device.capture.captureVideo).toBeDefined();
expect(typeof navigator.device.capture.captureVideo == 'function').toBe(true);
});
describe('CaptureAudioOptions', function () {
- it("CaptureAudioOptions constructor should exist", function() {
+ it("capture.spec.6 CaptureAudioOptions constructor should exist", function() {
var options = new CaptureAudioOptions();
expect(options).toBeDefined();
expect(options.limit).toBeDefined();
@@ -57,7 +57,7 @@ describe('Capture (navigator.device.capture)', function () {
});
describe('CaptureImageOptions', function () {
- it("CaptureImageOptions constructor should exist", function() {
+ it("capture.spec.7 CaptureImageOptions constructor should exist", function() {
var options = new CaptureImageOptions();
expect(options).toBeDefined();
expect(options.limit).toBeDefined();
@@ -66,7 +66,7 @@ describe('Capture (navigator.device.capture)', function () {
});
describe('CaptureVideoOptions', function () {
- it("CaptureVideoOptions constructor should exist", function() {
+ it("capture.spec.8 CaptureVideoOptions constructor should exist", function() {
var options = new CaptureVideoOptions();
expect(options).toBeDefined();
expect(options.limit).toBeDefined();
@@ -76,14 +76,14 @@ describe('Capture (navigator.device.capture)', function () {
});
describe('CaptureError interface', function () {
- it("CaptureError constants should be defined", function() {
+ it("capture.spec.9 CaptureError constants should be defined", function() {
expect(CaptureError.CAPTURE_INTERNAL_ERR).toBe(0);
expect(CaptureError.CAPTURE_APPLICATION_BUSY).toBe(1);
expect(CaptureError.CAPTURE_INVALID_ARGUMENT).toBe(2);
expect(CaptureError.CAPTURE_NO_MEDIA_FILES).toBe(3);
});
- it("CaptureError properties should exist", function() {
+ it("capture.spec.10 CaptureError properties should exist", function() {
var error = new CaptureError();
expect(error).toBeDefined();
expect(error.code).toBeDefined();
@@ -91,7 +91,7 @@ describe('Capture (navigator.device.capture)', function () {
});
describe('MediaFileData', function () {
- it("MediaFileData constructor should exist", function() {
+ it("capture.spec.11 MediaFileData constructor should exist", function() {
var fileData = new MediaFileData();
expect(fileData).toBeDefined();
expect(fileData.bitrate).toBeDefined();
@@ -103,7 +103,7 @@ describe('Capture (navigator.device.capture)', function () {
});
describe('MediaFile', function () {
- it("MediaFile constructor should exist", function() {
+ it("capture.spec.12 MediaFile constructor should exist", function() {
var fileData = new MediaFile();
expect(fileData).toBeDefined();
expect(fileData.name).toBeDefined();
http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/ef604562/autotest/tests/compass.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/compass.tests.js b/autotest/tests/compass.tests.js
index 236a584..edaced2 100644
--- a/autotest/tests/compass.tests.js
+++ b/autotest/tests/compass.tests.js
@@ -20,16 +20,16 @@
*/
describe('Compass (navigator.compass)', function () {
- it("should exist", function() {
+ it("compass.spec.1 should exist", function() {
expect(navigator.compass).toBeDefined();
});
- it("should contain a getCurrentHeading function", function() {
+ it("compass.spec.2 should contain a getCurrentHeading function", function() {
expect(navigator.compass.getCurrentHeading).toBeDefined();
expect(typeof navigator.compass.getCurrentHeading == 'function').toBe(true);
});
- it("getCurrentHeading success callback should be called with a Heading object", function() {
+ it("compass.spec.3 getCurrentHeading success callback should be called with a Heading object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a instanceof CompassHeading).toBe(true);
expect(a.magneticHeading).toBeDefined();
@@ -54,18 +54,18 @@ describe('Compass (navigator.compass)', function () {
});
});
- it("should contain a watchHeading function", function() {
+ it("compass.spec.4 should contain a watchHeading function", function() {
expect(navigator.compass.watchHeading).toBeDefined();
expect(typeof navigator.compass.watchHeading == 'function').toBe(true);
});
- it("should contain a clearWatch function", function() {
+ it("compass.spec.5 should contain a clearWatch function", function() {
expect(navigator.compass.clearWatch).toBeDefined();
expect(typeof navigator.compass.clearWatch == 'function').toBe(true);
});
describe('Compass Constants (window.CompassError)', function () {
- it("should exist", function() {
+ it("compass.spec.1 should exist", function() {
expect(window.CompassError).toBeDefined();
expect(window.CompassError.COMPASS_INTERNAL_ERR).toBe(0);
expect(window.CompassError.COMPASS_NOT_SUPPORTED).toBe(20);
@@ -73,11 +73,11 @@ describe('Compass (navigator.compass)', function () {
});
describe('Compass Heading model (CompassHeading)', function () {
- it("should exist", function() {
+ it("compass.spec.1 should exist", function() {
expect(CompassHeading).toBeDefined();
});
- it("should be able to create a new CompassHeading instance with no parameters", function() {
+ it("compass.spec.8 should be able to create a new CompassHeading instance with no parameters", function() {
var h = new CompassHeading();
expect(h.magneticHeading).toBeDefined();
expect(h.trueHeading).toBeDefined();
@@ -85,7 +85,7 @@ describe('Compass (navigator.compass)', function () {
expect(typeof h.timestamp == 'number').toBe(true);
});
- it("should be able to create a new CompassHeading instance with parameters", function() {
+ it("compass.spec.9 should be able to create a new CompassHeading instance with parameters", function() {
var h = new CompassHeading(1,2,3,4);
expect(h.magneticHeading).toBe(1);
expect(h.trueHeading).toBe(2);
http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/ef604562/autotest/tests/contacts.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/contacts.tests.js b/autotest/tests/contacts.tests.js
index 20ecd34..12520a4 100644
--- a/autotest/tests/contacts.tests.js
+++ b/autotest/tests/contacts.tests.js
@@ -34,17 +34,17 @@ var removeContact = function(){
};
describe("Contacts (navigator.contacts)", function () {
- it("should exist", function() {
+ it("contacts.spec.1 should exist", function() {
expect(navigator.contacts).toBeDefined();
});
- it("should contain a find function", function() {
+ it("contacts.spec.2 should contain a find function", function() {
expect(navigator.contacts.find).toBeDefined();
expect(typeof navigator.contacts.find).toBe('function');
});
describe("find method", function() {
- it("success callback should be called with an array", function() {
+ it("contacts.spec.3 success callback should be called with an array", function() {
var win = jasmine.createSpy().andCallFake(function(result) {
expect(result).toBeDefined();
expect(result instanceof Array).toBe(true);
@@ -65,7 +65,7 @@ describe("Contacts (navigator.contacts)", function () {
});
});
- it("should throw an exception if success callback is empty", function() {
+ it("contacts.spec.4 should throw an exception if success callback is empty", function() {
var fail = function() {};
var obj = new ContactFindOptions();
obj.filter="";
@@ -76,7 +76,7 @@ describe("Contacts (navigator.contacts)", function () {
}).toThrow();
});
- it("error callback should be called when no fields are specified", function() {
+ it("contacts.spec.5 error callback should be called when no fields are specified", function() {
var win = jasmine.createSpy(),
fail = jasmine.createSpy(function(result) {
expect(result).toBeDefined();
@@ -102,7 +102,7 @@ describe("Contacts (navigator.contacts)", function () {
afterEach(removeContact);
- it("should be able to find a contact by name", function() {
+ it("contacts.spec.6 should be able to find a contact by name", function() {
var foundName = jasmine.createSpy().andCallFake(function(result) {
var bFound = false;
try {
@@ -163,12 +163,12 @@ describe("Contacts (navigator.contacts)", function () {
describe('create method', function() {
- it("should exist", function() {
+ it("contacts.spec.1 should exist", function() {
expect(navigator.contacts.create).toBeDefined();
expect(typeof navigator.contacts.create).toBe('function');
});
- it("should return a Contact object", function() {
+ it("contacts.spec.8 should return a Contact object", function() {
var bDay = new Date(1976, 7,4);
var obj = navigator.contacts.create({"displayName": "test name", "gender": "male", "note": "my note", "name": {"formatted": "Mr. Test Name"}, "emails": [{"value": "here@there.com"}, {"value": "there@here.com"}], "birthday": bDay});
@@ -185,7 +185,7 @@ describe("Contacts (navigator.contacts)", function () {
});
describe("Contact object", function () {
- it("should be able to create instance", function() {
+ it("contacts.spec.9 should be able to create instance", function() {
var contact = new Contact("a", "b", new ContactName("a", "b", "c", "d", "e", "f"), "c", [], [], [], [], [], "f", "i",
[], [], []);
expect(contact).toBeDefined();
@@ -205,7 +205,7 @@ describe("Contacts (navigator.contacts)", function () {
expect(contact.urls).toBeDefined();
});
- it("should be able to define a ContactName object", function() {
+ it("contacts.spec.10 should be able to define a ContactName object", function() {
var contactName = new ContactName("Dr. First Last Jr.", "Last", "First", "Middle", "Dr.", "Jr.");
expect(contactName).toBeDefined();
expect(contactName.formatted).toBe("Dr. First Last Jr.");
@@ -216,7 +216,7 @@ describe("Contacts (navigator.contacts)", function () {
expect(contactName.honorificSuffix).toBe("Jr.");
});
- it("should be able to define a ContactField object", function() {
+ it("contacts.spec.11 should be able to define a ContactField object", function() {
var contactField = new ContactField("home", "8005551212", true);
expect(contactField).toBeDefined();
expect(contactField.type).toBe("home");
@@ -224,13 +224,13 @@ describe("Contacts (navigator.contacts)", function () {
expect(contactField.pref).toBe(true);
});
- it("ContactField object should coerce type and value properties to strings", function() {
+ it("contacts.spec.12 ContactField object should coerce type and value properties to strings", function() {
var contactField = new ContactField(12345678, 12345678, true);
expect(contactField.type).toBe("12345678");
expect(contactField.value).toBe("12345678");
});
- it("should be able to define a ContactAddress object", function() {
+ it("contacts.spec.13 should be able to define a ContactAddress object", function() {
var contactAddress = new ContactAddress(true, "home", "a","b","c","d","e","f");
expect(contactAddress).toBeDefined();
expect(contactAddress.pref).toBe(true);
@@ -243,7 +243,7 @@ describe("Contacts (navigator.contacts)", function () {
expect(contactAddress.country).toBe("f");
});
- it("should be able to define a ContactOrganization object", function() {
+ it("contacts.spec.14 should be able to define a ContactOrganization object", function() {
var contactOrg = new ContactOrganization(true, "home", "a","b","c","d","e","f","g");
expect(contactOrg).toBeDefined();
expect(contactOrg.pref).toBe(true);
@@ -253,20 +253,20 @@ describe("Contacts (navigator.contacts)", function () {
expect(contactOrg.title).toBe("c");
});
- it("should be able to define a ContactFindOptions object", function() {
+ it("contacts.spec.15 should be able to define a ContactFindOptions object", function() {
var contactFindOptions = new ContactFindOptions("a", true, "b");
expect(contactFindOptions).toBeDefined();
expect(contactFindOptions.filter).toBe("a");
expect(contactFindOptions.multiple).toBe(true);
});
- it("should contain a clone function", function() {
+ it("contacts.spec.16 should contain a clone function", function() {
var contact = new Contact();
expect(contact.clone).toBeDefined();
expect(typeof contact.clone).toBe('function');
});
- it("clone function should make deep copy of Contact Object", function() {
+ it("contacts.spec.17 clone function should make deep copy of Contact Object", function() {
var contact = new Contact();
contact.id=1;
contact.displayName="Test Name";
@@ -287,13 +287,13 @@ describe("Contacts (navigator.contacts)", function () {
expect(clonedContact.connected).toBe(contact.connected);
});
- it("should contain a save function", function() {
+ it("contacts.spec.18 should contain a save function", function() {
var contact = new Contact();
expect(contact.save).toBeDefined();
expect(typeof contact.save).toBe('function');
});
- it("should contain a remove function", function() {
+ it("contacts.spec.19 should contain a remove function", function() {
var contact = new Contact();
expect(contact.remove).toBeDefined();
expect(typeof contact.remove).toBe('function');
@@ -301,7 +301,7 @@ describe("Contacts (navigator.contacts)", function () {
});
describe('save method', function () {
- it("should be able to save a contact", function() {
+ it("contacts.spec.20 should be able to save a contact", function() {
var bDay = new Date(1976, 6,4);
gContactObj = navigator.contacts.create({"gender": "male", "note": "my note", "name": {"familyName": "Delete", "givenName": "Test"}, "emails": [{"value": "here@there.com"}, {"value": "there@here.com"}], "birthday": bDay});
@@ -331,7 +331,7 @@ describe("Contacts (navigator.contacts)", function () {
});
});
// HACK: there is a reliance between the previous and next test. This is bad form.
- it("update a contact", function() {
+ it("contacts.spec.21 update a contact", function() {
expect(gContactObj).toBeDefined();
var bDay = new Date(1975, 5,4);
@@ -368,7 +368,7 @@ describe("Contacts (navigator.contacts)", function () {
describe('Contact.remove method', function () {
afterEach(removeContact);
- it("calling remove on a contact has an id of null should return ContactError.UNKNOWN_ERROR", function() {
+ it("contacts.spec.22 calling remove on a contact has an id of null should return ContactError.UNKNOWN_ERROR", function() {
var win = jasmine.createSpy();
var fail = jasmine.createSpy().andCallFake(function(result) {
expect(result.code).toBe(ContactError.UNKNOWN_ERROR);
@@ -386,7 +386,7 @@ describe("Contacts (navigator.contacts)", function () {
});
});
- it("calling remove on a contact that does not exist should return ContactError.UNKNOWN_ERROR", function() {
+ it("contacts.spec.23 calling remove on a contact that does not exist should return ContactError.UNKNOWN_ERROR", function() {
var win = jasmine.createSpy();
var fail = jasmine.createSpy().andCallFake(function(result) {
expect(result.code).toBe(ContactError.UNKNOWN_ERROR);
@@ -410,7 +410,7 @@ describe("Contacts (navigator.contacts)", function () {
describe("Round trip Contact tests (creating + save + delete + find).", function () {
afterEach(removeContact);
- it("Creating, saving, finding a contact should work, removing it should work, after which we should not be able to find it, and we should not be able to delete it again.", function() {
+ it("contacts.spec.24 Creating, saving, finding a contact should work, removing it should work, after which we should not be able to find it, and we should not be able to delete it again.", function() {
var done = false;
runs(function () {
gContactObj = new Contact();
@@ -459,7 +459,7 @@ describe("Contacts (navigator.contacts)", function () {
});
describe('ContactError interface', function () {
- it("ContactError constants should be defined", function() {
+ it("contacts.spec.25 ContactError constants should be defined", function() {
expect(ContactError.UNKNOWN_ERROR).toBe(0);
expect(ContactError.INVALID_ARGUMENT_ERROR).toBe(1);
expect(ContactError.TIMEOUT_ERROR).toBe(2);
http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/ef604562/autotest/tests/datauri.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/datauri.tests.js b/autotest/tests/datauri.tests.js
index 2e54810..c691aab 100644
--- a/autotest/tests/datauri.tests.js
+++ b/autotest/tests/datauri.tests.js
@@ -1,5 +1,5 @@
describe('data uris', function () {
- it("should work with iframes", function() {
+ it("datauri.spec.1 should work with iframes", function() {
var gotFoo = false,
frame = document.createElement('iframe');
function onMessage(msg) {
@@ -21,7 +21,7 @@ describe('data uris', function () {
expect(gotFoo).toBe(true);
});
});
- it("should work with images", function() {
+ it("datauri.spec.2 should work with images", function() {
var img = new Image();
img.onload = jasmine.createSpy('onLoad');
img.onerror = jasmine.createSpy('onError');
http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/ef604562/autotest/tests/file.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/file.tests.js b/autotest/tests/file.tests.js
index e56a887..dcbe832 100644
--- a/autotest/tests/file.tests.js
+++ b/autotest/tests/file.tests.js
@@ -107,7 +107,7 @@ describe('File API', function() {
};
describe('FileError object', function() {
- it("should define FileError constants", function() {
+ it("file.spec.1 should define FileError constants", function() {
expect(FileError.NOT_FOUND_ERR).toBe(1);
expect(FileError.SECURITY_ERR).toBe(2);
expect(FileError.ABORT_ERR).toBe(3);
@@ -125,16 +125,16 @@ describe('File API', function() {
describe('LocalFileSystem', function() {
- it("should define LocalFileSystem constants", function() {
+ it("file.spec.2 should define LocalFileSystem constants", function() {
expect(LocalFileSystem.TEMPORARY).toBe(0);
expect(LocalFileSystem.PERSISTENT).toBe(1);
});
describe('window.requestFileSystem', function() {
- it("should be defined", function() {
+ it("file.spec.3 should be defined", function() {
expect(window.requestFileSystem).toBeDefined();
});
- it("should be able to retrieve a PERSISTENT file system", function() {
+ it("file.spec.4 should be able to retrieve a PERSISTENT file system", function() {
var win = jasmine.createSpy().andCallFake(function(fileSystem) {
expect(fileSystem).toBeDefined();
expect(fileSystem.name).toBeDefined();
@@ -155,7 +155,7 @@ describe('File API', function() {
expect(win).toHaveBeenCalled();
});
});
- it("should be able to retrieve a TEMPORARY file system", function() {
+ it("file.spec.5 should be able to retrieve a TEMPORARY file system", function() {
var win = jasmine.createSpy().andCallFake(function(fileSystem) {
expect(fileSystem).toBeDefined();
expect(fileSystem.name).toBeDefined();
@@ -176,7 +176,7 @@ describe('File API', function() {
expect(win).toHaveBeenCalled();
});
});
- it("should error if you request a file system that is too large", function() {
+ it("file.spec.6 should error if you request a file system that is too large", function() {
var fail = jasmine.createSpy().andCallFake(function(error) {
expect(error).toBeDefined();
expect(error).toBeFileError(FileError.QUOTA_EXCEEDED_ERR);
@@ -195,7 +195,7 @@ describe('File API', function() {
expect(fail).toHaveBeenCalled();
});
});
- it("should error out if you request a file system that does not exist", function() {
+ it("file.spec.7 should error out if you request a file system that does not exist", function() {
var fail = jasmine.createSpy().andCallFake(function(error) {
expect(error).toBeDefined();
expect(error).toBeFileError(FileError.SYNTAX_ERR);
@@ -217,10 +217,10 @@ describe('File API', function() {
});
describe('window.resolveLocalFileSystemURI', function() {
- it("should be defined", function() {
+ it("file.spec.3 should be defined", function() {
expect(window.resolveLocalFileSystemURI).toBeDefined();
});
- it("should resolve a valid file name", function() {
+ it("file.spec.9 should resolve a valid file name", function() {
var fileName = "resolve.file.uri",
win = jasmine.createSpy().andCallFake(function(fileEntry) {
expect(fileEntry).toBeDefined();
@@ -251,7 +251,7 @@ describe('File API', function() {
waitsFor(function() { return resolveCallback.wasCalled; }, "createFile callback never called", Tests.TEST_TIMEOUT);
});
- it("resolve valid file name with parameters", function() {
+ it("file.spec.10 resolve valid file name with parameters", function() {
var fileName = "resolve.file.uri.params",
win = jasmine.createSpy().andCallFake(function(fileEntry) {
expect(fileEntry).toBeDefined();
@@ -282,7 +282,7 @@ describe('File API', function() {
waitsFor(function() { return resolveCallback.wasCalled; }, "createFile callback never called", Tests.TEST_TIMEOUT);
});
- it("should error (NOT_FOUND_ERR) when resolving (non-existent) invalid file name", function() {
+ it("file.spec.11 should error (NOT_FOUND_ERR) when resolving (non-existent) invalid file name", function() {
var fail = jasmine.createSpy().andCallFake(function(error) {
expect(error).toBeDefined();
expect(error).toBeFileError(FileError.NOT_FOUND_ERR);
@@ -301,7 +301,7 @@ describe('File API', function() {
expect(win).not.toHaveBeenCalled();
});
});
- it("should error (ENCODING_ERR) when resolving invalid URI with leading /", function() {
+ it("file.spec.12 should error (ENCODING_ERR) when resolving invalid URI with leading /", function() {
var fail = jasmine.createSpy().andCallFake(function(error) {
expect(error).toBeDefined();
expect(error).toBeFileError(FileError.ENCODING_ERR);
@@ -324,7 +324,7 @@ describe('File API', function() {
});
describe('Metadata interface', function() {
- it("should exist and have the right properties", function() {
+ it("file.spec.13 should exist and have the right properties", function() {
var metadata = new Metadata();
expect(metadata).toBeDefined();
expect(metadata.modificationTime).toBeDefined();
@@ -332,7 +332,7 @@ describe('File API', function() {
});
describe('Flags interface', function() {
- it("should exist and have the right properties", function() {
+ it("file.spec.13 should exist and have the right properties", function() {
var flags = new Flags(false, true);
expect(flags).toBeDefined();
expect(flags.create).toBeDefined();
@@ -343,7 +343,7 @@ describe('File API', function() {
});
describe('FileSystem interface', function() {
- it("should have a root that is a DirectoryEntry", function() {
+ it("file.spec.15 should have a root that is a DirectoryEntry", function() {
var win = jasmine.createSpy().andCallFake(function(entry) {
expect(entry).toBeDefined();
expect(entry.isFile).toBe(false);
@@ -377,7 +377,7 @@ describe('File API', function() {
});
describe('DirectoryEntry', function() {
- it("getFile: get Entry for file that does not exist", function() {
+ it("file.spec.16 getFile: get Entry for file that does not exist", function() {
var fileName = "de.no.file",
filePath = root.fullPath + '/' + fileName,
fail = jasmine.createSpy().andCallFake(function(error) {
@@ -398,7 +398,7 @@ describe('File API', function() {
expect(win).not.toHaveBeenCalled();
});
});
- it("etFile: create new file", function() {
+ it("file.spec.17 etFile: create new file", function() {
var fileName = "de.create.file",
filePath = root.fullPath + '/' + fileName,
win = jasmine.createSpy().andCallFake(function(entry) {
@@ -424,7 +424,7 @@ describe('File API', function() {
expect(fail).not.toHaveBeenCalled();
});
});
- it("getFile: create new file (exclusive)", function() {
+ it("file.spec.18 getFile: create new file (exclusive)", function() {
var fileName = "de.create.exclusive.file",
filePath = root.fullPath + '/' + fileName,
win = jasmine.createSpy().andCallFake(function(entry) {
@@ -451,7 +451,7 @@ describe('File API', function() {
expect(fail).not.toHaveBeenCalled();
});
});
- it("getFile: create file that already exists", function() {
+ it("file.spec.19 getFile: create file that already exists", function() {
var fileName = "de.create.existing.file",
filePath = root.fullPath + '/' + fileName,
getFile = jasmine.createSpy().andCallFake(function(file) {
@@ -485,7 +485,7 @@ describe('File API', function() {
waitsFor(function() { return getFile.wasCalled; }, "getFile was never called", Tests.TEST_TIMEOUT);
});
- it("getFile: create file that already exists (exclusive)", function() {
+ it("file.spec.20 getFile: create file that already exists (exclusive)", function() {
var fileName = "de.create.exclusive.existing.file",
filePath = root.fullPath + '/' + fileName,
existingFile,
@@ -519,7 +519,7 @@ describe('File API', function() {
waitsFor(function() { return getFile.wasCalled; }, "getFile never called", Tests.TEST_TIMEOUT);
});
- it("getFile: get Entry for existing file", function() {
+ it("file.spec.21 getFile: get Entry for existing file", function() {
var fileName = "de.get.file",
filePath = root.fullPath + '/' + fileName,
win = jasmine.createSpy().andCallFake(function(entry) {
@@ -553,7 +553,7 @@ describe('File API', function() {
waitsFor(function() { return getFile.wasCalled; }, "file creation", Tests.TEST_TIMEOUT);
});
- it("DirectoryEntry.getFile: get FileEntry for invalid path", function() {
+ it("file.spec.22 DirectoryEntry.getFile: get FileEntry for invalid path", function() {
var fileName = "de:invalid:path",
fail = jasmine.createSpy().andCallFake(function(error) {
expect(error).toBeDefined();
@@ -574,7 +574,7 @@ describe('File API', function() {
});
});
- it("DirectoryEntry.getDirectory: get Entry for directory that does not exist", function() {
+ it("file.spec.23 DirectoryEntry.getDirectory: get Entry for directory that does not exist", function() {
var dirName = "de.no.dir",
dirPath = root.fullPath + '/' + dirName,
fail = jasmine.createSpy().andCallFake(function(error) {
@@ -595,7 +595,7 @@ describe('File API', function() {
expect(win).not.toHaveBeenCalled();
});
});
- it("DirectoryEntry.getDirectory: create new dir with space then resolveFileSystemURI", function() {
+ it("file.spec.24 DirectoryEntry.getDirectory: create new dir with space then resolveFileSystemURI", function() {
var dirName = "de create dir",
dirPath = root.fullPath + '/' + dirName,
getDir = jasmine.createSpy().andCallFake(function(dirEntry) {
@@ -631,7 +631,7 @@ describe('File API', function() {
waitsFor(function() { return getDir.wasCalled; }, "getDir never called", Tests.TEST_TIMEOUT);
});
- it("DirectoryEntry.getDirectory: create new dir with space resolveFileSystemURI with encoded URI", function() {
+ it("file.spec.25 DirectoryEntry.getDirectory: create new dir with space resolveFileSystemURI with encoded URI", function() {
var dirName = "de create dir",
dirPath = root.fullPath + '/' + dirName,
getDir = jasmine.createSpy().andCallFake(function(dirEntry) {
@@ -667,7 +667,7 @@ describe('File API', function() {
waitsFor(function() { return getDir.wasCalled; }, "getDir never called", Tests.TEST_TIMEOUT);
});
- it("DirectoryEntry.getDirectory: create new directory", function() {
+ it("file.spec.26 DirectoryEntry.getDirectory: create new directory", function() {
var dirName = "de.create.dir",
dirPath = root.fullPath + '/' + dirName,
win = jasmine.createSpy().andCallFake(function(directory) {
@@ -695,7 +695,7 @@ describe('File API', function() {
});
});
- it("DirectoryEntry.getDirectory: create new directory (exclusive)", function() {
+ it("file.spec.27 DirectoryEntry.getDirectory: create new directory (exclusive)", function() {
var dirName = "de.create.exclusive.dir",
dirPath = root.fullPath + '/' + dirName,
win = jasmine.createSpy().andCallFake(function(directory) {
@@ -721,7 +721,7 @@ describe('File API', function() {
expect(fail).not.toHaveBeenCalled();
});
});
- it("DirectoryEntry.getDirectory: create directory that already exists", function() {
+ it("file.spec.28 DirectoryEntry.getDirectory: create directory that already exists", function() {
var dirName = "de.create.existing.dir",
dirPath = root.fullPath + '/' + dirName,
getDir = jasmine.createSpy().andCallFake(function(directory) {
@@ -756,7 +756,7 @@ describe('File API', function() {
waitsFor(function() { return getDir.wasCalled; }, "getDir never called", Tests.TEST_TIMEOUT);
});
- it("DirectoryEntry.getDirectory: create directory that already exists (exclusive)", function() {
+ it("file.spec.29 DirectoryEntry.getDirectory: create directory that already exists (exclusive)", function() {
var dirName = "de.create.exclusive.existing.dir",
dirPath = root.fullPath + '/' + dirName,
existingDir,
@@ -790,7 +790,7 @@ describe('File API', function() {
waitsFor(function() { return getDir.wasCalled; }, "getDir never called", Tests.TEST_TIMEOUT);
});
- it("DirectoryEntry.getDirectory: get Entry for existing directory", function() {
+ it("file.spec.30 DirectoryEntry.getDirectory: get Entry for existing directory", function() {
var dirName = "de.get.dir",
dirPath = root.fullPath + '/' + dirName,
getDir = jasmine.createSpy().andCallFake(function(directory) {
@@ -822,7 +822,7 @@ describe('File API', function() {
// create directory to kick off it
root.getDirectory(dirName, {create:true}, getDir, fail);
});
- it("DirectoryEntry.getDirectory: get DirectoryEntry for invalid path", function() {
+ it("file.spec.31 DirectoryEntry.getDirectory: get DirectoryEntry for invalid path", function() {
var dirName = "de:invalid:path",
fail = jasmine.createSpy().andCallFake(function(error) {
expect(error).toBeDefined();
@@ -842,7 +842,7 @@ describe('File API', function() {
expect(win).not.toHaveBeenCalled();
});
});
- it("DirectoryEntry.getDirectory: get DirectoryEntry for existing file", function() {
+ it("file.spec.32 DirectoryEntry.getDirectory: get DirectoryEntry for existing file", function() {
var fileName = "de.existing.file",
existingFile,
filePath = root.fullPath + '/' + fileName,
@@ -876,7 +876,7 @@ describe('File API', function() {
waitsFor(function() { return getDir.wasCalled; }, "getDir was called", Tests.TEST_TIMEOUT);
});
- it("DirectoryEntry.getFile: get FileEntry for existing directory", function() {
+ it("file.spec.33 DirectoryEntry.getFile: get FileEntry for existing directory", function() {
var dirName = "de.existing.dir",
existingDir,
dirPath = root.fullPath + '/' + dirName,
@@ -910,7 +910,7 @@ describe('File API', function() {
waitsFor(function() { return getFile.wasCalled; }, "getFile never called", Tests.TEST_TIMEOUT);
});
- it("DirectoryEntry.removeRecursively on directory", function() {
+ it("file.spec.34 DirectoryEntry.removeRecursively on directory", function() {
var dirName = "de.removeRecursively",
subDirName = "dir",
dirPath = root.fullPath + '/' + dirName,
@@ -959,13 +959,13 @@ describe('File API', function() {
waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT);
});
- it("createReader: create reader on existing directory", function() {
+ it("file.spec.35 createReader: create reader on existing directory", function() {
// create reader for root directory
var reader = root.createReader();
expect(reader).toBeDefined();
expect(typeof reader.readEntries).toBe('function');
});
- it("removeRecursively on root file system", function() {
+ it("file.spec.36 removeRecursively on root file system", function() {
var remove = jasmine.createSpy().andCallFake(function(error) {
expect(error).toBeDefined();
expect(error).toBeFileError(FileError.NO_MODIFICATION_ALLOWED_ERR);
@@ -988,7 +988,7 @@ describe('File API', function() {
describe('DirectoryReader interface', function() {
describe("readEntries", function() {
- it("should read contents of existing directory", function() {
+ it("file.spec.37 should read contents of existing directory", function() {
var reader,
win = jasmine.createSpy().andCallFake(function(entries) {
expect(entries).toBeDefined();
@@ -1010,7 +1010,7 @@ describe('File API', function() {
expect(fail).not.toHaveBeenCalled();
});
});
- it("should read contents of directory that has been removed", function() {
+ it("file.spec.38 should read contents of directory that has been removed", function() {
var dirName = "de.createReader.notfound",
dirPath = root.fullPath + '/' + dirName,
entryCallback = jasmine.createSpy().andCallFake(function(directory) {
@@ -1065,11 +1065,11 @@ describe('File API', function() {
});
describe('File', function() {
- it("constructor should be defined", function() {
+ it("file.spec.39 constructor should be defined", function() {
expect(File).toBeDefined();
expect(typeof File).toBe('function');
});
- it("should be define File attributes", function() {
+ it("file.spec.40 should be define File attributes", function() {
var file = new File();
expect(file.name).toBeDefined();
expect(file.fullPath).toBeDefined();
@@ -1080,7 +1080,7 @@ describe('File API', function() {
});
describe('FileEntry', function() {
- it("should be define FileEntry methods", function() {
+ it("file.spec.41 should be define FileEntry methods", function() {
var fileName = "fe.methods",
itFileEntry = jasmine.createSpy().andCallFake(function(fileEntry) {
expect(fileEntry).toBeDefined();
@@ -1104,7 +1104,7 @@ describe('File API', function() {
expect(fail).not.toHaveBeenCalled();
});
});
- it("createWriter should return a FileWriter object", function() {
+ it("file.spec.42 createWriter should return a FileWriter object", function() {
var fileName = "fe.createWriter",
itFile,
entryCallback = jasmine.createSpy().andCallFake(function(fileEntry) {
@@ -1137,7 +1137,7 @@ describe('File API', function() {
waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT);
});
- it("file should return a File object", function() {
+ it("file.spec.43 file should return a File object", function() {
var fileName = "fe.file",
newFile,
entryCallback = jasmine.createSpy().andCallFake(function(fileEntry) {
@@ -1170,7 +1170,7 @@ describe('File API', function() {
waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT);
});
- it("file: on File that has been removed", function() {
+ it("file.spec.44 file: on File that has been removed", function() {
var fileName = "fe.no.file",
entryCallback = jasmine.createSpy().andCallFake(function(fileEntry) {
// create File object
@@ -1209,7 +1209,7 @@ describe('File API', function() {
});
});
describe('Entry', function() {
- it("Entry object", function() {
+ it("file.spec.45 Entry object", function() {
var fileName = "entry",
fullPath = root.fullPath + '/' + fileName,
fail = createFail('Entry'),
@@ -1245,7 +1245,7 @@ describe('File API', function() {
expect(fail).not.toHaveBeenCalled();
});
});
- it("Entry.getMetadata on file", function() {
+ it("file.spec.46 Entry.getMetadata on file", function() {
var fileName = "entry.metadata.file",
entryCallback = jasmine.createSpy().andCallFake(function(entry) {
runs(function() {
@@ -1271,7 +1271,7 @@ describe('File API', function() {
// create a new file entry
createFile(fileName, entryCallback, fail);
});
- it("Entry.getMetadata on directory", function() {
+ it("file.spec.47 Entry.getMetadata on directory", function() {
var dirName = "entry.metadata.dir",
entryCallback = jasmine.createSpy().andCallFake(function(entry) {
runs(function() {
@@ -1301,7 +1301,7 @@ describe('File API', function() {
waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT);
});
- it("Entry.getParent on file in root file system", function() {
+ it("file.spec.48 Entry.getParent on file in root file system", function() {
var fileName = "entry.parent.file",
rootPath = root.fullPath,
fail = createFail('Entry'),
@@ -1332,7 +1332,7 @@ describe('File API', function() {
waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT);
});
- it("Entry.getParent on directory in root file system", function() {
+ it("file.spec.49 Entry.getParent on directory in root file system", function() {
var dirName = "entry.parent.dir",
rootPath = root.fullPath,
fail = createFail('Entry'),
@@ -1363,7 +1363,7 @@ describe('File API', function() {
waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT);
});
- it("Entry.getParent on root file system", function() {
+ it("file.spec.50 Entry.getParent on root file system", function() {
var rootPath = root.fullPath,
itParent = jasmine.createSpy().andCallFake(function(parent) {
expect(parent).toBeDefined();
@@ -1383,7 +1383,7 @@ describe('File API', function() {
expect(fail).not.toHaveBeenCalled();
});
});
- it("Entry.toURL on file", function() {
+ it("file.spec.51 Entry.toURL on file", function() {
var fileName = "entry.uri.file",
rootPath = root.fullPath,
itURI = jasmine.createSpy().andCallFake(function(entry) {
@@ -1408,7 +1408,7 @@ describe('File API', function() {
expect(fail).not.toHaveBeenCalled();
});
});
- it("Entry.toURL on directory", function() {
+ it("file.spec.52 Entry.toURL on directory", function() {
var dirName = "entry.uri.dir",
rootPath = root.fullPath,
itURI = jasmine.createSpy().andCallFake(function(entry) {
@@ -1433,7 +1433,7 @@ describe('File API', function() {
expect(fail).not.toHaveBeenCalled();
});
});
- it("Entry.remove on file", function() {
+ it("file.spec.53 Entry.remove on file", function() {
var fileName = "entry.rm.file",
fullPath = root.fullPath + '/' + fileName,
win = createWin('Entry'),
@@ -1474,7 +1474,7 @@ describe('File API', function() {
waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT);
});
- it("remove on empty directory", function() {
+ it("file.spec.54 remove on empty directory", function() {
var dirName = "entry.rm.dir",
fullPath = root.fullPath + '/' + dirName,
entryCallback = jasmine.createSpy().andCallFake(function(entry) {
@@ -1516,7 +1516,7 @@ describe('File API', function() {
waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT);
});
- it("remove on non-empty directory", function() {
+ it("file.spec.55 remove on non-empty directory", function() {
var dirName = "entry.rm.dir.not.empty",
fullPath = root.fullPath + '/' + dirName,
fileName = "remove.txt",
@@ -1568,7 +1568,7 @@ describe('File API', function() {
waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT);
});
- it("remove on root file system", function() {
+ it("file.spec.56 remove on root file system", function() {
var itRemove = jasmine.createSpy().andCallFake(function(error) {
expect(error).toBeDefined();
expect(error).toBeFileError(FileError.NO_MODIFICATION_ALLOWED_ERR);
@@ -1587,7 +1587,7 @@ describe('File API', function() {
expect(itRemove).toHaveBeenCalled();
});
});
- it("copyTo: file", function() {
+ it("file.spec.57 copyTo: file", function() {
var file1 = "entry.copy.file1",
file2 = "entry.copy.file2",
fullPath = root.fullPath + '/' + file2,
@@ -1638,7 +1638,7 @@ describe('File API', function() {
waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT);
});
- it("copyTo: file onto itself", function() {
+ it("file.spec.58 copyTo: file onto itself", function() {
var file1 = "entry.copy.fos.file1",
entryCallback = jasmine.createSpy().andCallFake(function(entry) {
// copy file1 onto itself
@@ -1671,7 +1671,7 @@ describe('File API', function() {
waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT);
});
- it("copyTo: directory", function() {
+ it("file.spec.59 copyTo: directory", function() {
var file1 = "file1",
srcDir = "entry.copy.srcDir",
dstDir = "entry.copy.dstDir",
@@ -1745,7 +1745,7 @@ describe('File API', function() {
waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT);
});
- it("copyTo: directory to backup at same root directory", function() {
+ it("file.spec.60 copyTo: directory to backup at same root directory", function() {
var file1 = "file1",
srcDir = "entry.copy.srcDirSame",
dstDir = "entry.copy.srcDirSame-backup",
@@ -1804,7 +1804,7 @@ describe('File API', function() {
waitsFor(function() { return itFileExists.wasCalled; }, "itFileExists", 10000);
});
- it("copyTo: directory onto itself", function() {
+ it("file.spec.61 copyTo: directory onto itself", function() {
var file1 = "file1",
srcDir = "entry.copy.dos.srcDir",
srcPath = root.fullPath + '/' + srcDir,
@@ -1869,7 +1869,7 @@ describe('File API', function() {
waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT);
});
- it("copyTo: directory into itself", function() {
+ it("file.spec.62 copyTo: directory into itself", function() {
var srcDir = "entry.copy.dis.srcDir",
dstDir = "entry.copy.dis.dstDir",
fail = createFail('Entry'),
@@ -1915,7 +1915,7 @@ describe('File API', function() {
waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT);
});
- it("copyTo: directory that does not exist", function() {
+ it("file.spec.63 copyTo: directory that does not exist", function() {
var file1 = "entry.copy.dnf.file1",
dstDir = "entry.copy.dnf.dstDir",
filePath = root.fullPath + '/' + file1,
@@ -1962,7 +1962,7 @@ describe('File API', function() {
waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT);
});
- it("copyTo: invalid target name", function() {
+ it("file.spec.64 copyTo: invalid target name", function() {
var file1 = "entry.copy.itn.file1",
file2 = "bad:file:name",
filePath = root.fullPath + '/' + file1,
@@ -1997,7 +1997,7 @@ describe('File API', function() {
waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT);
});
- it("moveTo: file to same parent", function() {
+ it("file.spec.65 moveTo: file to same parent", function() {
var file1 = "entry.move.fsp.file1",
file2 = "entry.move.fsp.file2",
srcPath = root.fullPath + '/' + file1,
@@ -2058,7 +2058,7 @@ describe('File API', function() {
waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT);
});
- it("moveTo: file to new parent", function() {
+ it("file.spec.66 moveTo: file to new parent", function() {
var file1 = "entry.move.fnp.file1",
dir = "entry.move.fnp.dir",
srcPath = root.fullPath + '/' + file1,
@@ -2130,7 +2130,7 @@ describe('File API', function() {
});
waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT);
});
- it("moveTo: directory to same parent", function() {
+ it("file.spec.67 moveTo: directory to same parent", function() {
var file1 = "file1",
srcDir = "entry.move.dsp.srcDir",
dstDir = "entry.move.dsp.dstDir",
@@ -2205,7 +2205,7 @@ describe('File API', function() {
waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT);
});
- it("moveTo: directory to same parent with same name", function() {
+ it("file.spec.68 moveTo: directory to same parent with same name", function() {
var file1 = "file1",
srcDir = "entry.move.dsp.srcDir",
dstDir = "entry.move.dsp.srcDir-backup",
@@ -2278,7 +2278,7 @@ describe('File API', function() {
waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT);
});
- it("moveTo: directory to new parent", function() {
+ it("file.spec.69 moveTo: directory to new parent", function() {
var file1 = "file1",
srcDir = "entry.move.dnp.srcDir",
dstDir = "entry.move.dnp.dstDir",
@@ -2351,7 +2351,7 @@ describe('File API', function() {
waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT);
});
- it("moveTo: directory onto itself", function() {
+ it("file.spec.70 moveTo: directory onto itself", function() {
var file1 = "file1",
srcDir = "entry.move.dos.srcDir",
srcPath = root.fullPath + '/' + srcDir,
@@ -2417,7 +2417,7 @@ describe('File API', function() {
waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT);
});
- it("moveTo: directory into itself", function() {
+ it("file.spec.71 moveTo: directory into itself", function() {
var srcDir = "entry.move.dis.srcDir",
dstDir = "entry.move.dis.dstDir",
srcPath = root.fullPath + '/' + srcDir,
@@ -2462,7 +2462,7 @@ describe('File API', function() {
waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT);
});
- it("moveTo: file onto itself", function() {
+ it("file.spec.72 moveTo: file onto itself", function() {
var file1 = "entry.move.fos.file1",
filePath = root.fullPath + '/' + file1,
win = createWin('Entry'),
@@ -2507,7 +2507,7 @@ describe('File API', function() {
waitsFor(function() { return entryCallback.wasCalled; }, "entryCallback never called", Tests.TEST_TIMEOUT);
});
- it("moveTo: file onto existing directory", function() {
+ it("file.spec.73 moveTo: file onto existing directory", function() {
var file1 = "entry.move.fod.file1",
dstDir = "entry.move.fod.dstDir",
subDir = "subDir",
@@ -2564,7 +2564,7 @@ describe('File API', function() {
expect(fail).not.toHaveBeenCalled();
});
});
- it("moveTo: directory onto existing file", function() {
+ it("file.spec.74 moveTo: directory onto existing file", function() {
var file1 = "entry.move.dof.file1",
srcDir = "entry.move.dof.srcDir",
dirPath = root.fullPath + '/' + srcDir,
@@ -2614,7 +2614,7 @@ describe('File API', function() {
expect(fail).not.toHaveBeenCalled();
});
});
- it("copyTo: directory onto existing file", function() {
+ it("file.spec.75 copyTo: directory onto existing file", function() {
var file1 = "entry.copy.dof.file1",
srcDir = "entry.copy.dof.srcDir",
dirPath = root.fullPath + '/' + srcDir,
@@ -2664,7 +2664,7 @@ describe('File API', function() {
expect(fail).not.toHaveBeenCalled();
});
});
- it("moveTo: directory onto directory that is not empty", function() {
+ it("file.spec.76 moveTo: directory onto directory that is not empty", function() {
var srcDir = "entry.move.dod.srcDir",
dstDir = "entry.move.dod.dstDir",
subDir = "subDir",
@@ -2722,7 +2722,7 @@ describe('File API', function() {
expect(fail).not.toHaveBeenCalled();
});
});
- it("moveTo: file replace existing file", function() {
+ it("file.spec.77 moveTo: file replace existing file", function() {
var file1 = "entry.move.frf.file1",
file2 = "entry.move.frf.file2",
file1Path = root.fullPath + '/' + file1,
@@ -2775,7 +2775,7 @@ describe('File API', function() {
expect(fail).not.toHaveBeenCalled();
});
});
- it("moveTo: directory replace empty directory", function() {
+ it("file.spec.78 moveTo: directory replace empty directory", function() {
var file1 = "file1",
srcDir = "entry.move.drd.srcDir",
dstDir = "entry.move.drd.dstDir",
@@ -2837,7 +2837,7 @@ describe('File API', function() {
expect(fail).not.toHaveBeenCalled();
});
});
- it("moveTo: directory that does not exist", function() {
+ it("file.spec.79 moveTo: directory that does not exist", function() {
var file1 = "entry.move.dnf.file1",
dstDir = "entry.move.dnf.dstDir",
filePath = root.fullPath + '/' + file1,
@@ -2871,7 +2871,7 @@ describe('File API', function() {
expect(fail).not.toHaveBeenCalled();
});
});
- it("moveTo: invalid target name", function() {
+ it("file.spec.80 moveTo: invalid target name", function() {
var file1 = "entry.move.itn.file1",
file2 = "bad:file:name",
filePath = root.fullPath + '/' + file1,
@@ -2905,7 +2905,7 @@ describe('File API', function() {
});
describe('FileReader', function() {
- it("should have correct methods", function() {
+ it("file.spec.81 should have correct methods", function() {
var reader = new FileReader();
expect(reader).toBeDefined();
expect(typeof reader.readAsBinaryString).toBe('function');
@@ -2917,7 +2917,7 @@ describe('File API', function() {
});
describe('read method', function(){
- it("should error out on non-existent file", function() {
+ it("file.spec.82 should error out on non-existent file", function() {
var reader = new FileReader();
var verifier = jasmine.createSpy().andCallFake(function(evt) {
expect(evt).toBeDefined();
@@ -2931,7 +2931,7 @@ describe('File API', function() {
waitsFor(function() { return verifier.wasCalled; }, "verifier never called", Tests.TEST_TIMEOUT);
});
- it("should be able to read native blob objects", function() {
+ it("file.spec.83 should be able to read native blob objects", function() {
// Skip test if blobs are not supported (e.g.: Android 2.3).
if (typeof Blob == 'undefined') {
return;
@@ -3032,59 +3032,59 @@ describe('File API', function() {
return match;
}
- it("should read file properly, readAsText", function() {
+ it("file.spec.84 should read file properly, readAsText", function() {
runReaderTest('readAsText', false, function(evt, fileData, fileDataAsBinaryString) {
expect(evt.target.result).toBe(fileData);
});
});
- it("should read file properly, Data URI", function() {
+ it("file.spec.85 should read file properly, Data URI", function() {
runReaderTest('readAsDataURL', true, function(evt, fileData, fileDataAsBinaryString) {
expect(evt.target.result.substr(0,23)).toBe("data:text/plain;base64,");
expect(evt.target.result.slice(23)).toBe(atob(fileData));
});
});
- it("should read file properly, readAsBinaryString", function() {
+ it("file.spec.86 should read file properly, readAsBinaryString", function() {
runReaderTest('readAsBinaryString', true, function(evt, fileData, fileDataAsBinaryString) {
expect(evt.target.result).toBe(fileDataAsBinaryString);
});
});
- it("should read file properly, readAsArrayBuffer", function() {
+ it("file.spec.87 should read file properly, readAsArrayBuffer", function() {
runReaderTest('readAsArrayBuffer', true, function(evt, fileData, fileDataAsBinaryString) {
expect(arrayBufferEqualsString(evt.target.result, fileDataAsBinaryString)).toBe(true);
});
});
- it("should read sliced file: readAsText", function() {
+ it("file.spec.88 should read sliced file: readAsText", function() {
runReaderTest('readAsText', false, function(evt, fileData, fileDataAsBinaryString) {
expect(evt.target.result).toBe(fileDataAsBinaryString.slice(10, 40));
}, 10, 40);
});
- it("should read sliced file: slice past eof", function() {
+ it("file.spec.89 should read sliced file: slice past eof", function() {
runReaderTest('readAsText', false, function(evt, fileData, fileDataAsBinaryString) {
expect(evt.target.result).toBe(fileData.slice(-5, 9999));
}, -5, 9999);
});
- it("should read sliced file: slice to eof", function() {
+ it("file.spec.90 should read sliced file: slice to eof", function() {
runReaderTest('readAsText', false, function(evt, fileData, fileDataAsBinaryString) {
expect(evt.target.result).toBe(fileData.slice(-5));
}, -5);
});
- it("should read empty slice", function() {
+ it("file.spec.91 should read empty slice", function() {
runReaderTest('readAsText', false, function(evt, fileData, fileDataAsBinaryString) {
expect(evt.target.result).toBe('');
}, 0, 0);
});
- it("should read sliced file properly, readAsDataURL", function() {
+ it("file.spec.92 should read sliced file properly, readAsDataURL", function() {
runReaderTest('readAsDataURL', true, function(evt, fileData, fileDataAsBinaryString) {
expect(evt.target.result.slice(0, 23)).toBe("data:text/plain;base64,");
expect(evt.target.result.slice(23)).toBe(atob(fileDataAsBinaryString.slice( 10, -3)));
}, 10, -3);
});
- it("should read sliced file properly, readAsBinaryString", function() {
+ it("file.spec.93 should read sliced file properly, readAsBinaryString", function() {
runReaderTest('readAsBinaryString', true, function(evt, fileData, fileDataAsBinaryString) {
expect(evt.target.result).toBe(fileDataAsBinaryString.slice(-10, -5));
}, -10, -5);
});
- it("should read sliced file properly, readAsArrayBuffer", function() {
+ it("file.spec.94 should read sliced file properly, readAsArrayBuffer", function() {
runReaderTest('readAsArrayBuffer', true, function(evt, fileData, fileDataAsBinaryString) {
expect(arrayBufferEqualsString(evt.target.result, fileDataAsBinaryString.slice(0, -1))).toBe(true);
}, 0, -1);
@@ -3092,7 +3092,7 @@ describe('File API', function() {
});
describe('FileWriter', function(){
- it("should have correct methods", function() {
+ it("file.spec.81 should have correct methods", function() {
// retrieve a FileWriter object
var fileName = "writer.methods",
fail = createFail('FileWriter'),
@@ -3122,7 +3122,7 @@ describe('File API', function() {
expect(verifier).toHaveBeenCalled();
});
});
- it("should be able to write and append to file, createWriter", function() {
+ it("file.spec.96 should be able to write and append to file, createWriter", function() {
var fileName = "writer.append",
theWriter,
filePath = root.fullPath + '/' + fileName,
@@ -3171,7 +3171,7 @@ describe('File API', function() {
expect(anotherVerifier).toHaveBeenCalled();
});
});
- it("should be able to write and append to file, File object", function() {
+ it("file.spec.97 should be able to write and append to file, File object", function() {
var fileName = "writer.append",
theWriter,
filePath = root.fullPath + '/' + fileName,
@@ -3218,7 +3218,7 @@ describe('File API', function() {
expect(anotherVerifier).toHaveBeenCalled();
});
});
- it("should be able to seek to the middle of the file and write more data than file.length", function() {
+ it("file.spec.98 should be able to seek to the middle of the file and write more data than file.length", function() {
var fileName = "writer.seek.write",
filePath = root.fullPath + '/' + fileName,
theWriter,
@@ -3266,7 +3266,7 @@ describe('File API', function() {
expect(anotherVerifier).toHaveBeenCalled();
});
});
- it("should be able to seek to the middle of the file and write less data than file.length", function() {
+ it("file.spec.99 should be able to seek to the middle of the file and write less data than file.length", function() {
var fileName = "writer.seek.write2",
filePath = root.fullPath + '/' + fileName,
// file content
@@ -3315,7 +3315,7 @@ describe('File API', function() {
expect(fail).not.toHaveBeenCalled();
});
});
- it("should be able to write XML data", function() {
+ it("file.spec.100 should be able to write XML data", function() {
var fileName = "writer.xml",
filePath = root.fullPath + '/' + fileName,
fail = createFail('FileWriter'),
@@ -3352,7 +3352,7 @@ describe('File API', function() {
expect(fail).not.toHaveBeenCalled();
});
});
- it("should be able to write JSON data", function() {
+ it("file.spec.101 should be able to write JSON data", function() {
var fileName = "writer.json",
filePath = root.fullPath + '/' + fileName,
theWriter,
@@ -3389,7 +3389,7 @@ describe('File API', function() {
expect(fail).not.toHaveBeenCalled();
});
});
- it("should be able to seek", function() {
+ it("file.spec.102 should be able to seek", function() {
var fileName = "writer.seek",
// file content
rule = "There is an exception to every rule. Except this one.",
@@ -3432,7 +3432,7 @@ describe('File API', function() {
expect(fail).not.toHaveBeenCalled();
});
});
- it("should be able to truncate", function() {
+ it("file.spec.103 should be able to truncate", function() {
var fileName = "writer.truncate",
rule = "There is an exception to every rule. Except this one.",
fail = createFail('FileWriter'),