});
writeStringNonBlockingSuccess = t.step_func(function (bytesCount) {
+ retVal = fileHandleWrite.flushNonBlocking();
+ assert_equals(retVal, undefined, "return value should be undefined");
+ fileHandleRead = tizen.filesystem.openFile("documents/file", "r");
+ fileHandleRead.readStringNonBlocking(readStringNonBlockingSuccess, readStringNonBlockingError);
});
writeStringNonBlockingError = t.step_func(function (error) {
fileHandleWrite = tizen.filesystem.openFile("documents/file", "w");
fileHandleWrite.writeStringNonBlocking(content, writeStringNonBlockingSuccess, writeStringNonBlockingError);
- retVal = fileHandleWrite.flushNonBlocking();
- assert_equals(retVal, undefined, "return value should be undefined");
-
- fileHandleRead = tizen.filesystem.openFile("documents/file", "r");
- fileHandleRead.readStringNonBlocking(readStringNonBlockingSuccess, readStringNonBlockingError);
});
</script>
}
});
- writeStringNonBlockingSuccess = t.step_func(function (bytesCount) {
+ readStringNonBlockingSuccess = t.step_func(function (output) {
+ assert_equals(output, content, "the flush content is not right");
+ t.done();
});
- writeStringNonBlockingError = t.step_func(function (error) {
- assert_unreached("writeStringNonBlocking() error callback invoked: name:" + error.name + "msg:" + error.message);
+ readStringNonBlockingError = t.step_func(function (error) {
+ assert_unreached("readStringNonBlocking() error callback invoked: name:" + error.name + "msg:" + error.message);
});
flushNonBlockingSuccess = t.step_func(function () {
+ fileHandleRead = tizen.filesystem.openFile("documents/file", "r");
+ fileHandleRead.readStringNonBlocking(readStringNonBlockingSuccess, readStringNonBlockingError);
});
flushNonBlockingError = t.step_func(function (error) {
assert_unreached("flushNonBlocking() error callback invoked: name:" + error.name + "msg:" + error.message);
});
- readStringNonBlockingSuccess = t.step_func(function (output) {
- assert_equals(output, content, "the flush content is not right");
- t.done();
+ writeStringNonBlockingSuccess = t.step_func(function (bytesCount) {
+ retVal = fileHandleWrite.flushNonBlocking(flushNonBlockingSuccess, flushNonBlockingError);
+ assert_equals(retVal, undefined, "return value should be undefined");
});
- readStringNonBlockingError = t.step_func(function (error) {
- assert_unreached("readStringNonBlocking() error callback invoked: name:" + error.name + "msg:" + error.message);
+ writeStringNonBlockingError = t.step_func(function (error) {
+ assert_unreached("writeStringNonBlocking() error callback invoked: name:" + error.name + "msg:" + error.message);
});
fileHandleWrite = tizen.filesystem.openFile("documents/file", "w");
fileHandleWrite.writeStringNonBlocking(content, writeStringNonBlockingSuccess, writeStringNonBlockingError);
- retVal = fileHandleWrite.flushNonBlocking(flushNonBlockingSuccess, flushNonBlockingError);
- assert_equals(retVal, undefined, "return value should be undefined");
-
- fileHandleRead = tizen.filesystem.openFile("documents/file", "r");
- fileHandleRead.readStringNonBlocking(readStringNonBlockingSuccess, readStringNonBlockingError);
});
</script>
t.step(function () {
add_result_callback(function () {
try {
+ fileHandleWrite.close();
+ fileHandleRead.close();
tizen.filesystem.deleteFile("documents/file");
} catch (err) {
}
});
writeBlobNonBlockingSuccess = t.step_func(function (blob) {
+ fileHandleRead = tizen.filesystem.openFile("documents/file", "r");
+ retVal = fileHandleRead.readBlobNonBlocking();
+ assert_equals(retVal, undefined, "return value should be undefined");
+ t.done();
});
writeBlobNonBlockingError = t.step_func(function (error) {
blob = new Blob([content], {type: "text/plain"});
fileHandleWrite = tizen.filesystem.openFile("documents/file", "w");
fileHandleWrite.writeBlobNonBlocking(blob, writeBlobNonBlockingSuccess, writeBlobNonBlockingError);
- fileHandleWrite.close();
-
- fileHandleRead = tizen.filesystem.openFile("documents/file", "r");
- retVal = fileHandleRead.readBlobNonBlocking();
- assert_equals(retVal, undefined, "return value should be undefined");
- fileHandleRead.close();
- t.done();
});
</script>
t.step(function () {
add_result_callback(function () {
try {
+ fileHandleWrite.close();
+ fileHandleRead.close();
tizen.filesystem.deleteFile("documents/file");
} catch (err) {
}
eventCallback = t.step_func(function (contents) {
text = contents.srcElement.result;
assert_equals(text, content.substring(0, 5), "The read blob content is not right");
- fileHandleRead.close();
t.done();
});
writeBlobNonBlockingSuccess = t.step_func(function (blob) {
+ fileHandleRead = tizen.filesystem.openFile("documents/file", "r");
+ reader = new FileReader(),
+ reader.addEventListener("loadend", eventCallback);
+ retVal = fileHandleRead.readBlobNonBlocking(readBlobNonBlockingSuccess, readBlobNonBlockingError, 5);
});
writeBlobNonBlockingError = t.step_func(function (error) {
blob = new Blob([content], {type: "text/plain"});
fileHandleWrite = tizen.filesystem.openFile("documents/file", "w");
fileHandleWrite.writeBlobNonBlocking(blob, writeBlobNonBlockingSuccess, writeBlobNonBlockingError);
- fileHandleWrite.close();
-
- fileHandleRead = tizen.filesystem.openFile("documents/file", "r");
- reader = new FileReader(),
- reader.addEventListener("loadend", eventCallback);
- retVal = fileHandleRead.readBlobNonBlocking(readBlobNonBlockingSuccess, readBlobNonBlockingError, 5);
});
</script>
add_result_callback(function () {
try {
+ fileHandleRead.close();
tizen.filesystem.deleteFile("documents/file");
} catch (err) {
}
fileContentsInUint8Array = fileHandleRead.readData();
assert_type(fileContentsInUint8Array, "object", "The type returned should be of object type.");
assert_array_equals(fileContentsInUint8Array, dataToWrite, "Data read from file is not right");
- fileHandleRead.close();
}, document.title);
</script>
t.step(function () {
add_result_callback(function () {
try {
+ fileHandleWrite.close();
+ fileHandleRead.close();
tizen.filesystem.deleteFile("documents/file");
} catch (err) {
}
});
writeDataNonBlockingSuccess = t.step_func(function () {
+ fileHandleRead = tizen.filesystem.openFile("documents/file", "r");
+ retVal = fileHandleRead.readDataNonBlocking();
+ assert_equals(retVal, undefined, "return value should be undefined");
+ t.done();
});
writeDataNonBlockingError = t.step_func(function (error) {
fileHandleWrite = tizen.filesystem.openFile("documents/file", "w");
fileHandleWrite.writeDataNonBlocking(dataToWrite, writeDataNonBlockingSuccess, writeDataNonBlockingError);
- fileHandleWrite.close();
-
- fileHandleRead = tizen.filesystem.openFile("documents/file", "r");
- retVal = fileHandleRead.readDataNonBlocking();
- assert_equals(retVal, undefined, "return value should be undefined");
-
- fileHandleRead.close();
- t.done();
});
</script>
t.step(function () {
add_result_callback(function () {
try {
+ fileHandleWrite.close();
+ fileHandleRead.close();
tizen.filesystem.deleteFile("documents/file");
} catch (err) {
}
});
writeDataNonBlockingSuccess = t.step_func(function () {
+ fileHandleRead = tizen.filesystem.openFile("documents/file", "r");
+ retVal = fileHandleRead.readDataNonBlocking(readDataNonBlockingSuccess, readDataNonBlockingError, 3);
});
writeDataNonBlockingError = t.step_func(function (error) {
readDataNonBlockingSuccess = t.step_func(function (data) {
assert_equals(retVal, undefined, "return value should be undefined");
assert_array_equals(data, dataToWrite.subarray(0, 3), "Data read from file is not right");
-
- fileHandleRead.close();
t.done();
});
fileHandleWrite = tizen.filesystem.openFile("documents/file", "w");
fileHandleWrite.writeDataNonBlocking(dataToWrite, writeDataNonBlockingSuccess, writeDataNonBlockingError);
- fileHandleWrite.close();
-
- fileHandleRead = tizen.filesystem.openFile("documents/file", "r");
- retVal = fileHandleRead.readDataNonBlocking(readDataNonBlockingSuccess, readDataNonBlockingError, 3);
});
</script>
add_result_callback(function () {
try {
+ fileHandleRead.close();
tizen.filesystem.deleteFile("documents/file");
} catch (err) {
}
assert_throws(INVALID_VALUES_EXCEPTION, function () {
fileHandleRead.readData(0x7fffffffffffffff);
}, "InvalidValuesError should be thrown - invalid count.");
- fileHandleRead.close();
}, document.title);
</script>
});
writeDataNonBlockingSuccess = t.step_func(function (data) {
+ retVal = fileHandleWrite.syncNonBlocking();
+ assert_equals(retVal, undefined, "return value should be undefined");
+
+ fileHandleRead = tizen.filesystem.openFile("documents/file", "r");
+ fileHandleRead.readDataNonBlocking(readDataNonBlockingSuccess, readDataNonBlockingError);
});
writeDataNonBlockingError = t.step_func(function (error) {
fileHandleWrite = tizen.filesystem.openFile("documents/file", "w");
fileHandleWrite.writeDataNonBlocking(dataToWrite, writeDataNonBlockingSuccess, writeDataNonBlockingError);
- retVal = fileHandleWrite.syncNonBlocking();
- assert_equals(retVal, undefined, "return value should be undefined");
-
- fileHandleRead = tizen.filesystem.openFile("documents/file", "r");
- fileHandleRead.readDataNonBlocking(readDataNonBlockingSuccess, readDataNonBlockingError);
});
</script>
});
writeDataNonBlockingSuccess = t.step_func(function (data) {
+ retVal = fileHandleWrite.syncNonBlocking(syncNonBlockingSuccess, syncNonBlockingError);
+ assert_equals(retVal, undefined, "return value should be undefined");
});
writeDataNonBlockingError = t.step_func(function (error) {
});
syncNonBlockingSuccess = t.step_func(function () {
+ fileHandleRead = tizen.filesystem.openFile("documents/file", "r");
+ fileHandleRead.readDataNonBlocking(readDataNonBlockingSuccess, readDataNonBlockingError);
});
syncNonBlockingError = t.step_func(function (error) {
fileHandleWrite = tizen.filesystem.openFile("documents/file", "w");
fileHandleWrite.writeDataNonBlocking(dataToWrite, writeDataNonBlockingSuccess, writeDataNonBlockingError);
- retVal = fileHandleWrite.syncNonBlocking(syncNonBlockingSuccess, syncNonBlockingError);
- assert_equals(retVal, undefined, "return value should be undefined");
-
- fileHandleRead = tizen.filesystem.openFile("documents/file", "r");
- fileHandleRead.readDataNonBlocking(readDataNonBlockingSuccess, readDataNonBlockingError);
});
</script>
t.step(function () {
add_result_callback(function () {
try {
+ fileHandleWrite.close();
fileHandleRead.close();
tizen.filesystem.deleteFile("documents/file");
} catch (err) {
});
writeBlobNonBlockingSuccess = t.step_func(function (blob) {
+ fileHandleRead = tizen.filesystem.openFile("documents/file", "r");
+ reader = new FileReader(),
+ reader.addEventListener("loadend", eventCallback);
+ fileHandleRead.readBlobNonBlocking(readBlobNonBlockingSuccess, readBlobNonBlockingError);
});
writeBlobNonBlockingError = t.step_func(function (error) {
fileHandleWrite = tizen.filesystem.openFile("documents/file", "w");
retVal = fileHandleWrite.writeBlobNonBlocking(blob, writeBlobNonBlockingSuccess, writeBlobNonBlockingError);
assert_equals(retVal, undefined, "return value should be undefined");
- fileHandleWrite.close();
-
- fileHandleRead = tizen.filesystem.openFile("documents/file", "r");
- reader = new FileReader(),
- reader.addEventListener("loadend", eventCallback);
- fileHandleRead.readBlobNonBlocking(readBlobNonBlockingSuccess, readBlobNonBlockingError);
});
</script>
t.step(function () {
add_result_callback(function () {
try {
+ fileHandleWrite.close();
+ fileHandleRead.close();
tizen.filesystem.deleteFile("documents/file");
} catch (err) {
}
});
writeDataNonBlockingSuccess = t.step_func(function () {
+ fileHandleRead = tizen.filesystem.openFile("documents/file", "r");
+ fileHandleRead.readDataNonBlocking(readDataNonBlockingSuccess, readDataNonBlockingError);
});
writeDataNonBlockingError = t.step_func(function (error) {
readDataNonBlockingSuccess = t.step_func(function (data) {
assert_array_equals(data, dataToWrite, "Data read from file is not right");
- fileHandleRead.close();
t.done();
});
fileHandleWrite = tizen.filesystem.openFile("documents/file", "w");
retVal = fileHandleWrite.writeDataNonBlocking(dataToWrite, writeDataNonBlockingSuccess, writeDataNonBlockingError);
assert_equals(retVal, undefined, "return value should be undefined");
- fileHandleWrite.close();
-
- fileHandleRead = tizen.filesystem.openFile("documents/file", "r");
- fileHandleRead.readDataNonBlocking(readDataNonBlockingSuccess, readDataNonBlockingError);
});
</script>
t.step(function () {
add_result_callback(function () {
try {
+ fileHandleWrite.close();
+ fileHandleRead.close();
tizen.filesystem.deleteFile("documents/file");
} catch (err) {
}
});
writeStringNonBlockingSuccess = t.step_func(function (bytesCount) {
+ fileHandleRead = tizen.filesystem.openFile("documents/file", "r");
+ fileHandleRead.readStringNonBlocking(readStringNonBlockingSuccess, readStringNonBlockingError, 5, "UTF-8");
});
writeStringNonBlockingError = t.step_func(function (error) {
readStringNonBlockingSuccess = t.step_func(function (output) {
assert_equals(output, content.substring(0, 5), "The read content should be same as the written content.");
- fileHandleRead.close();
t.done();
});
fileHandleWrite = tizen.filesystem.openFile("documents/file", "w");
retVal = fileHandleWrite.writeStringNonBlocking(content, writeStringNonBlockingSuccess, writeStringNonBlockingError, "UTF-8");
assert_equals(retVal, undefined, "return value should be undefined");
- fileHandleWrite.close();
-
- fileHandleRead = tizen.filesystem.openFile("documents/file", "r");
- fileHandleRead.readStringNonBlocking(readStringNonBlockingSuccess, readStringNonBlockingError, 5, "UTF-8");
});
</script>