Skip to content
This repository was archived by the owner on Sep 4, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions test/functional/automatic/blackberry.io.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ describe("FileSystem API", function () {
}),
fileWritten = false,
fileName = "textData.txt",
bb = new window.WebKitBlobBuilder();
blob = new Blob(['this is text data'], {type: 'text/plain'});

runs(function () {

function gotWriter(fileWriter) {
fileWriter.onwriteend = function (e) {
fileWritten = true;
};
bb.append('this is text data');
fileWriter.write(bb.getBlob('text/plain'));
fileWriter.write(blob);
}

function gotFile(fileEntry) {
Expand Down Expand Up @@ -91,7 +90,7 @@ describe("FileSystem API", function () {
fileWritten = false,
dir = blackberry.io.sharedFolder + "/documents/",
fileName = "textData.txt",
bb = new window.WebKitBlobBuilder();
blob = new Blob(['this is text data'], {type: 'text/plain'});

runs(function () {
blackberry.io.sandbox = false;
Expand All @@ -100,8 +99,7 @@ describe("FileSystem API", function () {
fileWriter.onwriteend = function (e) {
fileWritten = true;
};
bb.append('this is text data');
fileWriter.write(bb.getBlob('text/plain'));
fileWriter.write(blob);
}

function gotFile(fileEntry) {
Expand Down
5 changes: 2 additions & 3 deletions test/functional/automatic/crossOrigin.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ describe("White listing", function () {
console.log('File write failure', JSON.stringify(e));
}),
fileWritten = false,
bb = new window.WebKitBlobBuilder();
blob = new Blob(['this is text data'], {type: 'text/plain'});

runs(function () {
blackberry.io.sandbox = false;
Expand All @@ -370,8 +370,7 @@ describe("White listing", function () {
fileWriter.onwriteend = function (e) {
fileWritten = true;
};
bb.append('this is text data');
fileWriter.write(bb.getBlob('text/plain'));
fileWriter.write(blob);
}

function gotFile(fileEntry) {
Expand Down
25 changes: 12 additions & 13 deletions test/functional/automation/blackberry.invoke.card.ics.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,16 @@ describe("blackberry.invoke.card.ics", function () {
function pushIcsFileToDevice(callback) {
var dir = blackberry.io.sharedFolder + "/documents/",
fileName = "test.ics",
bb = new window.WebKitBlobBuilder();
blob = new Blob(["BEGIN:VCALENDAR\n",
"PRODID:-//Research In Motion//RIM App//EN\n",
"VERSION:1.0\n",
"BEGIN:VEVENT\n",
"DTEND:20210101T003000Z\n",
"DTSTART:20210101T000000Z\n",
"SUMMARY:invokeIcsViewer Test Event\n",
"UID:" + generateUUID() + "\n",
"END:VEVENT\n",
"END:VCALENDAR\n"], {type: 'text/plain'});

blackberry.io.sandbox = false;

Expand All @@ -45,18 +54,8 @@ describe("blackberry.invoke.card.ics", function () {
fileWriter.onwriteend = function (e) {
callback();
};
bb.append("BEGIN:VCALENDAR\n");
bb.append("PRODID:-//Research In Motion//RIM App//EN\n");
bb.append("VERSION:1.0\n");
bb.append("BEGIN:VEVENT\n");
bb.append("DTEND:20210101T003000Z\n");
bb.append("DTSTART:20210101T000000Z\n");
bb.append("SUMMARY:invokeIcsViewer Test Event\n");
bb.append("UID:" + generateUUID() + "\n");
bb.append("END:VEVENT\n");
bb.append("END:VCALENDAR\n");

fileWriter.write(bb.getBlob('text/plain'));

fileWriter.write(blob);
}

function errorHandler(e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe("Cross Origin Wildcard", function () {
fileWritten = false,
dir = blackberry.io.sharedFolder + "/documents/",
fileName = "textData.txt",
bb = new window.WebKitBlobBuilder();
blob = new Blob(['this is text data'], {type: 'text/plain'});

runs(function () {
blackberry.io.sandbox = false;
Expand All @@ -51,8 +51,7 @@ describe("Cross Origin Wildcard", function () {
fileWriter.onwriteend = function (e) {
fileWritten = true;
};
bb.append('this is text data');
fileWriter.write(bb.getBlob('text/plain'));
fileWriter.write(blob);
}

function gotFile(fileEntry) {
Expand Down