<html>
<head>
<title>DownloadCallback_notexist</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script>
//==== TEST: DownloadCallback_notexist
-//==== LABEL: check if is possible to call DownloadCallback in new expresion
+//==== LABEL Check if is possible to call DownloadCallback in new expresion
//==== PRIORITY: P3
//==== SPEC: Tizen Web API:Content:Download:DownloadCallback:DownloadCallback U
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
test(function () {
check_no_interface_object("DownloadCallback");
-}, "DownloadCallback_notexist");
+}, document.title);
</script>
</body>
<html>
<head>
<title>DownloadCallback_oncanceled</title>
-<script src="../resources/unitcommon.js"></script>
-<script src="support/downloadcommon.js"></script>
+<script src="support/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadCallback_oncanceled
-//==== LABEL: Test whether the type of each argument is equal to the specified for oncanceled callback.
+//==== LABEL Test whether the type of each argument is equal to the specified for oncanceled callback.
//==== PRIORITY: P1
//==== SPEC: Tizen Web API:Content:Download:DownloadCallback:oncanceled M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
//==== TEST_CRITERIA CBT CBOA
setup({timeout: 90000});
-var t = async_test("DownloadCallback_oncanceled", {timeout:90000}), listener,
+var t = async_test(document.title, {timeout: 90000}), listener,
downloadRequest, downloadId;
t.step(function () {
listener = {
tizen.download.cancel(id);
} catch (e) { }
}),
- onpaused : t.step_func(function (id) {
+ onpaused: t.step_func(function (id) {
assert_unreached("onpaused should not be reached");
}),
oncanceled: t.step_func(function (id) {
assert_equals(id, downloadId, "id is diffrent");
t.done();
}),
- oncompleted : t.step_func(function (id, fullPath) {
+ oncompleted: t.step_func(function (id, fullPath) {
assert_unreached("oncompleted should not be reached");
}),
- onfailed : t.step_func(function (id, error) {
+ onfailed: t.step_func(function (id, error) {
assert_unreached("onfailed should not be reached:: name: " + error.name + ", msg: " + error.message);
})
};
<html>
<head>
<title>DownloadCallback_oncompleted</title>
-<script src="../resources/unitcommon.js"></script>
-<script src="support/downloadcommon.js"></script>
+<script src="support/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadCallback_oncompleted
-//==== LABEL: Test whether the type of each argument is equal to the specified for oncompleted callback.
+//==== LABEL Test whether the type of each argument is equal to the specified for oncompleted callback.
//==== PRIORITY: P1
//==== SPEC: Tizen Web API:Content:Download:DownloadCallback:oncompleted M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
//==== TEST_CRITERIA CBT CBOA
setup({timeout: 90000});
-var t = async_test("DownloadCallback_oncompleted", {timeout:90000}), listener,
+var t = async_test(document.title, {timeout: 90000}), listener,
downloadRequest, downloadId;
t.step(function () {
listener = {
- onprogress : t.step_func(function (id, receivedSize, totalSize) {
+ onprogress: t.step_func(function (id, receivedSize, totalSize) {
}),
- onpaused : t.step_func(function (id) {
+ onpaused: t.step_func(function (id) {
assert_unreached("onpaused should not be reached");
}),
- oncanceled : t.step_func(function (id) {
+ oncanceled: t.step_func(function (id) {
assert_unreached("oncanceled should not be reached");
}),
oncompleted: t.step_func(function (id, fullPath) {
assert_not_equals(fullPath, "", "fullPath is empty");
t.done();
}),
- onfailed : t.step_func(function (id, error) {
+ onfailed: t.step_func(function (id, error) {
assert_unreached("onfailed reached:: name: " + error.name + ", msg: " + error.message);
})
};
<html>
<head>
<title>DownloadCallback_onfailed</title>
-<script src="../resources/unitcommon.js"></script>
-<script src="support/downloadcommon.js"></script>
+<script src="support/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadCallback_onfailed
-//==== LABEL: Test whether the type of each argument is equal to the specified for onfailed callback.
+//==== LABEL Test whether the type of each argument is equal to the specified for onfailed callback.
//==== PRIORITY: P1
//==== SPEC: Tizen Web API:Content:Download:DownloadCallback:onfailed M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
//==== TEST_CRITERIA CBT CBOA
setup({timeout: 90000});
-var t = async_test("DownloadCallback_onfailed", {timeout:90000}), listener,
+var t = async_test(document.title, {timeout: 90000}), listener,
downloadRequest, downloadId;
t.step(function () {
listener = {
onpaused: t.step_func(function (id) {
assert_unreached("onpaused should not be reached");
}),
- oncanceled : t.step_func(function (id) {
+ oncanceled: t.step_func(function (id) {
assert_unreached("oncanceled should not be reached");
}),
- oncompleted : t.step_func(function (id, fullPath) {
+ oncompleted: t.step_func(function (id, fullPath) {
assert_unreached("oncompleted should not be reached");
}),
onfailed: t.step_func(function (id, err) {
<html>
<head>
<title>DownloadCallback_onpaused</title>
-<script src="../resources/unitcommon.js"></script>
-<script src="support/downloadcommon.js"></script>
+<script src="support/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadCallback_onpaused
-//==== LABEL: Test whether the type of each argument is equal to the specified for onpaused callback.
+//==== LABEL Test whether the type of each argument is equal to the specified for onpaused callback.
//==== PRIORITY: P1
//==== SPEC: Tizen Web API:Content:Download:DownloadCallback:onpaused M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
//==== TEST_CRITERIA CBT CBOA
setup({timeout: 90000});
-var t = async_test("DownloadCallback_onpaused", {timeout:90000}), listener,
+var t = async_test(document.title, {timeout: 90000}), listener,
downloadRequest, downloadId;
t.step(function () {
listener = {
tizen.download.cancel(downloadId);
} catch (e) { }
}),
- oncanceled : t.step_func(function (id) {
+ oncanceled: t.step_func(function (id) {
t.done();
}),
- oncompleted : t.step_func(function (id, path) {
+ oncompleted: t.step_func(function (id, path) {
assert_unreached("oncompleted should not be reached");
}),
- onfailed : t.step_func(function (id, error) {
+ onfailed: t.step_func(function (id, error) {
assert_unreached("onfailed reached:: name: " + error.name + ", msg: " + error.message);
})
};
<html>
<head>
<title>DownloadCallback_onprogress</title>
-<script src="../resources/unitcommon.js"></script>
-<script src="support/downloadcommon.js"></script>
+<script src="support/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadCallback_onprogress
-//==== LABEL: Test whether the type of each argument is equal to the specified for onprogress callback.
+//==== LABEL Test whether the type of each argument is equal to the specified for onprogress callback.
//==== PRIORITY: P1
//==== SPEC: Tizen Web API:Content:Download:DownloadCallback:onprogress M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
//==== TEST_CRITERIA CBT CBOA
setup({timeout: 90000});
-var t = async_test("DownloadCallback_onprogress", {timeout:90000}), listener,
+var t = async_test(document.title, {timeout: 90000}), listener,
downloadRequest, downloadId;
t.step(function () {
listener = {
tizen.download.cancel(downloadId);
} catch (e) { }
}),
- onpaused : t.step_func(function (id) {
+ onpaused: t.step_func(function (id) {
assert_unreached("onpaused should not be reached");
}),
- oncanceled : t.step_func(function (id) {
+ oncanceled: t.step_func(function (id) {
t.done();
}),
- oncompleted : t.step_func(function (id, path) {
+ oncompleted: t.step_func(function (id, path) {
assert_unreached("oncompleted should not be reached");
}),
- onfailed : t.step_func(function (id, error) {
+ onfailed: t.step_func(function (id, error) {
assert_unreached("onfailed should not be reached:: name: " + error.name + ", msg: " + error.message);
})
};
<html>
<head>
<title>DownloadManagerObject_download_exists</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script>
//==== TEST: DownloadManagerObject_download_exists
-//==== LABEL check if the readonly attribute download
+//==== LABEL Check if the readonly attribute download
//==== PRIORITY P3
//==== SPEC Tizen Web API:Content:Download:DownloadManager:DownloadManager U
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
assert_true("download" in tizen, "DownloadManagerObject interface does not exist in Tizen object");
check_readonly(tizen, "download", tizen.download, "object", "dummyValue");
check_no_interface_object("DownloadManagerObject");
-}, "DownloadManagerObject_download_exists");
+}, document.title);
</script>
</body>
<html>
<head>
<title>DownloadManagerObject_notexist</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
<script src="support/bluetooth_common.js"></script>
</head>
<body>
<div id="log"></div>
<script>
//==== TEST: DownloadManagerObject_notexist
-//==== LABEL check if is possible to call DownloadManagerObject in new expresion
+//==== LABEL Check if is possible to call DownloadManagerObject in new expresion
//==== PRIORITY P3
//==== SPEC: Tizen Web API:Content:Download:DownloadManagerObject:DownloadManagerObject U
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
//==== TEST_CRITERIA NIO
test(function () {
check_no_interface_object("DownloadManagerObject");
-}, "DownloadManagerObject_notexist");
+}, document.title);
</script>
</body>
<html>
<head>
<title>DownloadManager_cancel</title>
-<script src="../resources/unitcommon.js"></script>
-<script src="support/downloadcommon.js"></script>
+<script src="support/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadManager_cancel
-//==== LABEL: Check if cancel method with downloadId non-optional argument works
+//==== LABEL Check if cancel method with downloadId non-optional argument works
//==== PRIORITY: P2
//==== SPEC: Tizen Web API:Content:Download:DownloadManager:cancel M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
//==== TEST_CRITERIA MMINA MAST MR
setup({timeout: 90000});
-var t = async_test("DownloadManager_cancel", {timeout:90000}), downloadRequest = null,
+var t = async_test(document.title, {timeout: 90000}), downloadRequest = null,
downloadId, listener, retValue = null;
t.step(function () {
listener = {
- onprogress : t.step_func(function (id, receivedSize, totalSize) {
+ onprogress: t.step_func(function (id, receivedSize, totalSize) {
assert_not_equals(id, null, "id valid");
try {
retValue = tizen.download.cancel(downloadId);
} catch(e) { }
}),
- onpaused : t.step_func(function (id) {
+ onpaused: t.step_func(function (id) {
assert_unreached("onpaused should not be reached");
}),
- oncanceled : t.step_func(function (id) {
+ oncanceled: t.step_func(function (id) {
assert_equals(tizen.download.getState(downloadId), "CANCELED", "DownloadId state is not 'CANCELED'");
assert_equals(retValue, undefined, "oncanceled returns wrong value");
t.done();
}),
- oncompleted : t.step_func(function (id, path) {
+ oncompleted: t.step_func(function (id, path) {
assert_unreached("oncompleted should not be reached");
}),
- onfailed : t.step_func(function (id, error) {
+ onfailed: t.step_func(function (id, error) {
assert_unreached("onfailed should not be reached:: name: " + error.name + ", msg: " + error.message);
})
};
<html>
<head>
<title>DownloadManager_cancel_exist</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadManager_cancel_exist
-//==== LABEL: Check if cancel method exists in DownloadManager.
+//==== LABEL Check if cancel method exists in DownloadManager.
//==== PRIORITY: P1
//==== SPEC: Tizen Web API:Content:Download:DownloadManager:cancel M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
test(function () {
assert_true("cancel" in tizen.download, "cancel method not exists");
check_method_exists(tizen.download, "cancel");
-}, "DownloadManager_cancel_exist");
+}, document.title);
</script>
</body>
<html>
<head>
<title>DownloadManager_extend</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script>
//==== TEST: DownloadManager_extend
-//==== LABEL: test whether the DownloadManager object can have new attribute added
+//==== LABEL Test whether the DownloadManager object can have new attribute added
//==== PRIORITY: P3
//==== SPEC: Tizen Web API:Content:Download:DownloadManager:DownloadManager U
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
test(function () {
check_extensibility(tizen.download);
-}, "DownloadManager_extend");
+}, document.title);
</script>
</body>
<html>
<head>
<title>DownloadManager_getDownloadRequest</title>
-<script src="../resources/unitcommon.js"></script>
-<script src="support/downloadcommon.js"></script>
+<script src="support/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadManager_getDownloadRequest
-//==== LABEL: Check if getDownloadRequest method with downloadId non-optional argument works
+//==== LABEL Check if getDownloadRequest method with downloadId non-optional argument works
//==== PRIORITY: P2
//==== SPEC: Tizen Web API:Content:Download:DownloadManager:getDownloadRequest M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
//==== ONLOAD_DELAY 90
//==== TEST_CRITERIA MR MMINA
-var t = async_test("DownloadManager_getDownloadRequest", {timeout:90000}),
+var t = async_test(document.title, {timeout: 90000}),
destination = "documents", fileName = "download.html", downloadRequest,
downloadId;
setup({timeout: 90000});
t.step(function () {
var listener = {
- onprogress : t.step_func(function (id, receivedSize, totalSize) {
+ onprogress: t.step_func(function (id, receivedSize, totalSize) {
}),
- onpaused : t.step_func(function (id) {
+ onpaused: t.step_func(function (id) {
assert_unreached("onpaused should not be reached");
}),
- oncanceled : t.step_func(function (id) {
+ oncanceled: t.step_func(function (id) {
assert_unreached("oncanceled should not be reached");
}),
- oncompleted : t.step_func(function (id, fullPath) {
+ oncompleted: t.step_func(function (id, fullPath) {
downloadRequest = tizen.download.getDownloadRequest(downloadId);
assert_equals(downloadRequest.url, url_small, "url valu should not changed");
assert_equals(downloadRequest.destination, destination, "destination value should not changed");
assert_equals(downloadRequest.fileName, fileName, "fileName value should not changed");
t.done();
}),
- onfailed : t.step_func(function (id, error) {
+ onfailed: t.step_func(function (id, error) {
assert_unreached("onfailed should not be reached");
})
};
<html>
<head>
<title>DownloadManager_getDownloadRequest_exist</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadManager_getDownloadRequest_exist
-//==== LABEL: Check if getDownloadRequest method exists in DownloadManager.
+//==== LABEL Check if getDownloadRequest method exists in DownloadManager.
//==== PRIORITY: P1
//==== SPEC: Tizen Web API:Content:Download:DownloadManager:getDownloadRequest M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
test(function () {
assert_true("getDownloadRequest" in tizen.download, "getDownloadRequest method not exist");
check_method_exists(tizen.download, "getDownloadRequest");
-}, "DownloadManager_getDownloadRequest_exist");
+}, document.title);
</script>
</body>
<html>
<head>
<title>DownloadManager_getMIMEType</title>
-<script src="../resources/unitcommon.js"></script>
-<script src="support/downloadcommon.js"></script>
+<script src="support/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadManager_getMIMEType
-//==== LABEL: Check if getMIMEType method with downloadId non-optional argument works
+//==== LABEL Check if getMIMEType method with downloadId non-optional argument works
//==== PRIORITY: P2
//==== SPEC: Tizen Web API:Content:Download:DownloadManager:getMIMEType M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
//==== ONLOAD_DELAY 90
//==== TEST_CRITERIA MMINA MR
-var t = async_test("DownloadManager_getMIMEType", {timeout:90000}), listener,
+var t = async_test(document.title, {timeout: 90000}), listener,
MIMEtype, expectedMIMEtype, downloadRequest, downloadId;
setup({timeout: 90000});
t.step(function () {
listener = {
- onprogress : t.step_func(function (id, receivedSize, totalSize) {
+ onprogress: t.step_func(function (id, receivedSize, totalSize) {
}),
- onpaused : t.step_func(function (id) {
+ onpaused: t.step_func(function (id) {
assert_unreached("onpaused should not be reached");
}),
- oncanceled : t.step_func(function (id) {
+ oncanceled: t.step_func(function (id) {
assert_unreached("oncanceled should not be reached");
}),
- oncompleted : t.step_func(function (id, fullPath) {
+ oncompleted: t.step_func(function (id, fullPath) {
expectedMIMEtype = "image/png";
MIMEtype = tizen.download.getMIMEType(downloadId);
assert_equals(MIMEtype, expectedMIMEtype, "different MIMEType value from expected");
t.done();
}),
- onfailed : t.step_func(function (id, error) {
+ onfailed: t.step_func(function (id, error) {
assert_unreached("onfailed should not be reached:: name: " + error.name + ", msg: " + error.message);
})
};
<html>
<head>
<title>DownloadManager_getMIMEType_exist</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadManager_getMIMEType_exist
-//==== LABEL: Check if getMIMEType method exists in DownloadManager.
+//==== LABEL Check if getMIMEType method exists in DownloadManager.
//==== PRIORITY: P1
//==== SPEC: Tizen Web API:Content:Download:DownloadManager:getMIMEType M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
test(function () {
assert_true("getMIMEType" in tizen.download, "getMIMEType method exists");
check_method_exists(tizen.download, "getMIMEType");
-}, "DownloadManager_getMIMEType_exist");
+}, document.title);
</script>
</body>
<html>
<head>
<title>DownloadManager_getState</title>
-<script src="../resources/unitcommon.js"></script>
-<script src="support/downloadcommon.js"></script>
+<script src="support/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadManager_getState
-//==== LABEL: Check if getState method with downloadId non-optional argument works
+//==== LABEL Check if getState method with downloadId non-optional argument works
//==== PRIORITY: P2
//==== SPEC: Tizen Web API:Content:Download:DownloadManager:getState M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
//==== ONLOAD_DELAY 90
//==== TEST_CRITERIA MMINA MR
-var t = async_test("DownloadManager_getState", {timeout:90000}), downloadRequest = null,
+var t = async_test(document.title, {timeout: 90000}), downloadRequest = null,
downloadId, listener, state;
setup({timeout: 90000});
t.step(function () {
listener = {
- onprogress : t.step_func(function (id, receivedSize, totalSize) {
+ onprogress: t.step_func(function (id, receivedSize, totalSize) {
}),
- onpaused : t.step_func(function (id) {
+ onpaused: t.step_func(function (id) {
assert_unreached("onpaused should not be reached");
}),
- oncanceled : t.step_func(function (id) {
+ oncanceled: t.step_func(function (id) {
assert_unreached("oncanceled should not be reached");
}),
oncompleted: t.step_func(function (id, fullPath) {
assert_equals(state, "COMPLETED", "download state different from completed");
t.done();
}),
- onfailed : t.step_func(function (id, error) {
+ onfailed: t.step_func(function (id, error) {
assert_unreached("onfailed should not be reached:: name: " + error.name + ", msg: " + error.message);
})
};
<html>
<head>
<title>DownloadManager_getState_exist</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadManager_getState_exist
-//==== LABEL: Check if getState method exists in DownloadManager.
+//==== LABEL Check if getState method exists in DownloadManager.
//==== PRIORITY: P1
//==== SPEC: Tizen Web API:Content:Download:DownloadManager:getState M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
test(function () {
assert_true("getState" in tizen.download, "getState method exists");
check_method_exists(tizen.download, "getState");
-}, "DownloadManager_getState_exist");
+}, document.title);
</script>
</body>
<html>
<head>
<title>DownloadManager_getState_using</title>
-<script src="../resources/unitcommon.js"></script>
-<script src="support/downloadcommon.js"></script>
+<script src="support/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadManager_getState_using
-//==== LABEL check if the method getState which is in DownloadManager interface returns proper value
+//==== LABEL Check if the method getState which is in DownloadManager interface returns proper value
//==== ONLOAD_DELAY 90
//==== SPEC Tizen Web API:Content:Download:DownloadManager:getState M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
//==== TEST_CRITERIA MMINA MR
-var t = async_test("DownloadManager_getState_using", {timeout:90000}),
+var t = async_test(document.title, {timeout: 90000}),
downloadId = null, DownloadRequest = null, listener, state;
setup({timeout: 90000});
t.step(function () {
listener = {
- onprogress : t.step_func(function (id, receivedSize, totalSize) {
+ onprogress: t.step_func(function (id, receivedSize, totalSize) {
state = tizen.download.getState(downloadId);
assert_true(state === "DOWNLOADING" || state === "COMPLETED",
"The state is not DOWNLOADING nor COMPLETED");
}),
- onpaused : t.step_func(function (id) {
+ onpaused: t.step_func(function (id) {
assert_unreached("onpaused should not be reached");
}),
- oncanceled : t.step_func(function (id) {
+ oncanceled: t.step_func(function (id) {
}),
- oncompleted : t.step_func(function (id, fullPath) {
+ oncompleted: t.step_func(function (id, fullPath) {
assert_true(state === "DOWNLOADING" || state === "COMPLETED",
"The state is not DOWNLOADING nor COMPLETED");
t.done();
}),
- onfailed : t.step_func(function (id, error) {
+ onfailed: t.step_func(function (id, error) {
assert_unreached("onfailed should not be reached");
})
};
<html>
<head>
<title>DownloadManager_in_tizen</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadManager_in_tizen
-//==== LABEL: check download attribute
+//==== LABEL Check download attribute
//==== PRIORITY: P3
//==== SPEC: Tizen Web API:Content:Download:DownloadManager:DownloadManager U
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
test(function () {
check_readonly(tizen, "download", tizen.download, "object", "Tizen");
-}, "DownloadManager_in_tizen");
+}, document.title);
</script>
</body>
<html>
<head>
<title>DownloadManager_notexist</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script>
//==== TEST: DownloadManager_notexist
-//==== LABEL: check if is possible to call DownloadManager in new expresion
+//==== LABEL Check if is possible to call DownloadManager in new expresion
//==== PRIORITY: P3
//==== SPEC: Tizen Web API:Content:Download:DownloadManager:DownloadManager U
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
//==== TEST_CRITERIA NIO
test(function () {
check_no_interface_object("DownloadManager");
-}, "DownloadManager_notexist");
+}, document.title);
</script>
</body>
<html>
<head>
<title>DownloadManager_pause</title>
-<script src="../resources/unitcommon.js"></script>
-<script src="support/downloadcommon.js"></script>
+<script src="support/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadManager_pause
-//==== LABEL: Check if pause method with downloadId non-optional argument works
+//==== LABEL Check if pause method with downloadId non-optional argument works
//==== PRIORITY: P2
//==== SPEC: Tizen Web API:Content:Download:DownloadManager:pause M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
//==== ONLOAD_DELAY 90
//==== TEST_CRITERIA MMINA MAST MR
-var t = async_test("DownloadManager_pause", {timeout:90000}), downloadRequest = null,
+var t = async_test(document.title, {timeout: 90000}), downloadRequest = null,
downloadId, listener, retValue = null;
setup({timeout: 90000});
t.step(function () {
listener = {
- onprogress : t.step_func(function (id, receivedSize, totalSize) {
+ onprogress: t.step_func(function (id, receivedSize, totalSize) {
assert_not_equals(id, null, "id should not be null");
try {
retValue = tizen.download.pause(downloadId);
} catch (e) { }
}),
- onpaused : t.step_func(function (id) {
+ onpaused: t.step_func(function (id) {
assert_equals(tizen.download.getState(downloadId), "PAUSED", "DownloadId not paused");
try {
tizen.download.cancel(downloadId);
} catch (e) { }
}),
- oncanceled : t.step_func(function (id) {
+ oncanceled: t.step_func(function (id) {
assert_equals(retValue, undefined, "pause returns wrong value");
t.done();
}),
- oncompleted : t.step_func(function (id, path) {
+ oncompleted: t.step_func(function (id, path) {
assert_unreached("oncompleted should not be reached");
}),
- onfailed : t.step_func(function (id, error) {
+ onfailed: t.step_func(function (id, error) {
assert_unreached("onfailed should not be reached:: name: " + error.name + ", msg: " + error.message);
})
};
<html>
<head>
<title>DownloadManager_pause_exist</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadManager_pause_exist
-//==== LABEL: Check if pause method exists in DownloadManager.
+//==== LABEL Check if pause method exists in DownloadManager.
//==== PRIORITY: P1
//==== SPEC Tizen Web API:Content:Download:DownloadManager:pause M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
test(function () {
assert_true("pause" in tizen.download, "pause method not exist");
check_method_exists(tizen.download, "pause");
-}, "DownloadManager_pause_exist");
+}, document.title);
</script>
</body>
<html>
<head>
<title>DownloadManager_resume</title>
-<script src="../resources/unitcommon.js"></script>
-<script src="support/downloadcommon.js"></script>
+<script src="support/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadManager_resume
-//==== LABEL: Check if resume method with downloadId non-optional argument works
+//==== LABEL Check if resume method with downloadId non-optional argument works
//==== PRIORITY: P2
//==== SPEC: Tizen Web API:Content:Download:DownloadManager:resume M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
//==== ONLOAD_DELAY 90
//==== TEST_CRITERIA MMINA MAST MR
-var t = async_test("DownloadManager_resume", {timeout:90000}), downloadRequest = null,
+var t = async_test(document.title, {timeout: 90000}), downloadRequest = null,
downloadId, listener, flag = true, retValue = null;
setup({timeout: 90000});
t.step(function () {
onpaused: t.step_func(function (id) {
retValue = tizen.download.resume(downloadId);
}),
- oncanceled : t.step_func(function (id) {
+ oncanceled: t.step_func(function (id) {
assert_equals(retValue, undefined, "resume returns wrong value");
t.done();
}),
- oncompleted : t.step_func(function (id, path) {
+ oncompleted: t.step_func(function (id, path) {
assert_unreached("oncompleted should not be reached");
}),
- onfailed : t.step_func(function (id, error) {
+ onfailed: t.step_func(function (id, error) {
assert_unreached("onfailed should not be reached:: name: " + error.name + ", msg: " + error.message);
})
};
<html>
<head>
<title>DownloadManager_resume_exist</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadManager_resume_exist
-//==== LABEL: Check if resume method exists in DownloadManager.
+//==== LABEL Check if resume method exists in DownloadManager.
//==== PRIORITY: P1
//==== SPEC: Tizen Web API:Content:Download:DownloadManager:resume M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
test(function () {
assert_true("resume" in tizen.download, "resume method not exist");
check_method_exists(tizen.download, "resume");
-}, "DownloadManager_resume_exist");
+}, document.title);
</script>
</body>
<html>
<head>
<title>DownloadManager_setListener</title>
-<script src="../resources/unitcommon.js"></script>
-<script src="support/downloadcommon.js"></script>
+<script src="support/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadManager_setListener
-//==== LABEL: Check if setListener method with downloadId non-optional argument works
+//==== LABEL Check if setListener method with downloadId non-optional argument works
//==== PRIORITY: P2
//==== SPEC: Tizen Web API:Content:Download:DownloadManager:setListener M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
//==== ONLOAD_DELAY 90
//==== TEST_CRITERIA MMINA MAST MR
-var t = async_test("DownloadManager_setListener", {timeout:90000}), listener,
+var t = async_test(document.title, {timeout: 90000}), listener,
downloadRequest, downloadId, retValue = null;
setup({timeout: 90000});
t.step(function () {
listener = {
- onprogress : t.step_func(function (id, receivedSize, totalSize) {
+ onprogress: t.step_func(function (id, receivedSize, totalSize) {
}),
- onpaused : t.step_func(function (id) {
+ onpaused: t.step_func(function (id) {
assert_unreached("onpaused should not be reached");
}),
- oncanceled : t.step_func(function (id) {
+ oncanceled: t.step_func(function (id) {
assert_unreached("oncanceled should not be reached");
}),
- oncompleted : t.step_func(function (id, fullPath) {
+ oncompleted: t.step_func(function (id, fullPath) {
assert_equals(retValue, undefined, "setListener returns wrong value");
t.done();
}),
- onfailed : t.step_func(function (id, error) {
+ onfailed: t.step_func(function (id, error) {
assert_unreached("onfailed should not be reached:: name: " + error.name + ", msg: " + error.message);
})
};
<html>
<head>
<title>DownloadManager_setListener_downloadCallback_TypeMismatch</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadManager_setListener_downloadCallback_TypeMismatch
-//==== LABEL: Check argument downloadCallback conversions exception for setListener method.
+//==== LABEL Check argument downloadCallback conversions exception for setListener method.
//==== PRIORITY: P2
//==== ONLOAD_DELAY 90
//==== SPEC: Tizen Web API:Content:Download:DownloadManager:setListener M
setup({timeout: 90000});
-var t = async_test("DownloadManager_setListener_downloadCallback_TypeMismatch", {timeout: 90000}),
+var t = async_test(document.title, {timeout: 90000}),
downloadRequest, downloadId, listener, exceptionName, conversionTable, i;
t.step(function () {
downloadRequest = new tizen.DownloadRequest(url_small, "documents");
listener = conversionTable[i][0];
exceptionName = conversionTable[i][1];
- assert_throws({name : exceptionName},
+ assert_throws({name: exceptionName},
function () {
tizen.download.setListener(downloadId, listener);
}, exceptionName + " should be thrown - given incorrect listener.");
<html>
<head>
<title>DownloadManager_setListener_downloadCallback_invalid_cb</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadManager_setListener_downloadCallback_invalid_cb
-//==== LABEL: Check if setListener method throws exception when giving invalid listener.
+//==== LABEL Check if setListener method throws exception when giving invalid listener.
//==== PRIORITY: P2
//==== ONLOAD_DELAY 90
//==== SPEC: Tizen Web API:Content:Download:DownloadManager:setListener M
setup({timeout: 90000});
-var t = async_test("DownloadManager_setListener_downloadCallback_invalid_cb", {timeout:90000}),
+var t = async_test(document.title, {timeout: 90000}),
downloadRequest, downloadId, incorrectListeners, exceptionName, i, listener;
t.step(function () {
incorrectListeners = getListenerConversionExceptions(["onprogress",
listener = incorrectListeners[i][0];
exceptionName = incorrectListeners[i][1];
- assert_throws({name : exceptionName},
+ assert_throws({name: exceptionName},
function () {
tizen.download.setListener(downloadId, listener);
}, exceptionName + " should be thrown - given incorrect listener.");
<html>
<head>
<title>DownloadManager_setListener_exist</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadManager_setListener_exist
-//==== LABEL: Check if setListener method exists in DownloadManager.
+//==== LABEL Check if setListener method exists in DownloadManager.
//==== PRIORITY: P1
//==== SPEC: Tizen Web API:Content:Download:DownloadManager:setListener M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
test(function () {
assert_true("setListener" in tizen.download, "setListener method not exist");
check_method_exists(tizen.download, "setListener");
-}, "DownloadManager_setListener_exist");
+}, document.title);
</script>
</body>
<html>
<head>
<title>DownloadManager_setListener_missarg</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadManager_setListener_missarg
-//==== LABEL: Check if setListener method with missing non-optional argument throws exception
+//==== LABEL Check if setListener method with missing non-optional argument throws exception
//==== PRIORITY: P2
//==== SPEC: Tizen Web API:Content:Download:DownloadManager:setListener M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
//==== TEST_CRITERIA MMA
test(function () {
- assert_throws({name: TYPE_MISMATCH_ERR},
+ assert_throws(TYPE_MISMATCH_EXCEPTION,
function () {
tizen.download.setListener();
}, TYPE_MISMATCH_ERR + " exception should be thrown (given no nonoptional arguments).");
-}, "DownloadManager_setListener_missarg");
+}, document.title);
</script>
</body>
<html>
<head>
<title>DownloadManager_setListener_null</title>
-<script src="../resources/testharness.js"></script>
-<script src="../resources/testharnessreport.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
//==== TEST_CRITERIA MC
test(function () {
- assert_throws({name: "TypeMismatchError"},
+ assert_throws(TYPE_MISMATCH_EXCEPTION,
function () {
tizen.download.setListener(null, null);
}, "TypeMismatchError exception should be thrown (given null arguments).");
-}, "DownloadManager_setListener_null");
+}, document.title);
</script>
</body>
<html>
<head>
<title>DownloadManager_start</title>
-<script src="../resources/unitcommon.js"></script>
-<script src="support/downloadcommon.js"></script>
+<script src="support/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadManager_start
-//==== LABEL: Check if start method with downloadRequest non-optional argument works
+//==== LABEL Check if start method with downloadRequest non-optional argument works
//==== PRIORITY: P2
//==== SPEC: Tizen Web API:Content:Download:DownloadManager:start M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
assert_equals(DownloadRequest.url, url_small, "url should not change");
assert_equals(DownloadRequest.destination, destination, "destination should not change");
tizen.download.cancel(downloadId);
-}, "DownloadManager_start");
+}, document.title);
</script>
</body>
<html>
<head>
<title>DownloadManager_start_downloadCallback_TypeMismatch</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadManager_start_downloadCallback_TypeMismatch
-//==== LABEL: Check argument downloadCallback conversions exception for start method.
+//==== LABEL Check argument downloadCallback conversions exception for start method.
//==== PRIORITY: P2
//==== ONLOAD_DELAY 90
//==== SPEC: Tizen Web API:Content:Download:DownloadManager:start M
// DownloadManager_start_downloadCallback_TypeMismatch for start method.
setup({timeout: 90000});
-var t = async_test("DownloadManager_start_downloadCallback_TypeMismatch", {timeout: 90000}),
+var t = async_test(document.title, {timeout: 90000}),
downloadRequest, listener, exceptionName, conversionTable, i;
t.step(function () {
downloadRequest = new tizen.DownloadRequest(url_small, "documents");
listener = conversionTable[i][0];
exceptionName = conversionTable[i][1];
- assert_throws({name : exceptionName},
+ assert_throws({name: exceptionName},
function () {
tizen.download.start(downloadRequest, listener);
}, exceptionName + " should be thrown - given incorrect listener.");
<html>
<head>
<title>DownloadManager_start_downloadCallback_invalid_cb</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadManager_start_downloadCallback_invalid_cb
-//==== LABEL: Check if start method throws exception when giving invalid listener.
+//==== LABEL Check if start method throws exception when giving invalid listener.
//==== PRIORITY: P2
//==== SPEC: Tizen Web API:Content:Download:DownloadManager:start M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
//==== TEST_CRITERIA MTL
setup({timeout: 90000});
-var t = async_test("DownloadManager_start_downloadCallback_invalid_cb", {timeout:90000}),
+var t = async_test(document.title, {timeout: 90000}),
downloadRequest, incorrectListeners, exceptionName, i, listener;
t.step(function () {
incorrectListeners = getListenerConversionExceptions(["onprogress",
listener = incorrectListeners[i][0];
exceptionName = incorrectListeners[i][1];
- assert_throws({name : exceptionName},
+ assert_throws({name: exceptionName},
function () {
tizen.download.start(downloadRequest, listener);
}, exceptionName + " should be thrown - given incorrect listener.");
<html>
<head>
<title>DownloadManager_start_downloadRequest_TypeMismatch</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadManager_start_downloadRequest_TypeMismatch
-//==== LABEL: Check argument downloadRequest conversions exception.
+//==== LABEL Check argument downloadRequest conversions exception.
//==== PRIORITY: P2
//==== ONLOAD_DELAY 90
//==== SPEC: Tizen Web API:Content:Download:DownloadManager:start M
setup({timeout: 90000});
-var t = async_test("DownloadManager_start_downloadRequest_TypeMismatch", {timeout: 90000}),
+var t = async_test(document.title, {timeout: 90000}),
downloadRequest, exceptionName, conversionTable, i;
t.step(function () {
conversionTable = getTypeConversionExceptions("object", false);
downloadRequest = conversionTable[i][0];
exceptionName = conversionTable[i][1];
- assert_throws({name : exceptionName},
+ assert_throws({name: exceptionName},
function () {
tizen.download.start(downloadRequest);
}, exceptionName + " should be thrown - given incorrect downloadRequest.");
<html>
<head>
<title>DownloadManager_start_downloadRequest_invalid_obj</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadManager_start_downloadRequest_invalid_obj
-//==== LABEL: check if giving incorrect downloadRequest for setListener method throws exception
+//==== LABEL Check if giving incorrect downloadRequest for setListener method throws exception
//==== PRIORITY: P2
//==== ONLOAD_DELAY 90
//==== SPEC: Tizen Web API:Content:Download:DownloadManager:start M
setup({timeout: 90000});
-var t = async_test("DownloadManager_start_downloadRequest_invalid_obj", {timeout:90000}),
+var t = async_test(document.title, {timeout: 90000}),
downloadRequest, exceptionName = "TypeMismatchError";
t.step(function () {
downloadRequest = [];
downloadRequest[0] = {url: url_small, destination: "documents",
fileName: "file_name.png"};
- assert_throws({name : exceptionName},
+ assert_throws({name: exceptionName},
function () {
tizen.download.start(downloadRequest[0]);
}, exceptionName + " should be thrown - given incorrect downloadRequest.");
<html>
<head>
<title>DownloadManager_start_exist</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadManager_start_exist
-//==== LABEL: Check if start method exists in DownloadManager.
+//==== LABEL Check if start method exists in DownloadManager.
//==== PRIORITY: P1
//==== SPEC: Tizen Web API:Content:Download:DownloadManager:start M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
test(function () {
assert_true("start" in tizen.download, "start method not exist");
check_method_exists(tizen.download, "start");
-}, "DownloadManager_start_exist");
+}, document.title);
</script>
</body>
<html>
<head>
<title>DownloadManager_start_missarg</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadManager_start_missarg
-//==== LABEL: Check if start method with missing non-optional argument works
+//==== LABEL Check if start method with missing non-optional argument works
//==== PRIORITY: P2
//==== SPEC: Tizen Web API:Content:Download:DownloadManager:start M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
//==== TEST_CRITERIA MMA
test(function () {
- assert_throws({name: TYPE_MISMATCH_ERR},
+ assert_throws(TYPE_MISMATCH_EXCEPTION,
function () {
tizen.download.start();
}, TYPE_MISMATCH_ERR + " exception should be thrown (given no non-optional arguments).");
-}, "DownloadManager_start_missarg");
+}, document.title);
</script>
</body>
<html>
<head>
<title>DownloadManager_start_with_downloadCallback</title>
-<script src="../resources/unitcommon.js"></script>
-<script src="support/downloadcommon.js"></script>
+<script src="support/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadManager_start_with_downloadCallback
-//==== LABEL: Check if start method with downloadCallback optional argument works
+//==== LABEL Check if start method with downloadCallback optional argument works
//==== PRIORITY: P2
//==== SPEC: Tizen Web API:Content:Download:DownloadManager:start M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
//==== TEST_CRITERIA MOA MAST
setup({timeout: 90000});
-var t = async_test("DownloadManager_start_with_downloadCallback", {timeout:90000}),
+var t = async_test(document.title, {timeout: 90000}),
listener, destination = "documents", DownloadRequest;
t.step(function () {
listener = {
<head>
<title>DownloadManager_start_with_extra_argument</title>
<meta charset="utf-8">
-<script src="../resources/unitcommon.js"></script>
-<script src="support/downloadcommon.js"></script>
+<script src="support/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
</head>
<body>
<script type="text/javascript">
//==== TEST: DownloadManager_start_with_extra_argument
-//==== LABEL check whether 'start' method returns correct value when extra argument is given
+//==== LABEL Check whether 'start' method returns correct value when extra argument is given
//==== SPEC Tizen Web API:Content:Download:DownloadManager:start M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
//==== TEST_CRITERIA MOA MR
assert_less_than_equal(downloadId, 2147483647, "downloadId is not in range - upper limit");
}
-}, "DownloadManager_start_with_extra_argument");
+}, document.title);
</script>
</body>
<html>
<head>
<title>DownloadRequest_constructor</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadRequest_constructor
-//==== LABEL: check if the values of the attributes are equal to the arguments passed
+//==== LABEL Check if the values of the attributes are equal to the arguments passed
//==== PRIORITY: P1
//==== SPEC: Tizen Web API:Content:Download:DownloadRequest:constructor C
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
assert_equals(downloadRequest.url, url_small, "url should not change");
assert_equals(downloadRequest.destination, destination, "destination should not change");
assert_equals(downloadRequest.fileName, fileName, "fileName should not change");
-}, "DownloadRequest_constructor");
+}, document.title);
</script>
</body>
<html>
<head>
<title>DownloadRequest_destination_attribute</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script>
//==== TEST: DownloadRequest_destination_attribute
-//==== LABEL: check attribute destination
+//==== LABEL Check attribute destination
//==== PRIORITY: P1
//==== SPEC: Tizen Web API:Content:Download:DownloadRequest:destination A
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
var downloadRequest = null, default_val = "";
test(function () {
downloadRequest = new tizen.DownloadRequest(url_small);
- assert_true("destination" in downloadRequest,"destination not in downloadRequest");
+ assert_true("destination" in downloadRequest, "destination not in downloadRequest");
assert_equals(downloadRequest.destination, default_val, "Default value is incorrect");
check_attribute(downloadRequest, "destination", default_val, "string", "documents");
-}, "DownloadRequest_destination_attribute");
+}, document.title);
</script>
</body>
<html>
<head>
<title>DownloadRequest_exist</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: DownloadRequest_exist
-//==== LABEL: Test whether the constructor of the interface is defined or not for DownloadRequest.
+//==== LABEL Test whether the constructor of the interface is defined or not for DownloadRequest.
//==== PRIORITY: P0
//==== SPEC: Tizen Web API:Content:Download:DownloadRequest:constructor C
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
test(function () {
check_constructor("DownloadRequest");
-}, "DownloadRequest_exist");
+}, document.title);
</script>
</body>
<html>
<head>
<title>DownloadRequest_extend</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script>
//==== TEST: DownloadRequest_extend
-//==== LABEL: test whether the object can have new attribute added
+//==== LABEL Test whether the object can have new attribute added
//==== PRIORITY: P3
//==== SPEC: Tizen Web API:Content:Download:DownloadRequest:DownloadRequest U
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
test(function () {
downloadRequest = new tizen.DownloadRequest(url_small, "downloads", "file_name.html");
check_extensibility(downloadRequest);
-}, "DownloadRequest_extend");
+}, document.title);
</script>
</body>
<html>
<head>
<title>DownloadRequest_fileName_attribute</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script>
//==== TEST: DownloadRequest_fileName_attribute
-//==== LABEL: check fileName attribute
+//==== LABEL Check fileName attribute
//==== PRIORITY: P1
//==== SPEC: Tizen Web API:Content:Download:DownloadRequest:fileName A
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
var downloadRequest = null, default_val = "";
test(function () {
downloadRequest = new tizen.DownloadRequest(url_small, "documents");
- assert_true("fileName" in downloadRequest,"fileName is not in downloadRequest");
+ assert_true("fileName" in downloadRequest, "fileName is not in downloadRequest");
assert_equals(downloadRequest.fileName, default_val, "fileName should not change");
check_attribute(downloadRequest, "fileName", default_val, "string", "file_name.html");
-}, "DownloadRequest_fileName_attribute");
+}, document.title);
</script>
</body>
<html>
<head>
<title>DownloadRequest_httpHeader_attribute</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script>
//==== TEST: DownloadRequest_httpHeader_attribute
-//==== LABEL: check httpHeader attribute
+//==== LABEL Check httpHeader attribute
//==== PRIORITY: P1
//==== SPEC: Tizen Web API:Content:Download:DownloadRequest:httpHeader A
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
var downloadRequest = null;
test(function () {
downloadRequest = new tizen.DownloadRequest(url_small, "documents", "file_name.html");
- assert_true("httpHeader" in downloadRequest,"httpHeader not in downloadRequest");
+ assert_true("httpHeader" in downloadRequest, "httpHeader not in downloadRequest");
assert_type(downloadRequest.httpHeader, "object", "Type is incorrect");
assert_equals(Object.getOwnPropertyNames(downloadRequest.httpHeader).length, 0,
"httpHeader should be an empty object but has properties");
assert_equals(downloadRequest.httpHeader.Pragma, "no-cache", "Value is incorrect");
downloadRequest.httpHeader.Pragma = null;
assert_equals(downloadRequest.httpHeader.Pragma, null, "Value is incorrect");
-}, "DownloadRequest_httpHeader_attribute");
+}, document.title);
</script>
</body>
<html>
<head>
<title>DownloadRequest_networkType_attribute</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script>
//==== TEST: DownloadRequest_networkType_attribute
-//==== LABEL: check networkType attribute
+//==== LABEL Check networkType attribute
//==== PRIORITY: P1
//==== SPEC: Tizen Web API:Content:Download:DownloadRequest:networkType A
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
var downloadRequest = null;
test(function () {
downloadRequest = new tizen.DownloadRequest(url_small, "documents", "file_name.html");
- assert_true("networkType" in downloadRequest,"networkType not in downloadRequest");
+ assert_true("networkType" in downloadRequest, "networkType not in downloadRequest");
assert_equals(downloadRequest.networkType, "ALL", "Default value is incorrect");
downloadRequest.networkType = "WIFI";
assert_equals(downloadRequest.networkType, "WIFI", "Value is incorrect");
assert_equals(downloadRequest.networkType, null, "Value is incorrect");
downloadRequest.networkType = "TIZEN";
assert_equals(downloadRequest.networkType, null, "Value is incorrect");
-});
+}, document.title);
</script>
</body>
<html>
<head>
<title>DownloadRequest_url_attribute</title>
-<script src="support/downloadcommon.js"></script>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/download_common.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
<div id="log"></div>
<script>
//==== TEST: DownloadRequest_url_attribute
-//==== LABEL: check url attribute
+//==== LABEL Check url attribute
//==== PRIORITY: P1
//==== SPEC: Tizen Web API:Content:Download:DownloadRequest:url A
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/download.html
var downloadRequest = null, default_val = null;
test(function () {
downloadRequest = new tizen.DownloadRequest(url_small);
- assert_true("url" in downloadRequest,"url not in downloadRequest");
+ assert_true("url" in downloadRequest, "url not in downloadRequest");
default_val = url_small;
assert_equals(downloadRequest.url, default_val, "Default value is incorrect");
check_attribute(downloadRequest, "url", default_val, "string", "http://www.samsung.com/");
downloadRequest.url = null;
assert_not_equals(downloadRequest.url, null, "url should not be set to null");
-}, "DownloadRequest_url_attribute");
+}, document.title);
</script>
</body>
--- /dev/null
+/*
+
+Copyright (c) 2013 Samsung Electronics Co., Ltd.
+
+Licensed 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.
+
+
+
+Authors:
+
+*/
+
+function assert_type_if_valid(obj, type, msg) {
+ if(obj !== undefined) {
+ if(obj !== null) {
+ assert_equals(typeof(obj), type, msg);
+ return;
+ }
+ }
+}
+
+var TYPE_MISMATCH_ERR = 'TypeMismatchError';
+var INVALID_VALUES_ERR = 'InvalidValuesError';
+var NOT_SUPPORTED_ERR = 'NotSupportedError';
+var NOT_FOUND_ERR = 'NotFoundError';
+
+var url_large = "http://download.tizen.org/tct/2_1/webapi-tizen-download-test-image-hq.png";
+var url_small = "http://download.tizen.org/tct/2_1/webapi-tizen-download-test-image-lq.png";
+var url_broken = "http://download.tizen.org/tct/2_1/broken_file";
+++ /dev/null
-/*
-
-Copyright (c) 2013 Samsung Electronics Co., Ltd.
-
-Licensed 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.
-
-
-
-Authors:
-
-*/
-
-function assert_type_if_valid(obj, type, msg) {
- if(obj !== undefined) {
- if(obj !== null) {
- assert_equals(typeof(obj), type, msg);
- return;
- }
- }
-}
-
-var TYPE_MISMATCH_ERR = 'TypeMismatchError';
-var INVALID_VALUES_ERR = 'InvalidValuesError';
-var NOT_SUPPORTED_ERR = 'NotSupportedError';
-var NOT_FOUND_ERR = 'NotFoundError';
-
-var url_large = "http://download.tizen.org/tct/2_1/webapi-tizen-download-test-image-hq.png";
-var url_small = "http://download.tizen.org/tct/2_1/webapi-tizen-download-test-image-lq.png";
-var url_broken = "http://download.tizen.org/tct/2_1/broken_file";
--- /dev/null
+/*
+
+Copyright (c) 2013 Samsung Electronics Co., Ltd.
+
+Licensed 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.
+
+
+
+Authors:
+
+ */
+
+
+MIN_BYTE = -128;
+MAX_BYTE = 127;
+MIN_OCTET = 0;
+MAX_OCTET = 255;
+MIN_SHORT = -32768;
+MAX_SHORT = 32767;
+MIN_UNSIGNED_SHORT = 0;
+MAX_UNSIGNED_SHORT = 65535;
+MIN_LONG = -2147483648;
+MAX_LONG = 2147483647;
+MIN_UNSIGNED_LONG = 0;
+MAX_UNSIGNED_LONG = 4294967295;
+MIN_LONG_LONG = -9223372036854775808;
+MAX_LONG_LONG = 9223372036854775807;
+MIN_UNSIGNED_LONG_LONG = 0;
+MAX_UNSIGNED_LONG_LONG = 18446744073709551615;
+
+TYPE_MISMATCH_EXCEPTION = {name: 'TypeMismatchError'};
+NOT_FOUND_EXCEPTION = {name: 'NotFoundError'};
+INVALID_VALUES_EXCEPTION = {name: 'InvalidValuesError'};
+IO_EXCEPTION = {name: 'IOError'};
+SECURITY_EXCEPTION = {name: 'SecurityError'};
+
+
+(function () {
+ var head_src = document.head.innerHTML;
+ if (head_src.search(/\/testharness.js\W/) === -1) {
+ document.write('<script language="javascript" src="../resources/testharness.js"></script>\n');
+ }
+ if (head_src.search(/\/testharnessreport.js\W/) === -1) {
+ document.write('<script language="javascript" src="../resources/testharnessreport.js"></script>\n');
+ }
+})();
+
+var _registered_types = {};
+
+function _resolve_registered_type(type) {
+ while (type in _registered_types) {
+ type = _registered_types[type];
+ }
+ return type;
+}
+
+/**
+ * Method checks extra argument for none argument method.
+ * The only check is that method will not throw an exception.
+ * Example usage:
+ * checkExtraArgument(tizen.notification, "removeAll");
+ *
+ * @param object object
+ * @param methodName string - name of the method
+ */
+function checkExtraArgument(object, methodName) {
+ var extraArgument = [
+ null,
+ undefined,
+ "Tizen",
+ 1,
+ false,
+ ["one", "two"],
+ {argument: 1},
+ function () {}
+ ], i;
+
+ for (i = 0; i < extraArgument.length; i++) {
+ object[methodName](extraArgument[i]);
+ }
+}
+
+/**
+ * Method to validate conversion.
+ * Example usage:
+ * conversionTable = getTypeConversionExceptions("functionObject", true);
+ * for(i = 0; i < conversionTable.length; i++) {
+ * errorCallback = conversionTable[i][0];
+ * exceptionName = conversionTable[i][1];
+ *
+ * assert_throws({name : exceptionName},
+ * function () {
+ * tizen.systemsetting.setProperty("HOME_SCREEN",
+ * propertyValue, successCallback, errorCallback);
+ * }, exceptionName + " should be thrown - given incorrect errorCallback.");
+ * }
+ *
+ * @param conversionType
+ * @param isOptional
+ * @returns table of tables which contain value (index 0) and exceptionName (index 1)
+ *
+ */
+function getTypeConversionExceptions(conversionType, isOptional) {
+ var exceptionName = "TypeMismatchError",
+ conversionTable;
+ switch (conversionType) {
+ case "enum":
+ conversionTable = [
+ [undefined, exceptionName],
+ [null, exceptionName],
+ [0, exceptionName],
+ [true, exceptionName],
+ ["dummyInvalidEnumValue", exceptionName],
+ [{ }, exceptionName]
+ ];
+ break;
+ case "double":
+ conversionTable = [
+ [undefined, exceptionName],
+ [NaN, exceptionName],
+ [Number.POSITIVE_INFINITY, exceptionName],
+ [Number.NEGATIVE_INFINITY, exceptionName],
+ ["TIZEN", exceptionName],
+ [{ name : "TIZEN" }, exceptionName],
+ [function () { }, exceptionName]
+ ];
+ break;
+ case "object":
+ conversionTable = [
+ [true, exceptionName],
+ [false, exceptionName],
+ [NaN, exceptionName],
+ [0, exceptionName],
+ ["", exceptionName],
+ ["TIZEN", exceptionName],
+ [undefined, exceptionName]
+ ];
+ if (!isOptional) {
+ conversionTable.push([null, exceptionName]);
+ }
+ break;
+ case "functionObject":
+ conversionTable = [
+ [true, exceptionName],
+ [false, exceptionName],
+ [NaN, exceptionName],
+ [0, exceptionName],
+ ["", exceptionName],
+ ["TIZEN", exceptionName],
+ [[], exceptionName],
+ [{ }, exceptionName],
+ [undefined, exceptionName]
+ ];
+ if (!isOptional) {
+ conversionTable.push([null, exceptionName]);
+ }
+ break;
+ case "array":
+ conversionTable = [
+ [true, exceptionName],
+ [false, exceptionName],
+ [NaN, exceptionName],
+ [0, exceptionName],
+ ["", exceptionName],
+ ["TIZEN", exceptionName],
+ [{ }, exceptionName],
+ [function () { }, exceptionName],
+ [undefined, exceptionName]
+ ];
+ if (!isOptional) {
+ conversionTable.push([null, exceptionName]);
+ }
+ break;
+ case "dictionary":
+ conversionTable = [
+ [true, exceptionName],
+ [false, exceptionName],
+ [NaN, exceptionName],
+ [0, exceptionName],
+ ["", exceptionName],
+ ["TIZEN", exceptionName],
+ [undefined, exceptionName]
+ ];
+ if (!isOptional) {
+ conversionTable.push([null, exceptionName]);
+ }
+ break;
+ default:
+ assert_unreached("Fix your test. Wrong conversionType '" + conversionType + "'.");
+ };
+
+ return conversionTable;
+}
+
+
+function assert_type(obj, type, description) {
+ var org_type = type, prop_name, prop_type, prop_value;
+
+ type = _resolve_registered_type(type);
+
+ if (typeof (type) === 'string') {
+ type = type.toLowerCase();
+ switch (type) {
+ case 'object':
+ case 'string':
+ case 'number':
+ case 'function':
+ case 'boolean':
+ case 'undefined':
+ case 'xml':
+ assert_equals(typeof (obj), type, description);
+ break;
+ case 'null':
+ assert_true(obj === null, description);
+ break;
+ case 'array':
+ assert_true(Array.isArray(obj), description);
+ break;
+ case 'date':
+ assert_true(obj instanceof Date, description);
+ break;
+ case 'byte':
+ assert_equals(typeof (obj), 'number', description);
+ assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low.");
+ assert_less_than_equal(obj, MAX_BYTE, description + " - value too high.");
+ assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer.");
+ break;
+ case 'octet':
+ assert_equals(typeof (obj), 'number', description);
+ assert_greater_than_equal(obj, MIN_OCTET, description + " - value too low.");
+ assert_less_than_equal(obj, MAX_OCTET, description + " - value too high.");
+ assert_equals(obj % 1, 0, description + " - value is not an integer.");
+ break;
+ case 'short':
+ assert_equals(typeof (obj), 'number', description);
+ assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low.");
+ assert_less_than_equal(obj, MAX_SHORT, description + " - value too high.");
+ assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer.");
+ break;
+ case 'unsigned short':
+ assert_equals(typeof (obj), 'number', description);
+ assert_greater_than_equal(obj, MIN_UNSIGNED_SHORT, description + " - value too low.");
+ assert_less_than_equal(obj, MAX_UNSIGNED_SHORT, description + " - value too high.");
+ assert_equals(obj % 1, 0, description + " - value is not an integer.");
+ break;
+ case 'long':
+ assert_equals(typeof (obj), 'number', description);
+ assert_greater_than_equal(obj, MIN_LONG, description + " - value too low.");
+ assert_less_than_equal(obj, MAX_LONG, description + " - value too high.");
+ assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer.");
+ break;
+ case 'unsigned long':
+ assert_equals(typeof (obj), 'number', description);
+ assert_greater_than_equal(obj, MIN_UNSIGNED_LONG, description + " - value too low.");
+ assert_less_than_equal(obj, MAX_UNSIGNED_LONG, description + " - value too high.");
+ assert_equals(obj % 1, 0, description + " - value is not an integer.");
+ break;
+ case 'long long':
+ assert_equals(typeof (obj), 'number', description);
+ assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low.");
+ assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high.");
+ assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer.");
+ break;
+ case 'unsigned long long':
+ assert_equals(typeof (obj), 'number', description);
+ assert_greater_than_equal(obj, MIN_UNSIGNED_LONG_LONG, description + " - value too low.");
+ assert_less_than_equal(obj, MAX_UNSIGNED_LONG_LONG, description + " - value too high.");
+ assert_equals(obj % 1, 0, description + " - value is not an integer.");
+ break;
+ default:
+ assert_unreached('Fix your test. Wrong type \'' + org_type + '\'');
+ }
+ } else if (typeof (type) === 'function') {
+ assert_true(obj instanceof type, description);
+ } else if (typeof (type) === 'object') {
+ for (prop_name in type) {
+ prop_type = type[prop_name];
+ if (prop_type === 'function') {
+ assert_inherits(obj, prop_name);
+ assert_equals(typeof obj[prop_name], prop_type, 'Object should have method ' + prop_name);
+ } else {
+ assert_own_property(obj, prop_name);
+ }
+ }
+ } else {
+ assert_unreached('Fix your test. Wrong type ' + org_type);
+ }
+}
+
+function register_type(alias, type_spec) {
+ _registered_types[alias] = type_spec;
+}
+
+/**
+ * Method to check if attribute is const.
+ * Example usage:
+ * check_const(tizen.bluetooth.deviceMinor, 'TOY_DOLL', 0x03, 'number', 0x29B);
+ *
+ * @param obj object to test which has const attribute
+ * @param attributeName attribute name.
+ * @param expectedValue expected value of provided attribute name
+ * @param expectedType expected type of provided attribute name
+ * @param valueToAssign value to assign in order to check if attribute value can be modified
+ */
+function check_const(obj, attributeName, expectedValue, expectedType, valueToAssign) {
+ var tmp;
+ if (expectedValue === valueToAssign) {
+ assert_unreached("Fix your test. The same values given for " + attributeName +
+ " in 'value' and 'valueToSet' arguments.");
+ }
+ if (typeof (attributeName) === "string") {
+ assert_true(attributeName in obj, "Name " + attributeName + " doesn't exist in provided object.");
+ assert_equals(obj[attributeName], expectedValue, "Value of " + attributeName + " is diffrent.");
+ if (typeof (expectedType) !== "undefined") {
+ if (expectedValue === null) {
+ assert_type(obj[attributeName], "object", "Type of " + attributeName + " is different.");
+ } else {
+ assert_type(obj[attributeName], expectedType, "Type of " + attributeName + " is different.");
+ }
+ } else {
+ assert_unreached("Fix your test. Wrong type " + expectedType);
+ }
+ tmp = obj[attributeName];
+ obj[attributeName] = valueToAssign;
+ assert_equals(obj[attributeName], tmp, attributeName + " can be modified.");
+ } else {
+ assert_unreached("Fix your test. Wrong type of name " + typeof (attributeName));
+ }
+}
+
+/**
+ * Method to check if attribute is readonly.
+ * Example usage:
+ * check_readonly(statusNotification, "postedTime", null, 'object', new Date());
+ *
+ * @param obj object to test which has readonly attribute
+ * @param attributeName attribute name.
+ * @param expectedValue expected value of provided attribute name
+ * @param expectedType expected type of provided attribute name
+ * @param valueToAssign value to assign in order to check if attribute value can be modified
+ */
+function check_readonly(obj, attributeName, expectedValue, expectedType, valueToAssign) {
+ check_const(obj, attributeName, expectedValue, expectedType, valueToAssign);
+}
+
+/**
+ * Method to check if attribute can be set to null.
+ * Example usage:
+ * check_not_nullable(syncInfo, "mode");
+ *
+ * @param obj object to test which has not nullable attribute
+ * @param attributeName attribute name.
+ */
+function check_not_nullable(obj, attributeName)
+{ var old_value = obj[attributeName];
+ obj[attributeName] = null;
+ assert_not_equals(obj[attributeName], null, "Attribute " + attributeName + " can be set to null.");
+ obj[attributeName] = old_value;
+}
+
+/**
+ * Method to check NoInterfaceObject
+ * Example usage:
+ * check_no_interface_object("BluetoothAdapter")
+ *
+ * @param interfaceName interface name
+ */
+function check_no_interface_object(interfaceName) {
+ assert_throws({name: "TypeError"}, function () {
+ tizen[interfaceName]();
+ },"Wrong call as a function");
+ assert_throws({name: "TypeError"}, function () {
+ new tizen[interfaceName]();
+ },"Wrong call as a new function");
+ assert_throws({name: "TypeError"}, function () {
+ ({}) instanceof tizen[interfaceName];
+ },"instanceof exception");
+ assert_equals(tizen[interfaceName], undefined, interfaceName + " is not undefined.");
+}
+
+
+/**
+ * Method to check Constructors
+ * Example usage:
+ * check_constructor("BluetoothAdapter")
+ *
+ * @param constructorName constructor name
+ */
+
+function check_constructor(constructorName) {
+ assert_true(constructorName in tizen, "No " + constructorName + " in tizen.");
+ assert_false({} instanceof tizen[constructorName],"Custom object is not instance of " + constructorName);
+ assert_throws({
+ name: "TypeError"
+ }, function () {
+ tizen[constructorName]();
+ }, "Constructor called as function.");
+}
+
+/**
+ * Method to check if given method can be overridden in a given object - (TEMPORARY REMOVED).
+ * That method also checks if given method exists in a given object.
+ * Example usage:
+ * check_method_exists(tizen.notification, "get");
+ *
+ * @param obj object with method
+ * @param methodName name of the method to check.
+ */
+function check_method_exists(obj, methodName) {
+ assert_type(obj[methodName], 'function', "Method does not exist.");
+}
+
+/**
+ * Method to check extensibility of given object.
+ * Method checks if new attribute and method can be added.
+ * Example usage:
+ * check_extensibility(tizen.notification);
+ *
+ * @param obj object to check
+ */
+function check_extensibility(obj) {
+ var dummyAttribute = "dummyAttributeValue", dummyMethodResult = "dummyMethodResultValue";
+ obj.newDummyMethod = function() {
+ return dummyMethodResult;
+ }
+ assert_equals(obj.newDummyMethod(), dummyMethodResult, "Incorrect result from added method.");
+
+ obj.newDummyAttribute = dummyAttribute;
+ assert_equals(obj.newDummyAttribute, dummyAttribute, "Incorrect result from added attribute.");
+}
+
+/**
+ * Method to check if attribute can be modify.
+ * Example usage:
+ * check_attr(downloadRequest, "fileName", default_val, "string", "file_name.html");
+ *
+ * @param obj object to test which has not readonly attribute
+ * @param attributeName attribute name.
+ * @param expectedValue expected value of provided attribute name
+ * @param expectedType expected type of provided attribute name
+ * @param valueToAssign value to assign in order to check if attribute value can be modified
+ */
+function check_attribute(obj, attributeName, expectedValue, expectedType, valueToAssign) {
+ if (expectedValue === valueToAssign) {
+ assert_unreached("Fix your test. The same values given for " + attributeName +
+ " in 'value' and 'valueToSet' arguments.");
+ }
+ if (typeof (attributeName) === "string") {
+ assert_true(attributeName in obj, "Name " + attributeName + " doesn't exist in provided object.");
+ assert_equals(obj[attributeName], expectedValue, "Value of " + attributeName + " is diffrent.");
+ if (typeof (expectedType) !== "undefined") {
+ if (expectedValue === null) {
+ assert_type(obj[attributeName], "object", "Type of " + attributeName + " is different.");
+ } else {
+ assert_type(obj[attributeName], expectedType, "Type of " + attributeName + " is different.");
+ }
+ } else {
+ assert_unreached("Fix your test. Wrong type " + expectedType);
+ }
+ obj[attributeName] = valueToAssign;
+ assert_equals(obj[attributeName], valueToAssign, attributeName + " can be modified.");
+ } else {
+ assert_unreached("Fix your test. Wrong type of name " + typeof (attributeName));
+ }
+}
+
+/**
+ * Method to check if whole array can be overwritten with an invalid value.
+ * Sample usage:
+ * check_invalid_array_assignments(message, "to", false);
+ *
+ * @param obj object which has the array as its property
+ * @param array name of the array to check
+ * @param isNullable indicates if the array can be null
+ */
+function check_invalid_array_assignments(obj, array, isNullable) {
+ var args = [undefined, true, false, NaN, 0, "TIZEN", {}, function () {}],
+ val = obj[array], i;
+
+ if (!isNullable) {
+ obj[array] = null;
+ assert_not_equals(obj[array], null, "Non-nullable array was set to null");
+ assert_type(obj[array], "array", "Non-nullable array type changed after assigning null");
+ assert_equals(obj[array].toString(), val.toString(), "Non-nullable array contents changed after assigning null");
+ }
+
+ for (i = 0 ; i < args.length ; i++) {
+ obj[array] = args[i];
+ assert_type(obj[array], "array", "Array type changed after assigning an invalid value");
+ assert_equals(obj[array].toString(), val.toString(), "Array contents changed after assigning an invalid value");
+ }
+}
+
+/**
+ * Method to check if an object can be overwritten with an invalid value.
+ * Sample usage:
+ * check_invalid_object_assignments(message, "body", false);
+ *
+ * @param parentObj object which has the 'obj' object as its property
+ * @param obj name of the object to check
+ * @param isNullable indicates if the object can be null
+ */
+function check_invalid_obj_assignments(parentObj, obj, isNullable) {
+ var args = [undefined, true, false, NaN, 0, "TIZEN", function () {}],
+ val = parentObj[obj], i;
+
+ if (!isNullable) {
+ parentObj[obj] = null;
+ assert_equals(parentObj[obj], val, "Non-nullable obj was modified after assigning null");
+ }
+
+ for (i = 0 ; i < args.length ; i++) {
+ parentObj[obj] = args[i];
+ assert_equals(parentObj[obj], val, "The object was set to " + args[i]);
+ }
+}
+
+/**
+ * Method to validate conversion for listeners.
+ * Example usage:
+ * incorrectListeners = getListenerConversionExceptions(["oninstalled", "onupdated", "onuninstalled"]);
+ * for(i = 0; i < incorrectListeners.length; i++) {
+ * packageInformationEventCallback = incorrectListeners[i][0];
+ * exceptionName = incorrectListeners[i][1];
+ * assert_throws({name : exceptionName},
+ * function () {
+ * tizen.package.setPackageInfoEventListener(packageInformationEventCallback);
+ * }, exceptionName + " should be thrown - given incorrect successCallback.");
+ * }
+ *
+ *
+ * @param callbackNames Array with names
+ * @returns {Array} table of tables which contain incorrect listener (index 0) and exceptionName (index 1)
+ *
+ */
+function getListenerConversionExceptions(callbackNames) {
+ var result = [], conversionTable, i, j, listenerName;
+ conversionTable = getTypeConversionExceptions("functionObject", false);
+
+ for (i = 0; i < callbackNames.length; i++) {
+ for (j = 0; j < conversionTable.length; j++) {
+ listenerName = {};
+ listenerName[callbackNames[i]] = conversionTable[j][0];
+ result.push([listenerName, conversionTable[j][1]]);
+ }
+ }
+
+ return result;
+}
+++ /dev/null
-/*
-
-Copyright (c) 2013 Samsung Electronics Co., Ltd.
-
-Licensed 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.
-
-
-
-Authors:
-
- */
-
-
-MIN_BYTE = -128;
-MAX_BYTE = 127;
-MIN_OCTET = 0;
-MAX_OCTET = 255;
-MIN_SHORT = -32768;
-MAX_SHORT = 32767;
-MIN_UNSIGNED_SHORT = 0;
-MAX_UNSIGNED_SHORT = 65535;
-MIN_LONG = -2147483648;
-MAX_LONG = 2147483647;
-MIN_UNSIGNED_LONG = 0;
-MAX_UNSIGNED_LONG = 4294967295;
-MIN_LONG_LONG = -9223372036854775808;
-MAX_LONG_LONG = 9223372036854775807;
-MIN_UNSIGNED_LONG_LONG = 0;
-MAX_UNSIGNED_LONG_LONG = 18446744073709551615;
-
-TYPE_MISMATCH_EXCEPTION = {name: 'TypeMismatchError'};
-NOT_FOUND_EXCEPTION = {name: 'NotFoundError'};
-INVALID_VALUES_EXCEPTION = {name: 'InvalidValuesError'};
-IO_EXCEPTION = {name: 'IOError'};
-SECURITY_EXCEPTION = {name: 'SecurityError'};
-
-
-(function () {
- var head_src = document.head.innerHTML;
- if (head_src.search(/\/testharness.js\W/) === -1) {
- document.write('<script language="javascript" src="../resources/testharness.js"></script>\n');
- }
- if (head_src.search(/\/testharnessreport.js\W/) === -1) {
- document.write('<script language="javascript" src="../resources/testharnessreport.js"></script>\n');
- }
-})();
-
-var _registered_types = {};
-
-function _resolve_registered_type(type) {
- while (type in _registered_types) {
- type = _registered_types[type];
- }
- return type;
-}
-
-/**
- * Method checks extra argument for none argument method.
- * The only check is that method will not throw an exception.
- * Example usage:
- * checkExtraArgument(tizen.notification, "removeAll");
- *
- * @param object object
- * @param methodName string - name of the method
- */
-function checkExtraArgument(object, methodName) {
- var extraArgument = [
- null,
- undefined,
- "Tizen",
- 1,
- false,
- ["one", "two"],
- {argument: 1},
- function () {}
- ], i;
-
- for (i = 0; i < extraArgument.length; i++) {
- object[methodName](extraArgument[i]);
- }
-}
-
-/**
- * Method to validate conversion.
- * Example usage:
- * conversionTable = getTypeConversionExceptions("functionObject", true);
- * for(i = 0; i < conversionTable.length; i++) {
- * errorCallback = conversionTable[i][0];
- * exceptionName = conversionTable[i][1];
- *
- * assert_throws({name : exceptionName},
- * function () {
- * tizen.systemsetting.setProperty("HOME_SCREEN",
- * propertyValue, successCallback, errorCallback);
- * }, exceptionName + " should be thrown - given incorrect errorCallback.");
- * }
- *
- * @param conversionType
- * @param isOptional
- * @returns table of tables which contain value (index 0) and exceptionName (index 1)
- *
- */
-function getTypeConversionExceptions(conversionType, isOptional) {
- var exceptionName = "TypeMismatchError",
- conversionTable;
- switch (conversionType) {
- case "enum":
- conversionTable = [
- [undefined, exceptionName],
- [null, exceptionName],
- [0, exceptionName],
- [true, exceptionName],
- ["dummyInvalidEnumValue", exceptionName],
- [{ }, exceptionName]
- ];
- break;
- case "double":
- conversionTable = [
- [undefined, exceptionName],
- [NaN, exceptionName],
- [Number.POSITIVE_INFINITY, exceptionName],
- [Number.NEGATIVE_INFINITY, exceptionName],
- ["TIZEN", exceptionName],
- [{ name : "TIZEN" }, exceptionName],
- [function () { }, exceptionName]
- ];
- break;
- case "object":
- conversionTable = [
- [true, exceptionName],
- [false, exceptionName],
- [NaN, exceptionName],
- [0, exceptionName],
- ["", exceptionName],
- ["TIZEN", exceptionName],
- [undefined, exceptionName]
- ];
- if (!isOptional) {
- conversionTable.push([null, exceptionName]);
- }
- break;
- case "functionObject":
- conversionTable = [
- [true, exceptionName],
- [false, exceptionName],
- [NaN, exceptionName],
- [0, exceptionName],
- ["", exceptionName],
- ["TIZEN", exceptionName],
- [[], exceptionName],
- [{ }, exceptionName],
- [undefined, exceptionName]
- ];
- if (!isOptional) {
- conversionTable.push([null, exceptionName]);
- }
- break;
- case "array":
- conversionTable = [
- [true, exceptionName],
- [false, exceptionName],
- [NaN, exceptionName],
- [0, exceptionName],
- ["", exceptionName],
- ["TIZEN", exceptionName],
- [{ }, exceptionName],
- [function () { }, exceptionName],
- [undefined, exceptionName]
- ];
- if (!isOptional) {
- conversionTable.push([null, exceptionName]);
- }
- break;
- case "dictionary":
- conversionTable = [
- [true, exceptionName],
- [false, exceptionName],
- [NaN, exceptionName],
- [0, exceptionName],
- ["", exceptionName],
- ["TIZEN", exceptionName],
- [undefined, exceptionName]
- ];
- if (!isOptional) {
- conversionTable.push([null, exceptionName]);
- }
- break;
- default:
- assert_unreached("Fix your test. Wrong conversionType '" + conversionType + "'.");
- };
-
- return conversionTable;
-}
-
-
-function assert_type(obj, type, description) {
- var org_type = type, prop_name, prop_type, prop_value;
-
- type = _resolve_registered_type(type);
-
- if (typeof (type) === 'string') {
- type = type.toLowerCase();
- switch (type) {
- case 'object':
- case 'string':
- case 'number':
- case 'function':
- case 'boolean':
- case 'undefined':
- case 'xml':
- assert_equals(typeof (obj), type, description);
- break;
- case 'null':
- assert_true(obj === null, description);
- break;
- case 'array':
- assert_true(Array.isArray(obj), description);
- break;
- case 'date':
- assert_true(obj instanceof Date, description);
- break;
- case 'byte':
- assert_equals(typeof (obj), 'number', description);
- assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low.");
- assert_less_than_equal(obj, MAX_BYTE, description + " - value too high.");
- assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer.");
- break;
- case 'octet':
- assert_equals(typeof (obj), 'number', description);
- assert_greater_than_equal(obj, MIN_OCTET, description + " - value too low.");
- assert_less_than_equal(obj, MAX_OCTET, description + " - value too high.");
- assert_equals(obj % 1, 0, description + " - value is not an integer.");
- break;
- case 'short':
- assert_equals(typeof (obj), 'number', description);
- assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low.");
- assert_less_than_equal(obj, MAX_SHORT, description + " - value too high.");
- assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer.");
- break;
- case 'unsigned short':
- assert_equals(typeof (obj), 'number', description);
- assert_greater_than_equal(obj, MIN_UNSIGNED_SHORT, description + " - value too low.");
- assert_less_than_equal(obj, MAX_UNSIGNED_SHORT, description + " - value too high.");
- assert_equals(obj % 1, 0, description + " - value is not an integer.");
- break;
- case 'long':
- assert_equals(typeof (obj), 'number', description);
- assert_greater_than_equal(obj, MIN_LONG, description + " - value too low.");
- assert_less_than_equal(obj, MAX_LONG, description + " - value too high.");
- assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer.");
- break;
- case 'unsigned long':
- assert_equals(typeof (obj), 'number', description);
- assert_greater_than_equal(obj, MIN_UNSIGNED_LONG, description + " - value too low.");
- assert_less_than_equal(obj, MAX_UNSIGNED_LONG, description + " - value too high.");
- assert_equals(obj % 1, 0, description + " - value is not an integer.");
- break;
- case 'long long':
- assert_equals(typeof (obj), 'number', description);
- assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low.");
- assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high.");
- assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer.");
- break;
- case 'unsigned long long':
- assert_equals(typeof (obj), 'number', description);
- assert_greater_than_equal(obj, MIN_UNSIGNED_LONG_LONG, description + " - value too low.");
- assert_less_than_equal(obj, MAX_UNSIGNED_LONG_LONG, description + " - value too high.");
- assert_equals(obj % 1, 0, description + " - value is not an integer.");
- break;
- default:
- assert_unreached('Fix your test. Wrong type \'' + org_type + '\'');
- }
- } else if (typeof (type) === 'function') {
- assert_true(obj instanceof type, description);
- } else if (typeof (type) === 'object') {
- for (prop_name in type) {
- prop_type = type[prop_name];
- if (prop_type === 'function') {
- assert_inherits(obj, prop_name);
- assert_equals(typeof obj[prop_name], prop_type, 'Object should have method ' + prop_name);
- } else {
- assert_own_property(obj, prop_name);
- }
- }
- } else {
- assert_unreached('Fix your test. Wrong type ' + org_type);
- }
-}
-
-function register_type(alias, type_spec) {
- _registered_types[alias] = type_spec;
-}
-
-/**
- * Method to check if attribute is const.
- * Example usage:
- * check_const(tizen.bluetooth.deviceMinor, 'TOY_DOLL', 0x03, 'number', 0x29B);
- *
- * @param obj object to test which has const attribute
- * @param attributeName attribute name.
- * @param expectedValue expected value of provided attribute name
- * @param expectedType expected type of provided attribute name
- * @param valueToAssign value to assign in order to check if attribute value can be modified
- */
-function check_const(obj, attributeName, expectedValue, expectedType, valueToAssign) {
- var tmp;
- if (expectedValue === valueToAssign) {
- assert_unreached("Fix your test. The same values given for " + attributeName +
- " in 'value' and 'valueToSet' arguments.");
- }
- if (typeof (attributeName) === "string") {
- assert_true(attributeName in obj, "Name " + attributeName + " doesn't exist in provided object.");
- assert_equals(obj[attributeName], expectedValue, "Value of " + attributeName + " is diffrent.");
- if (typeof (expectedType) !== "undefined") {
- if (expectedValue === null) {
- assert_type(obj[attributeName], "object", "Type of " + attributeName + " is different.");
- } else {
- assert_type(obj[attributeName], expectedType, "Type of " + attributeName + " is different.");
- }
- } else {
- assert_unreached("Fix your test. Wrong type " + expectedType);
- }
- tmp = obj[attributeName];
- obj[attributeName] = valueToAssign;
- assert_equals(obj[attributeName], tmp, attributeName + " can be modified.");
- } else {
- assert_unreached("Fix your test. Wrong type of name " + typeof (attributeName));
- }
-}
-
-/**
- * Method to check if attribute is readonly.
- * Example usage:
- * check_readonly(statusNotification, "postedTime", null, 'object', new Date());
- *
- * @param obj object to test which has readonly attribute
- * @param attributeName attribute name.
- * @param expectedValue expected value of provided attribute name
- * @param expectedType expected type of provided attribute name
- * @param valueToAssign value to assign in order to check if attribute value can be modified
- */
-function check_readonly(obj, attributeName, expectedValue, expectedType, valueToAssign) {
- check_const(obj, attributeName, expectedValue, expectedType, valueToAssign);
-}
-
-/**
- * Method to check if attribute can be set to null.
- * Example usage:
- * check_not_nullable(syncInfo, "mode");
- *
- * @param obj object to test which has not nullable attribute
- * @param attributeName attribute name.
- */
-function check_not_nullable(obj, attributeName)
-{ var old_value = obj[attributeName];
- obj[attributeName] = null;
- assert_not_equals(obj[attributeName], null, "Attribute " + attributeName + " can be set to null.");
- obj[attributeName] = old_value;
-}
-
-/**
- * Method to check NoInterfaceObject
- * Example usage:
- * check_no_interface_object("BluetoothAdapter")
- *
- * @param interfaceName interface name
- */
-function check_no_interface_object(interfaceName) {
- assert_throws({name: "TypeError"}, function () {
- tizen[interfaceName]();
- },"Wrong call as a function");
- assert_throws({name: "TypeError"}, function () {
- new tizen[interfaceName]();
- },"Wrong call as a new function");
- assert_throws({name: "TypeError"}, function () {
- ({}) instanceof tizen[interfaceName];
- },"instanceof exception");
- assert_equals(tizen[interfaceName], undefined, interfaceName + " is not undefined.");
-}
-
-
-/**
- * Method to check Constructors
- * Example usage:
- * check_constructor("BluetoothAdapter")
- *
- * @param constructorName constructor name
- */
-
-function check_constructor(constructorName) {
- assert_true(constructorName in tizen, "No " + constructorName + " in tizen.");
- assert_false({} instanceof tizen[constructorName],"Custom object is not instance of " + constructorName);
- assert_throws({
- name: "TypeError"
- }, function () {
- tizen[constructorName]();
- }, "Constructor called as function.");
-}
-
-/**
- * Method to check if given method can be overridden in a given object - (TEMPORARY REMOVED).
- * That method also checks if given method exists in a given object.
- * Example usage:
- * check_method_exists(tizen.notification, "get");
- *
- * @param obj object with method
- * @param methodName name of the method to check.
- */
-function check_method_exists(obj, methodName) {
- assert_type(obj[methodName], 'function', "Method does not exist.");
-}
-
-/**
- * Method to check extensibility of given object.
- * Method checks if new attribute and method can be added.
- * Example usage:
- * check_extensibility(tizen.notification);
- *
- * @param obj object to check
- */
-function check_extensibility(obj) {
- var dummyAttribute = "dummyAttributeValue", dummyMethodResult = "dummyMethodResultValue";
- obj.newDummyMethod = function() {
- return dummyMethodResult;
- }
- assert_equals(obj.newDummyMethod(), dummyMethodResult, "Incorrect result from added method.");
-
- obj.newDummyAttribute = dummyAttribute;
- assert_equals(obj.newDummyAttribute, dummyAttribute, "Incorrect result from added attribute.");
-}
-
-/**
- * Method to check if attribute can be modify.
- * Example usage:
- * check_attr(downloadRequest, "fileName", default_val, "string", "file_name.html");
- *
- * @param obj object to test which has not readonly attribute
- * @param attributeName attribute name.
- * @param expectedValue expected value of provided attribute name
- * @param expectedType expected type of provided attribute name
- * @param valueToAssign value to assign in order to check if attribute value can be modified
- */
-function check_attribute(obj, attributeName, expectedValue, expectedType, valueToAssign) {
- if (expectedValue === valueToAssign) {
- assert_unreached("Fix your test. The same values given for " + attributeName +
- " in 'value' and 'valueToSet' arguments.");
- }
- if (typeof (attributeName) === "string") {
- assert_true(attributeName in obj, "Name " + attributeName + " doesn't exist in provided object.");
- assert_equals(obj[attributeName], expectedValue, "Value of " + attributeName + " is diffrent.");
- if (typeof (expectedType) !== "undefined") {
- if (expectedValue === null) {
- assert_type(obj[attributeName], "object", "Type of " + attributeName + " is different.");
- } else {
- assert_type(obj[attributeName], expectedType, "Type of " + attributeName + " is different.");
- }
- } else {
- assert_unreached("Fix your test. Wrong type " + expectedType);
- }
- obj[attributeName] = valueToAssign;
- assert_equals(obj[attributeName], valueToAssign, attributeName + " can be modified.");
- } else {
- assert_unreached("Fix your test. Wrong type of name " + typeof (attributeName));
- }
-}
-
-/**
- * Method to check if whole array can be overwritten with an invalid value.
- * Sample usage:
- * check_invalid_array_assignments(message, "to", false);
- *
- * @param obj object which has the array as its property
- * @param array name of the array to check
- * @param isNullable indicates if the array can be null
- */
-function check_invalid_array_assignments(obj, array, isNullable) {
- var args = [undefined, true, false, NaN, 0, "TIZEN", {}, function () {}],
- val = obj[array], i;
-
- if (!isNullable) {
- obj[array] = null;
- assert_not_equals(obj[array], null, "Non-nullable array was set to null");
- assert_type(obj[array], "array", "Non-nullable array type changed after assigning null");
- assert_equals(obj[array].toString(), val.toString(), "Non-nullable array contents changed after assigning null");
- }
-
- for (i = 0 ; i < args.length ; i++) {
- obj[array] = args[i];
- assert_type(obj[array], "array", "Array type changed after assigning an invalid value");
- assert_equals(obj[array].toString(), val.toString(), "Array contents changed after assigning an invalid value");
- }
-}
-
-/**
- * Method to check if an object can be overwritten with an invalid value.
- * Sample usage:
- * check_invalid_object_assignments(message, "body", false);
- *
- * @param parentObj object which has the 'obj' object as its property
- * @param obj name of the object to check
- * @param isNullable indicates if the object can be null
- */
-function check_invalid_obj_assignments(parentObj, obj, isNullable) {
- var args = [undefined, true, false, NaN, 0, "TIZEN", function () {}],
- val = parentObj[obj], i;
-
- if (!isNullable) {
- parentObj[obj] = null;
- assert_equals(parentObj[obj], val, "Non-nullable obj was modified after assigning null");
- }
-
- for (i = 0 ; i < args.length ; i++) {
- parentObj[obj] = args[i];
- assert_equals(parentObj[obj], val, "The object was set to " + args[i]);
- }
-}
-
-/**
- * Method to validate conversion for listeners.
- * Example usage:
- * incorrectListeners = getListenerConversionExceptions(["oninstalled", "onupdated", "onuninstalled"]);
- * for(i = 0; i < incorrectListeners.length; i++) {
- * packageInformationEventCallback = incorrectListeners[i][0];
- * exceptionName = incorrectListeners[i][1];
- * assert_throws({name : exceptionName},
- * function () {
- * tizen.package.setPackageInfoEventListener(packageInformationEventCallback);
- * }, exceptionName + " should be thrown - given incorrect successCallback.");
- * }
- *
- *
- * @param callbackNames Array with names
- * @returns {Array} table of tables which contain incorrect listener (index 0) and exceptionName (index 1)
- *
- */
-function getListenerConversionExceptions(callbackNames) {
- var result = [], conversionTable, i, j, listenerName;
- conversionTable = getTypeConversionExceptions("functionObject", false);
-
- for (i = 0; i < callbackNames.length; i++) {
- for (j = 0; j < conversionTable.length; j++) {
- listenerName = {};
- listenerName[callbackNames[i]] = conversionTable[j][0];
- result.push([listenerName, conversionTable[j][1]]);
- }
- }
-
- return result;
-}
</spec>
</specs>
</testcase>
- <testcase purpose="check if the method getState which is in DownloadManager interface returns proper value" type="compliance" onload_delay="90" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P1" id="DownloadManager_getState_using">
+ <testcase purpose="Check if the method getState which is in DownloadManager interface returns proper value" type="compliance" onload_delay="90" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P1" id="DownloadManager_getState_using">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadManager_getState_using.html</test_script_entry>
</description>
</spec>
</specs>
</testcase>
- <testcase purpose="check attribute destination" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P1" id="DownloadRequest_destination_attribute">
+ <testcase purpose="Check attribute destination" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P1" id="DownloadRequest_destination_attribute">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadRequest_destination_attribute.html</test_script_entry>
</description>
</spec>
</specs>
</testcase>
- <testcase purpose="check fileName attribute" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P1" id="DownloadRequest_fileName_attribute">
+ <testcase purpose="Check fileName attribute" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P1" id="DownloadRequest_fileName_attribute">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadRequest_fileName_attribute.html</test_script_entry>
</description>
</spec>
</specs>
</testcase>
- <testcase purpose="check if the readonly attribute download" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P3" id="DownloadManagerObject_download_exists">
+ <testcase purpose="Check if the readonly attribute download" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P3" id="DownloadManagerObject_download_exists">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadManagerObject_download_exists.html</test_script_entry>
</description>
</spec>
</specs>
</testcase>
- <testcase purpose="check url attribute" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P1" id="DownloadRequest_url_attribute">
+ <testcase purpose="Check url attribute" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P1" id="DownloadRequest_url_attribute">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadRequest_url_attribute.html</test_script_entry>
</description>
</spec>
</specs>
</testcase>
- <testcase purpose="check whether 'start' method returns correct value when extra argument is given" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P1" id="DownloadManager_start_with_extra_argument">
+ <testcase purpose="Check whether 'start' method returns correct value when extra argument is given" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P1" id="DownloadManager_start_with_extra_argument">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadManager_start_with_extra_argument.html</test_script_entry>
</description>
</spec>
</specs>
</testcase>
- <testcase purpose="test whether the object can have new attribute added" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P3" id="DownloadRequest_extend">
+ <testcase purpose="Test whether the object can have new attribute added" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P3" id="DownloadRequest_extend">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadRequest_extend.html</test_script_entry>
</description>
</spec>
</specs>
</testcase>
- <testcase purpose="check if the values of the attributes are equal to the arguments passed" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P1" id="DownloadRequest_constructor">
+ <testcase purpose="Check if the values of the attributes are equal to the arguments passed" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P1" id="DownloadRequest_constructor">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadRequest_constructor.html</test_script_entry>
</description>
</spec>
</specs>
</testcase>
- <testcase purpose="test whether the DownloadManager object can have new attribute added" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P3" id="DownloadManager_extend">
+ <testcase purpose="Test whether the DownloadManager object can have new attribute added" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P3" id="DownloadManager_extend">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadManager_extend.html</test_script_entry>
</description>
</spec>
</specs>
</testcase>
- <testcase purpose="check if is possible to call DownloadCallback in new expresion" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P3" id="DownloadCallback_notexist">
+ <testcase purpose="Check if is possible to call DownloadCallback in new expresion" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P3" id="DownloadCallback_notexist">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadCallback_notexist.html</test_script_entry>
</description>
</spec>
</specs>
</testcase>
- <testcase purpose="check if is possible to call DownloadManager in new expresion" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P3" id="DownloadManager_notexist">
+ <testcase purpose="Check if is possible to call DownloadManager in new expresion" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P3" id="DownloadManager_notexist">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadManager_notexist.html</test_script_entry>
</description>
</spec>
</specs>
</testcase>
- <testcase purpose="check download attribute" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P3" id="DownloadManager_in_tizen">
+ <testcase purpose="Check download attribute" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P3" id="DownloadManager_in_tizen">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadManager_in_tizen.html</test_script_entry>
</description>
</spec>
</specs>
</testcase>
- <testcase purpose="check if giving incorrect downloadRequest for setListener method throws exception" type="compliance" onload_delay="90" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P2" id="DownloadManager_start_downloadRequest_invalid_obj">
+ <testcase purpose="Check if giving incorrect downloadRequest for setListener method throws exception" type="compliance" onload_delay="90" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P2" id="DownloadManager_start_downloadRequest_invalid_obj">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadManager_start_downloadRequest_invalid_obj.html</test_script_entry>
</description>
</spec>
</specs>
</testcase>
- <testcase purpose="check networkType attribute" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P1" id="DownloadRequest_networkType_attribute">
+ <testcase purpose="Check networkType attribute" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P1" id="DownloadRequest_networkType_attribute">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadRequest_networkType_attribute.html</test_script_entry>
</description>
</spec>
</specs>
</testcase>
- <testcase purpose="check httpHeader attribute" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P1" id="DownloadRequest_httpHeader_attribute">
+ <testcase purpose="Check httpHeader attribute" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P1" id="DownloadRequest_httpHeader_attribute">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadRequest_httpHeader_attribute.html</test_script_entry>
</description>
</spec>
</specs>
</testcase>
- <testcase purpose="check if is possible to call DownloadManagerObject in new expresion" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P3" id="DownloadManagerObject_notexist">
+ <testcase purpose="Check if is possible to call DownloadManagerObject in new expresion" type="compliance" status="approved" component="TizenAPI/Content/Download" execution_type="auto" priority="P3" id="DownloadManagerObject_notexist">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadManagerObject_notexist.html</test_script_entry>
</description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadManager_getState_exist.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="check if the method getState which is in DownloadManager interface returns proper value" onload_delay="90" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadManager_getState_using">
+ <testcase purpose="Check if the method getState which is in DownloadManager interface returns proper value" onload_delay="90" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadManager_getState_using">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadManager_getState_using.html</test_script_entry>
</description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadCallback_onprogress.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="check attribute destination" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadRequest_destination_attribute">
+ <testcase purpose="Check attribute destination" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadRequest_destination_attribute">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadRequest_destination_attribute.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="check fileName attribute" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadRequest_fileName_attribute">
+ <testcase purpose="Check fileName attribute" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadRequest_fileName_attribute">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadRequest_fileName_attribute.html</test_script_entry>
</description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadManager_start.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="check if the readonly attribute download" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadManagerObject_download_exists">
+ <testcase purpose="Check if the readonly attribute download" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadManagerObject_download_exists">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadManagerObject_download_exists.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="check url attribute" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadRequest_url_attribute">
+ <testcase purpose="Check url attribute" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadRequest_url_attribute">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadRequest_url_attribute.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="check whether 'start' method returns correct value when extra argument is given" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadManager_start_with_extra_argument">
+ <testcase purpose="Check whether 'start' method returns correct value when extra argument is given" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadManager_start_with_extra_argument">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadManager_start_with_extra_argument.html</test_script_entry>
</description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadManager_setListener_null.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="test whether the object can have new attribute added" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadRequest_extend">
+ <testcase purpose="Test whether the object can have new attribute added" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadRequest_extend">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadRequest_extend.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="check if the values of the attributes are equal to the arguments passed" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadRequest_constructor">
+ <testcase purpose="Check if the values of the attributes are equal to the arguments passed" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadRequest_constructor">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadRequest_constructor.html</test_script_entry>
</description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadManager_start_missarg.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="test whether the DownloadManager object can have new attribute added" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadManager_extend">
+ <testcase purpose="Test whether the DownloadManager object can have new attribute added" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadManager_extend">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadManager_extend.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="check if is possible to call DownloadCallback in new expresion" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadCallback_notexist">
+ <testcase purpose="Check if is possible to call DownloadCallback in new expresion" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadCallback_notexist">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadCallback_notexist.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="check if is possible to call DownloadManager in new expresion" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadManager_notexist">
+ <testcase purpose="Check if is possible to call DownloadManager in new expresion" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadManager_notexist">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadManager_notexist.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="check download attribute" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadManager_in_tizen">
+ <testcase purpose="Check download attribute" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadManager_in_tizen">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadManager_in_tizen.html</test_script_entry>
</description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadManager_start_downloadCallback_invalid_cb.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="check if giving incorrect downloadRequest for setListener method throws exception" onload_delay="90" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadManager_start_downloadRequest_invalid_obj">
+ <testcase purpose="Check if giving incorrect downloadRequest for setListener method throws exception" onload_delay="90" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadManager_start_downloadRequest_invalid_obj">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadManager_start_downloadRequest_invalid_obj.html</test_script_entry>
</description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadCallback_onfailed.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="check networkType attribute" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadRequest_networkType_attribute">
+ <testcase purpose="Check networkType attribute" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadRequest_networkType_attribute">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadRequest_networkType_attribute.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="check httpHeader attribute" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadRequest_httpHeader_attribute">
+ <testcase purpose="Check httpHeader attribute" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadRequest_httpHeader_attribute">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadRequest_httpHeader_attribute.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="check if is possible to call DownloadManagerObject in new expresion" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadManagerObject_notexist">
+ <testcase purpose="Check if is possible to call DownloadManagerObject in new expresion" component="TizenAPI/Content/Download" execution_type="auto" id="DownloadManagerObject_notexist">
<description>
<test_script_entry>/opt/tct-download-tizen-tests/download/DownloadManagerObject_notexist.html</test_script_entry>
</description>