setup({timeout: 90000});
var t = async_test(document.title, {timeout: 90000}), listener,
- downloadRequest, downloadId;
+ downloadRequest, downloadId, flag = true;
t.step(function () {
listener = {
onprogress: t.step_func(function (id, receivedSize, totalSize) {
- try {
- tizen.download.cancel(id);
- } catch (e) {
- assert_unreached("cancel() failed: " + e.name + " with message: " + e.message);
+ if (flag === true) {
+ try {
+ tizen.download.cancel(id);
+ } catch (e) {
+ assert_unreached("cancel() failed: " + e.name + " with message: " + e.message);
+ }
+ flag = false;
}
}),
onpaused: t.step_func(function (id) {
setup({timeout: 90000});
var t = async_test(document.title, {timeout: 90000}), listener,
- downloadRequest, downloadId;
+ downloadRequest, downloadId, flag = true;
t.step(function () {
listener = {
onprogress: t.step_func(function (id, receivedSize, totalSize) {
- try {
- tizen.download.pause(downloadId);
- } catch (e) {
- assert_unreached("pause() failed: " + e.name + " with message: " + e.message);
+ if (flag === true) {
+ try {
+ tizen.download.pause(downloadId);
+ } catch (e) {
+ assert_unreached("pause() failed: " + e.name + " with message: " + e.message);
+ }
+ flag = false;
}
}),
onpaused: t.step_func(function (id) {
setup({timeout: 90000});
var t = async_test(document.title, {timeout: 90000}), listener,
- downloadRequest, downloadId;
+ downloadRequest, downloadId, flag = true;
t.step(function () {
listener = {
onprogress: t.step_func(function (id, receivedSize, totalSize) {
assert_type(totalSize, "unsigned long long", "totalSize type should be a number");
assert_greater_than(totalSize, 0, "totalSize is less than or equals to zero");
assert_true(receivedSize >= 0 && receivedSize <= totalSize, "The length of receivedSize between zero and totalSize");
- try {
- tizen.download.cancel(downloadId);
- } catch (e) {
- assert_unreached("cancel() failed: " + e.name + " with message: " + e.message);
+ if (flag === true) {
+ try {
+ tizen.download.cancel(downloadId);
+ } catch (e) {
+ assert_unreached("cancel() failed: " + e.name + " with message: " + e.message);
+ }
+ flag = false;
}
}),
onpaused: t.step_func(function (id) {
setup({timeout: 90000});
var t = async_test(document.title, {timeout: 90000}), downloadRequest = null,
- downloadId, listener, retValue = null;
+ downloadId, listener, retValue = null, flag = true;
t.step(function () {
listener = {
onprogress: t.step_func(function (id, receivedSize, totalSize) {
assert_not_equals(id, null, "id valid");
- try {
- retValue = tizen.download.cancel(downloadId);
- } catch(e) {
- assert_unreached("cancel() failed: " + e.name + " with message: " + e.message);
+ if (flag === true) {
+ try {
+ retValue = tizen.download.cancel(downloadId);
+ } catch (e) {
+ assert_unreached("cancel() failed: " + e.name + " with message: " + e.message);
+ }
+ flag = false;
}
}),
onpaused: t.step_func(function (id) {
//==== TEST_CRITERIA MR
setup({timeout: 90000});
-var t = async_test(document.title, {timeout: 90000}), downloadRequest = null, downloadId, listener, state;
+var t = async_test(document.title, {timeout: 90000}), downloadRequest = null, downloadId, listener, state, flag = true;
t.step(function () {
listener = {
onprogress: t.step_func(function (id, receivedSize, totalSize) {
- tizen.download.cancel(downloadId);
+ if (flag === true) {
+ tizen.download.cancel(downloadId);
+ flag = false;
+ }
}),
onpaused: t.step_func(function (id) {
assert_unreached("onpaused should not be reached");
</script>
</body>
-</html>
\ No newline at end of file
+</html>
//==== TEST_CRITERIA MR
setup({timeout: 90000});
-var t = async_test(document.title, {timeout: 90000}), downloadRequest = null, downloadId, listener, state;
+var t = async_test(document.title, {timeout: 90000}), downloadRequest = null, downloadId, listener, state, flag = true;
t.step(function () {
add_result_callback(function(){
try {
});
listener = {
onprogress: t.step_func(function (id, receivedSize, totalSize) {
- tizen.download.pause(downloadId);
+ if (flag === true) {
+ tizen.download.pause(downloadId);
+ flag = false;
+ }
}),
onpaused: t.step_func(function (id) {
state = tizen.download.getState(downloadId);
//==== ONLOAD_DELAY 90
//==== TEST_CRITERIA MMINA MAST MR
-var t = async_test(document.title, {timeout: 90000}), downloadRequest = null,
+var t = async_test(document.title, {timeout: 90000}), downloadRequest = null, flag = true,
downloadId, listener, retValue = null;
setup({timeout: 90000});
listener = {
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) {
- assert_unreached("pause() failed: " + e.name + " with message: " + e.message);
+ if (flag === true) {
+ try {
+ retValue = tizen.download.pause(downloadId);
+ } catch (e) {
+ assert_unreached("pause() failed: " + e.name + " with message: " + e.message);
+ }
+ flag = false;
}
}),
onpaused: t.step_func(function (id) {