fs.write(testStr);
fs.position = 0;
assert_true("bytesAvailable" in fs, "bytesAvailable doesn't exist");
- check_readonly(fs, "bytesAvailable", fs.bytesAvailable, "number", 2);
+ check_readonly(fs, "bytesAvailable", fs.bytesAvailable, "long", fs.bytesAvailable + 2);
fs.close();
t.done();
});
exceptionName = "TypeMismatchError", incorrectCallback, onSuccess;
t.step(function () {
onSuccess = t.step_func(function (storage) {
+ assert_unreached("onSuccess callback invoked");
});
incorrectCallback = {
onerror: t.step_func(function (){
- assert_unreached("Invalid callback invoked: ");
+ assert_unreached("invalid callback invoked");
})
};
assert_throws({name : exceptionName},
Authors:
Piotr Czaja <p.czaja@samsung.com>
Beata Koziarek <b.koziarek@samsung.com>
+ Mariusz Polasinski <m.polasinski@samsung.com>
-->
<html lang="en">
<body>
<div id="log"></div>
-<script>
+<script type="text/javascript">
+
//==== TEST: FileSystemManager_listStorages_with_onerror
//==== PRIORITY P1
//==== LABEL Check with optional arguments listStorages
//==== SPEC Tizen Web API:IO:Filesystem:FileSystemManager:listStorages M
//==== SPEC_URL https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/filesystem.html
-//==== TEST_CRITERIA
+//==== TEST_CRITERIA MOA MR
-// Check with optional arguments listStorages
var t = async_test("FileSystemManager_listStorages_with_onerror"),
- onSuccess, onError;
-t.step(function(){
- onError = t.step_func(function (error) {
- assert_unreached("Error: " + error.message);
- });
- onSuccess = t.step_func(function (storage) {
+ listStoragesSuccess, listStoragesError, retValue = null;
+
+t.step(function () {
+
+ listStoragesSuccess = t.step_func(function (storages) {
+ assert_type(storages, "array", "incorrect type of the received argument");
+ assert_true(storages.length > 0, "incorrect received argument");
+ assert_equals(retValue, undefined, "listStorages returns wrong value");
t.done();
});
- tizen.filesystem.resolve("images", onSuccess, onError);
+
+ listStoragesError = t.step_func(function (error) {
+ assert_unreached("listStorages() error callback invoked: name: " + error.name + ", msg: " + error.message);
+ });
+
+ retValue = tizen.filesystem.listStorages(listStoragesSuccess, listStoragesError);
});
</script>
test(function () {
var maxLength = tizen.filesystem.maxPathLength;
assert_true("maxPathLength" in tizen.filesystem, "attribute doesn't exist");
- check_readonly(tizen.filesystem, "maxPathLength", maxLength, "long", 10);
+ check_readonly(tizen.filesystem, "maxPathLength", maxLength, "long", maxLength - 5);
}, "FileSystemManager_maxPathLength_attribute");
</script>
Authors:
Piotr Czaja <p.czaja@samsung.com>
Beata Koziarek <b.koziarek@samsung.com>
+ Mariusz Polasinski <m.polasinski@samsung.com>
-->
<html lang="en">
//==== TEST_CRITERIA MC
var t = async_test("FileSystemManager_resolve_mode_TypeMismatch"),
- conversionTable, resolveSuccess, resolveError, mode, exceptionName, expected, i;
+ conversionTable, resolveSuccess, resolveError, mode, exceptionName, i;
t.step(function () {
resolveSuccess = t.step_func(function (dir) {
- expected="images";
- assert_equals(dir.path ,expected, "resolve a location to a file handle");
+ assert_unreached("resolveSuccess was invoked");
});
resolveError = t.step_func(function (error) {
assert_unreached("resolve() error callback invoked: name:" + error.name + "msg:" + error.message);
//==== SPEC_URL: https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/filesystem.html
//==== TEST_CRITERIA AE AT ARO
-var t = async_test("FileSystemStorage_label_attribute"), listStoragesSucces;
+var t = async_test("FileSystemStorage_label_attribute"), listStoragesSuccess;
t.step(function () {
- listStoragesSucces = t.step_func(function (storages) {
+ listStoragesSuccess = t.step_func(function (storages) {
assert_true(storages.length > 0, "No available storage");
assert_true("label" in storages[0],"label not in FileSystemStorage");
- check_readonly(storages[0], "label", storages[0].label, "string", "dummyValue");
+ check_readonly(storages[0], "label", storages[0].label, "string", storages[0].label + "dummyValue");
t.done();
});
- tizen.filesystem.listStorages(listStoragesSucces);
+ tizen.filesystem.listStorages(listStoragesSuccess);
});
</script>
Authors:
Beata Koziarek <b.koziarek@samsung.com>
+ Mariusz Polasinski <m.polasinski@samsung.com>
-->
<html lang="en">
resolveSuccess = t.step_func(function (dir) {
fsTestFile = dir.createFile(fsTestFileName);
assert_own_property(fsTestFile, "fileSize", "File does not own fileSize property.");
- check_readonly(fsTestFile, "fileSize", 0, "number", "valueToAssign");
+ check_readonly(fsTestFile, "fileSize", 0, "unsigned long long", fsTestFile.fileSize + 512);
+ assert_equals(dir.fileSize, undefined, "fileSize of directory should be undefined");
t.done();
});
resolveSuccess = t.step_func(function (dir) {
fsTestFile = dir.createFile(fsTestFileName);
assert_own_property(fsTestFile, "fullPath", "File does not own fullPath property.");
- check_readonly(fsTestFile, "fullPath", fsTestFile.fullPath, "string", "valueToAssign");
+ check_readonly(fsTestFile, "fullPath", fsTestFile.fullPath, "string", "images");
t.done();
});
t.step(function () {
resolveSuccess = t.step_func(function (dir) {
assert_own_property(dir, "isDirectory", "File does not own isDirectory property.");
- check_readonly(dir, "isDirectory", true, "boolean", "valueToAssign");
+ check_readonly(dir, "isDirectory", true, "boolean", false);
t.done();
});
t.step(function () {
resolveSuccess = t.step_func(function (dir) {
assert_own_property(dir, "isFile", "File does not own isFile property.");
- check_readonly(dir, "isFile", false, "boolean", "valueToAssign");
+ check_readonly(dir, "isFile", false, "boolean", true);
t.done();
});
Authors:
Beata Koziarek <b.koziarek@samsung.com>
+ Mariusz Polasinski <m.polasinski@samsung.com>
-->
<html>
//==== SPEC_URL: https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/filesystem.html
//==== TEST_CRITERIA AE AT ARO
-var t = async_test("File_length_attribute"),
- resolveSuccess, resolveError
-;
+var t = async_test("File_length_attribute"), fsTestFileName = getFileName("filesystem.txt"),
+ resolveSuccess, resolveError, fsTestFile;
+
t.step(function () {
resolveSuccess = t.step_func(function (dir) {
assert_own_property(dir, "length", "File does not own length property.");
- check_readonly(dir, "length", dir.length, "number", "valueToAssign");
+ check_readonly(dir, "length", dir.length, "long", dir.length + 10);
+ fsTestFile = dir.createFile(fsTestFileName);
+ assert_equals(fsTestFile.length, undefined, "length of file should be undefined");
t.done();
});
assert_unreached("resolve() error callback invoked: name:" + error.name + "msg:" + error.message);
});
- tizen.filesystem.resolve("documents", resolveSuccess, resolveError, "rw");
+ prepareForTesting(t, function () {
+ tizen.filesystem.resolve("documents", resolveSuccess, resolveError, "rw");
+ });
});
</script>
resolveSuccess = t.step_func(function (dir) {
fsTestFile = dir.createFile(fsTestFileName);
assert_own_property(fsTestFile, "name", "File does not own name property.");
- check_readonly(fsTestFile, "name", fsTestFile.name, "string", "valueToAssign");
+ check_readonly(fsTestFile, "name", fsTestFile.name, "string", fsTestFile.name + "dummyValue");
t.done();
});
t.step(function () {
resolveSuccess = t.step_func(function (dir) {
assert_own_property(dir, "path", "file does not have own path property");
- check_readonly(dir, "path", "documents", "string", "images");
+ check_readonly(dir, "path", dir.path, "string", "images");
assert_equals(dir.path, "documents", "incorrect path");
t.done();
});
Authors:
Beata Koziarek <b.koziarek@samsung.com>
+ Mariusz Polasinski <m.polasinski@samsung.com>
-->
<html lang="en">
<body>
<div id="log"></div>
-<script>
+<script type="text/javascript">
+
//==== TEST: File_readAsText_missarg
//==== PRIORITY: P2
//==== LABEL: Check if readAsText of File with missing non-optional argument works
resolveSuccess, resolveError, file,
fsTestFileName = getFileName("testMissArg.txt");
-t.step(function(){
+t.step(function () {
resolveSuccess = t.step_func(function (dir) {
file = dir.createFile(fsTestFileName);
file.openStream("w",
- function(fs){
+ t.step_func(function (fs) {
fs.write("HelloWorld");
fs.close();
- });
- assert_throws({name: "TypeMismatchError"},
- function () {
- file.readAsText();
- });
- t.done();
+ assert_throws({name: "TypeMismatchError"},
+ function () {
+ file.readAsText();
+ });
+ t.done();
+ }));
});
resolveError = t.step_func(function (error) {
assert_unreached("resolve() error callback invoked: name: " + error.name + ", msg: " + error.message);
var t = async_test("File_readOnly_attribute"),
onSuccess, onError;
-t.step(function(){
+t.step(function () {
onSuccess = t.step_func(function (dir) {
assert_own_property(dir, "readOnly", "File does not own readOnly property.");
- check_readonly(dir, "readOnly", false, "boolean", "valueToAssign");
+ check_readonly(dir, "readOnly", false, "boolean", true);
t.done();
});
onError = t.step_func(function (error) {