//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/alarm.html
//==== PRIORITY P1
//==== TEST_CRITERIA MNA MR
-
test(function () {
- try {
- var alarm, nextScheduledDate, myDate = new Date();
- myDate.setFullYear(myDate.getFullYear() + 1);
- myDate.setMilliseconds(0);
- alarm = new tizen.AlarmAbsolute(myDate);
- tizen.alarm.add(alarm, APPLICATION_ID);
- nextScheduledDate = alarm.getNextScheduledDate();
- assert_type(nextScheduledDate, "date", "type of the returned value is not a date");
- assert_equals(nextScheduledDate.getTime(), myDate.getTime(), "the returned date is not the same which was added");
- assert_equals(nextScheduledDate.getTime(), alarm.date.getTime(), "the returned date is not the same which is in the object");
- } finally {
- tizen.alarm.removeAll();
- }
+ add_result_callback(function () {
+ try {
+ tizen.alarm.removeAll();
+ } catch (err) {
+ // do nothing in case removeAll throw an exception
+ }
+ });
+
+ var alarm, nextScheduledDate, myDate = new Date();
+ myDate.setFullYear(myDate.getFullYear() + 1);
+ myDate.setMilliseconds(0);
+ alarm = new tizen.AlarmAbsolute(myDate);
+ tizen.alarm.add(alarm, APPLICATION_ID);
+ nextScheduledDate = alarm.getNextScheduledDate();
+ assert_type(nextScheduledDate, "date", "type of the returned value is not a date");
+ assert_equals(nextScheduledDate.getTime(), myDate.getTime(), "the returned date is not the same which was added");
+ assert_equals(nextScheduledDate.getTime(), alarm.date.getTime(), "the returned date is not the same which is in the object");
}, "AlarmAbsolute_getNextScheduledDate");
</script>
//==== TEST_CRITERIA MR MNAEX
test(function () {
- try {
- var alarm, myDate = new Date();
- myDate.setFullYear(myDate.getFullYear() + 1);
- myDate.setMilliseconds(0);
- alarm = new tizen.AlarmAbsolute(myDate);
- tizen.alarm.add(alarm, APPLICATION_ID);
- checkExtraArgument(alarm, "getNextScheduledDate");
- } finally {
- tizen.alarm.removeAll();
- }
+ add_result_callback(function () {
+ try {
+ tizen.alarm.removeAll();
+ } catch (err) {
+ // do nothing in case removeAll throw an exception
+ }
+ });
+
+ var alarm, myDate = new Date();
+ myDate.setFullYear(myDate.getFullYear() + 1);
+ myDate.setMilliseconds(0);
+ alarm = new tizen.AlarmAbsolute(myDate);
+ tizen.alarm.add(alarm, APPLICATION_ID);
+ checkExtraArgument(alarm, "getNextScheduledDate");
}, "AlarmAbsolute_getNextScheduledDate_extra_argument");
</script>
//==== TEST_CRITERIA MNA MR
test(function () {
- try {
- var alarm, nextScheduledDate, myDate = new Date();
- myDate.setFullYear(myDate.getFullYear() - 1);
- alarm = new tizen.AlarmAbsolute(myDate);
- tizen.alarm.add(alarm, APPLICATION_ID);
- nextScheduledDate = alarm.getNextScheduledDate();
- assert_equals(nextScheduledDate, null, "nextScheduledDate do not returns null");
- } finally {
- tizen.alarm.removeAll();
- }
+ add_result_callback(function () {
+ try {
+ tizen.alarm.removeAll();
+ } catch (err) {
+ // do nothing in case removeAll throw an exception
+ }
+ });
+
+ var alarm, nextScheduledDate, myDate = new Date();
+ myDate.setFullYear(myDate.getFullYear() - 1);
+ alarm = new tizen.AlarmAbsolute(myDate);
+ tizen.alarm.add(alarm, APPLICATION_ID);
+ nextScheduledDate = alarm.getNextScheduledDate();
+ assert_equals(nextScheduledDate, null, "nextScheduledDate do not returns null");
}, "AlarmAbsolute_getNextScheduledDate_return_null");
</script>
//==== TEST_CRITERIA MAST MMINA MR
test(function () {
- try {
- var alarm1, alarm2, retVal;
- alarm1 = createAbsAlarm();
- retVal = tizen.alarm.add(alarm1, APPLICATION_ID);
- assert_type(retVal, "undefined", "method returned value");
- assert_not_equals(alarm1.id, null, "object was not added properly");
- alarm2 = tizen.alarm.get(alarm1.id);
- assert_equals(alarm1.id, alarm2.id, "the object is not the same which was added");
- } finally {
- cleanAlarms();
- }
+ add_result_callback(function () {
+ try {
+ tizen.alarm.removeAll();
+ } catch (err) {
+ // do nothing in case removeAll throw an exception
+ }
+ });
+
+ var alarm1, alarm2, retVal;
+ alarm1 = createAbsAlarm();
+ retVal = tizen.alarm.add(alarm1, APPLICATION_ID);
+ assert_type(retVal, "undefined", "method returned value");
+ assert_not_equals(alarm1.id, null, "object was not added properly");
+ alarm2 = tizen.alarm.get(alarm1.id);
+ assert_equals(alarm1.id, alarm2.id, "the object is not the same which was added");
}, "AlarmManager_add_absolute_alarm");
// add alarm success
//==== TEST_CRITERIA MOA MR MAST
test(function () {
- try {
- var alarm1, alarm2, appControl, returnVal;
- alarm1 = createAbsAlarm();
- appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/view", "http://www.tizen.org");
- returnVal = tizen.alarm.add(alarm1, APPLICATION_ID, appControl);
- assert_type(returnVal, "undefined", "method returned value");
- assert_not_equals(alarm1.id, null, "object was not added properly");
- alarm2 = tizen.alarm.get(alarm1.id);
- assert_equals(alarm1.id, alarm2.id, "the object is not the same which was added");
- } finally {
- cleanAlarms();
- }
+ add_result_callback(function () {
+ try {
+ tizen.alarm.removeAll();
+ } catch (err) {
+ // do nothing in case removeAll throw an exception
+ }
+ });
+
+ var alarm1, alarm2, appControl, returnVal;
+ alarm1 = createAbsAlarm();
+ appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/view", "http://www.tizen.org");
+ returnVal = tizen.alarm.add(alarm1, APPLICATION_ID, appControl);
+ assert_type(returnVal, "undefined", "method returned value");
+ assert_not_equals(alarm1.id, null, "object was not added properly");
+ alarm2 = tizen.alarm.get(alarm1.id);
+ assert_equals(alarm1.id, alarm2.id, "the object is not the same which was added");
}, "AlarmManager_add_absolute_alarm_with_appControl");
</script>
//==== TEST_CRITERIA MC
test(function () {
- try {
- var i, conversionTable = getTypeConversionExceptions("object");
- for (i = 0; i < conversionTable.length; i++) {
- assert_throws({name: conversionTable[i][1]}, function () {
- tizen.alarm.add(conversionTable[i][0], APPLICATION_ID);
- }, "exception should was thrown");
+ add_result_callback(function () {
+ try {
+ tizen.alarm.removeAll();
+ } catch (err) {
+ // do nothing in case removeAll throw an exception
}
- } finally {
- tizen.alarm.removeAll();
+ });
+
+ var i, conversionTable = getTypeConversionExceptions("object");
+ for (i = 0; i < conversionTable.length; i++) {
+ assert_throws({name: conversionTable[i][1]}, function () {
+ tizen.alarm.add(conversionTable[i][0], APPLICATION_ID);
+ }, "exception should was thrown");
}
}, "AlarmManager_add_alarm_TypeMismatch");
//==== TEST_CRITERIA MC
test(function () {
- try {
- var i, conversionTable = getTypeConversionExceptions("object", true),
- alarm = createAbsAlarm();
- for (i = 0; i < conversionTable.length; i++) {
- assert_throws({name: conversionTable[i][1]}, function () {
- tizen.alarm.add(alarm, APPLICATION_ID, conversionTable[i][0]);
- }, "exception should was thrown");
+ add_result_callback(function () {
+ try {
+ tizen.alarm.removeAll();
+ } catch (err) {
+ // do nothing in case removeAll throw an exception
}
- } finally {
- cleanAlarms();
+ });
+
+ var i, conversionTable = getTypeConversionExceptions("object", true),
+ alarm = createAbsAlarm();
+ for (i = 0; i < conversionTable.length; i++) {
+ assert_throws({name: conversionTable[i][1]}, function () {
+ tizen.alarm.add(alarm, APPLICATION_ID, conversionTable[i][0]);
+ }, "exception should was thrown");
}
}, "AlarmManager_add_appControl_TypeMismatch");
//==== TEST_CRITERIA MC
test(function () {
+ add_result_callback(function () {
+ try {
+ tizen.alarm.removeAll();
+ } catch (err) {
+ // do nothing in case removeAll throw an exception
+ }
+ });
+
var absAlarm1 = createAbsAlarm();
- try {
- assert_throws({name: "TypeMismatchError"}, function () {
- tizen.alarm.add(absAlarm1, APPLICATION_ID, [12,34]);
- }, "TypeMismatchError exception should be thrown - given wrong appControl");
- } finally {
- cleanAlarms();
- }
+ assert_throws({name: "TypeMismatchError"}, function () {
+ tizen.alarm.add(absAlarm1, APPLICATION_ID, [12,34]);
+ }, "TypeMismatchError exception should be thrown - given wrong appControl");
}, "AlarmManager_add_appControl_invalid");
</script>
//==== TEST_CRITERIA MTO
test(function () {
- try {
- var alarm, appControl;
-
- alarm = createAbsAlarm();
-
- appControl = {
- operation: "http://tizen.org/appcontrol/operation/share",
- uri: "share.html",
- mime: "image/*",
- category: "",
- data: []
- };
-
- assert_throws({name: "TypeMismatchError"}, function () {
- tizen.alarm.add(alarm, APPLICATION_ID, appControl);
- }, "fake system object was pased but exception wasn't thrown");
-
- } finally {
- cleanAlarms();
- }
+ add_result_callback(function () {
+ try {
+ tizen.alarm.removeAll();
+ } catch (err) {
+ // do nothing in case removeAll throw an exception
+ }
+ });
+
+ var alarm, appControl;
+
+ alarm = createAbsAlarm();
+
+ appControl = {
+ operation: "http://tizen.org/appcontrol/operation/share",
+ uri: "share.html",
+ mime: "image/*",
+ category: "",
+ data: []
+ };
+
+ assert_throws({name: "TypeMismatchError"}, function () {
+ tizen.alarm.add(alarm, APPLICATION_ID, appControl);
+ }, "fake system object was pased but exception wasn't thrown");
}, "AlarmManager_add_appControl_invalid_obj");
</script>
//==== TEST_CRITERIA MMA
test(function () {
- try {
- assert_throws({name: "TypeMismatchError"}, function () {
- tizen.alarm.add();
- }, "Method was called without arguments but exception was not thrown");
-
- assert_throws({name: "TypeMismatchError"}, function () {
- tizen.alarm.add(undefined, APPLICATION_ID);
- }, "Method was called without Alarm but exception was not thrown");
- } finally {
- cleanAlarms();
- }
+ add_result_callback(function () {
+ try {
+ tizen.alarm.removeAll();
+ } catch (err) {
+ // do nothing in case removeAll throw an exception
+ }
+ });
+
+ assert_throws({name: "TypeMismatchError"}, function () {
+ tizen.alarm.add();
+ }, "Method was called without arguments but exception was not thrown");
+
+ assert_throws({name: "TypeMismatchError"}, function () {
+ tizen.alarm.add(undefined, APPLICATION_ID);
+ }, "Method was called without Alarm but exception was not thrown");
}, "AlarmManager_add_missarg");
</script>
//==== PRIORITY P1
//==== TEST_CRITERIA MMINA MR MAST
test(function () {
- try {
- var alarm1 = createRelAlarm(), alarm2, retVal;
- retVal = tizen.alarm.add(alarm1, APPLICATION_ID);
- alarm2 = tizen.alarm.get(alarm1.id);
- assert_type(retVal, "undefined", "method returned value");
- assert_not_equals(alarm1.id, null, "object was not added properly");
- assert_equals(alarm1.id, alarm2.id, "the object is not the same which was added");
- } finally {
- cleanAlarms();
- }
+ add_result_callback(function () {
+ try {
+ tizen.alarm.removeAll();
+ } catch (err) {
+ // do nothing in case removeAll throw an exception
+ }
+ });
+
+ var alarm1 = createRelAlarm(), alarm2, retVal;
+ retVal = tizen.alarm.add(alarm1, APPLICATION_ID);
+ alarm2 = tizen.alarm.get(alarm1.id);
+ assert_type(retVal, "undefined", "method returned value");
+ assert_not_equals(alarm1.id, null, "object was not added properly");
+ assert_equals(alarm1.id, alarm2.id, "the object is not the same which was added");
}, "AlarmManager_add_relative_alarm");
// add alarm success
//==== PRIORITY P1
//==== TEST_CRITERIA MOA MR MAST
test(function () {
- try {
- var alarm1, alarm2, appControl, returnVal;
- alarm1 = createRelAlarm();
- appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/view", "http://www.tizen.org");
- returnVal = tizen.alarm.add(alarm1, APPLICATION_ID, appControl);
- assert_type(returnVal, "undefined", "method returned value");
- assert_not_equals(alarm1.id, null, "object was not added properly");
- alarm2 = tizen.alarm.get(alarm1.id);
- assert_equals(alarm1.id, alarm2.id, "the object is not the same which was added");
- } finally {
- cleanAlarms();
- }
+ add_result_callback(function () {
+ try {
+ tizen.alarm.removeAll();
+ } catch (err) {
+ // do nothing in case removeAll throw an exception
+ }
+ });
+
+ var alarm1, alarm2, appControl, returnVal;
+ alarm1 = createRelAlarm();
+ appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/view", "http://www.tizen.org");
+ returnVal = tizen.alarm.add(alarm1, APPLICATION_ID, appControl);
+ assert_type(returnVal, "undefined", "method returned value");
+ assert_not_equals(alarm1.id, null, "object was not added properly");
+ alarm2 = tizen.alarm.get(alarm1.id);
+ assert_equals(alarm1.id, alarm2.id, "the object is not the same which was added");
}, "AlarmManager_add_relative_alarm_with_appControl");
</script>
//==== TEST_CRITERIA MR MMINA
test(function () {
- try {
- var alarm1, alarm2;
- alarm1 = createAbsAlarm();
- tizen.alarm.add(alarm1, APPLICATION_ID);
- alarm2 = tizen.alarm.get(alarm1.id);
- assert_true(alarm2 instanceof tizen.AlarmAbsolute, "object was not get properly");
- assert_equals(alarm1.id, alarm2.id, "the object is not the same which was added");
- } finally {
- cleanAlarms();
- }
+ add_result_callback(function () {
+ try {
+ tizen.alarm.removeAll();
+ } catch (err) {
+ // do nothing in case removeAll throw an exception
+ }
+ });
+
+ var alarm1, alarm2;
+ alarm1 = createAbsAlarm();
+ tizen.alarm.add(alarm1, APPLICATION_ID);
+ alarm2 = tizen.alarm.get(alarm1.id);
+ assert_true(alarm2 instanceof tizen.AlarmAbsolute, "object was not get properly");
+ assert_equals(alarm1.id, alarm2.id, "the object is not the same which was added");
}, "AlarmManager_get");
</script>
//==== TEST_CRITERIA MR MNA
test(function () {
- try {
- var i, absAlarm, relAlarm, alarmAll = [];
- cleanAlarms();
- absAlarm = createAbsAlarm();
- tizen.alarm.add(absAlarm, APPLICATION_ID);
- relAlarm = createRelAlarm();
- tizen.alarm.add(relAlarm, APPLICATION_ID);
- alarmAll = tizen.alarm.getAll();
- assert_equals(alarmAll.length, 2, "number of added alarms should be 2");
- for (i = 0; i < alarmAll.length; i++) {
- if (alarmAll[i] instanceof tizen.AlarmAbsolute) {
- assert_equals(alarmAll[i].id, absAlarm.id, "object is not the same which was added");
- } else if (alarmAll[i] instanceof tizen.AlarmRelative) {
- assert_equals(alarmAll[i].id, relAlarm.id, "object is not the same which was added");
- } else {
- assert_unreached("object was not get properly");
- }
+ add_result_callback(function () {
+ try {
+ tizen.alarm.removeAll();
+ } catch (err) {
+ // do nothing in case removeAll throw an exception
+ }
+ });
+
+ var i, absAlarm, relAlarm, alarmAll = [];
+ cleanAlarms();
+ absAlarm = createAbsAlarm();
+ tizen.alarm.add(absAlarm, APPLICATION_ID);
+ relAlarm = createRelAlarm();
+ tizen.alarm.add(relAlarm, APPLICATION_ID);
+ alarmAll = tizen.alarm.getAll();
+ assert_equals(alarmAll.length, 2, "number of added alarms should be 2");
+ for (i = 0; i < alarmAll.length; i++) {
+ if (alarmAll[i] instanceof tizen.AlarmAbsolute) {
+ assert_equals(alarmAll[i].id, absAlarm.id, "object is not the same which was added");
+ } else if (alarmAll[i] instanceof tizen.AlarmRelative) {
+ assert_equals(alarmAll[i].id, relAlarm.id, "object is not the same which was added");
+ } else {
+ assert_unreached("object was not get properly");
}
- } finally {
- cleanAlarms();
}
});
//==== TEST_CRITERIA MNAEX MR
test(function () {
- try {
- var i, absAlarm, alarmAll = [], argumentsList = [null, undefined, "string", 1, false, ["one", "two"], {arg: 1}, function () {}];
- cleanAlarms();
- absAlarm = createAbsAlarm();
- tizen.alarm.add(absAlarm, APPLICATION_ID);
- for (i = 0; i < argumentsList.length; i++) {
- alarmAll = tizen.alarm.getAll(argumentsList[i]);
- assert_equals(alarmAll.length, 1, "number of added alarms should be 1");
- assert_true(alarmAll[0] instanceof tizen.AlarmAbsolute, "object was not get properly");
- assert_equals(alarmAll[0].id, absAlarm.id, "the first object is not the same which was added");
- alarmAll = [];
+ add_result_callback(function () {
+ try {
+ tizen.alarm.removeAll();
+ } catch (err) {
+ // do nothing in case removeAll throw an exception
}
- } finally {
- cleanAlarms();
+ });
+
+ var i, absAlarm, alarmAll = [], argumentsList = [null, undefined, "string", 1, false, ["one", "two"], {arg: 1}, function () {}];
+ cleanAlarms();
+ absAlarm = createAbsAlarm();
+ tizen.alarm.add(absAlarm, APPLICATION_ID);
+ for (i = 0; i < argumentsList.length; i++) {
+ alarmAll = tizen.alarm.getAll(argumentsList[i]);
+ assert_equals(alarmAll.length, 1, "number of added alarms should be 1");
+ assert_true(alarmAll[0] instanceof tizen.AlarmAbsolute, "object was not get properly");
+ assert_equals(alarmAll[0].id, absAlarm.id, "the first object is not the same which was added");
+ alarmAll = [];
}
});
//==== TEST_CRITERIA MMINA MR
test(function () {
- try {
- var alarm1, alarm2;
- alarm1 = createRelAlarm();
- tizen.alarm.add(alarm1, APPLICATION_ID);
- alarm2 = tizen.alarm.get(alarm1.id);
- assert_true(alarm2 instanceof tizen.AlarmRelative, "object was not get properly");
- assert_equals(alarm1.id, alarm2.id, "the object is not the same which was added");
- } finally {
- cleanAlarms();
- }
+ add_result_callback(function () {
+ try {
+ tizen.alarm.removeAll();
+ } catch (err) {
+ // do nothing in case removeAll throw an exception
+ }
+ });
+
+ var alarm1, alarm2;
+ alarm1 = createRelAlarm();
+ tizen.alarm.add(alarm1, APPLICATION_ID);
+ alarm2 = tizen.alarm.get(alarm1.id);
+ assert_true(alarm2 instanceof tizen.AlarmRelative, "object was not get properly");
+ assert_equals(alarm1.id, alarm2.id, "the object is not the same which was added");
}, "AlarmManager_get_AlarmRelative");
</script>
//==== TEST_CRITERIA MR MNA MNAST
test(function (){
- try {
- var absAlarm, relAlarm, retVal, alarmAll = [];
- tizen.alarm.removeAll();
- absAlarm = createAbsAlarm();
- tizen.alarm.add(absAlarm, APPLICATION_ID);
- relAlarm = createRelAlarm();
- tizen.alarm.add(relAlarm, APPLICATION_ID);
- alarmAll = tizen.alarm.getAll();
- assert_equals(alarmAll.length, 2 ,"number of added alarms should be 2");
- retVal = tizen.alarm.removeAll();
- assert_type(retVal, "undefined", "method returned value");
- assert_throws({name: "NotFoundError"}, function () {
- tizen.alarm.get(relAlarm.id);
- }, "exception wasn't thrown");
- assert_throws({name: "NotFoundError"}, function () {
- tizen.alarm.get(absAlarm.id);
- }, "exception wasn't thrown");
- alarmAll = tizen.alarm.getAll();
- assert_equals(alarmAll.length, 0, "items not removed properly");
- } finally {
- tizen.alarm.removeAll();
- }
+ add_result_callback(function () {
+ try {
+ tizen.alarm.removeAll();
+ } catch (err) {
+ // do nothing in case removeAll throw an exception
+ }
+ });
+
+ var absAlarm, relAlarm, retVal, alarmAll = [];
+
+ tizen.alarm.removeAll();
+
+ absAlarm = createAbsAlarm();
+ tizen.alarm.add(absAlarm, APPLICATION_ID);
+
+ relAlarm = createRelAlarm();
+ tizen.alarm.add(relAlarm, APPLICATION_ID);
+
+ alarmAll = tizen.alarm.getAll();
+ assert_equals(alarmAll.length, 2 ,"number of added alarms should be 2");
+
+ retVal = tizen.alarm.removeAll();
+ assert_type(retVal, "undefined", "method returned value");
+
+ assert_throws({name: "NotFoundError"}, function () {
+ tizen.alarm.get(relAlarm.id);
+ }, "exception wasn't thrown");
+
+ assert_throws({name: "NotFoundError"}, function () {
+ tizen.alarm.get(absAlarm.id);
+ }, "exception wasn't thrown");
+
+ alarmAll = tizen.alarm.getAll();
+ assert_equals(alarmAll.length, 0, "items not removed properly");
}, "AlarmManager_removeAll");
</script>
//==== TEST_CRITERIA MNAEX
test(function (){
- try {
- var i, alarm, alarmAll, retVal, argumentsList = [null, undefined, "string", 1, false, ["one", "two"], {arg: 1}, function () {}];
- tizen.alarm.removeAll();
- alarm = createAbsAlarm();
- for (i = 0; i < argumentsList.length; i++) {
- tizen.alarm.add(alarm, APPLICATION_ID);
- alarmAll = tizen.alarm.getAll();
- assert_equals(alarmAll.length, 1 ,"number of added alarms should be 1");
- retVal = tizen.alarm.removeAll(argumentsList[i]);
- assert_type(retVal, "undefined", "method returned value");
- assert_throws({name: "NotFoundError"}, function () {
- tizen.alarm.get(alarm.id);
- }, "exception wasn't thrown");
- alarmAll = tizen.alarm.getAll();
- assert_equals(alarmAll.length, 0, "items not removed properly");
+ add_result_callback(function () {
+ try {
+ tizen.alarm.removeAll();
+ } catch (err) {
+ // do nothing in case removeAll throw an exception
}
- } finally {
- tizen.alarm.removeAll();
+ });
+
+ var i, alarm, alarmAll, retVal, argumentsList = [null, undefined, "string", 1, false, ["one", "two"], {arg: 1}, function () {}];
+ tizen.alarm.removeAll();
+ alarm = createAbsAlarm();
+ for (i = 0; i < argumentsList.length; i++) {
+ tizen.alarm.add(alarm, APPLICATION_ID);
+ alarmAll = tizen.alarm.getAll();
+ assert_equals(alarmAll.length, 1 ,"number of added alarms should be 1");
+ retVal = tizen.alarm.removeAll(argumentsList[i]);
+ assert_type(retVal, "undefined", "method returned value");
+ assert_throws({name: "NotFoundError"}, function () {
+ tizen.alarm.get(alarm.id);
+ }, "exception wasn't thrown");
+ alarmAll = tizen.alarm.getAll();
+ assert_equals(alarmAll.length, 0, "items not removed properly");
}
}, "AlarmManager_removeAll_extra_argument");
//==== TEST_CRITERIA MR MMINA MAST
test(function () {
- try {
- var alarm, retVal;
- tizen.alarm.removeAll();
- alarm = createAbsAlarm();
- tizen.alarm.add(alarm, APPLICATION_ID);
- retVal=tizen.alarm.remove(alarm.id);
- assert_type(retVal, "undefined", "method returned value");
- assert_throws({name: "NotFoundError"}, function () {
- tizen.alarm.get(alarm.id);
- }, "exception wasn't thrown");
- assert_equals(tizen.alarm.getAll().length, 0, "item not removed properly");
- } finally {
- tizen.alarm.removeAll();
- }
+ add_result_callback(function () {
+ try {
+ tizen.alarm.removeAll();
+ } catch (err) {
+ // do nothing in case removeAll throw an exception
+ }
+ });
+
+ var alarm, retVal;
+ tizen.alarm.removeAll();
+ alarm = createAbsAlarm();
+ tizen.alarm.add(alarm, APPLICATION_ID);
+ retVal=tizen.alarm.remove(alarm.id);
+ assert_type(retVal, "undefined", "method returned value");
+ assert_throws({name: "NotFoundError"}, function () {
+ tizen.alarm.get(alarm.id);
+ }, "exception wasn't thrown");
+ assert_equals(tizen.alarm.getAll().length, 0, "item not removed properly");
}, "AlarmManager_remove_absolute_alarm");
</script>
//==== TEST_CRITERIA MR MMINA MAST
test(function () {
- try {
- var alarm, retVal;
- tizen.alarm.removeAll();
- alarm = createRelAlarm();
- tizen.alarm.add(alarm, APPLICATION_ID);
- retVal=tizen.alarm.remove(alarm.id);
- assert_type(retVal, "undefined", "method returned value");
- assert_throws({name: "NotFoundError"}, function () {
- tizen.alarm.get(alarm.id);
- }, "exception wasn't thrown");
- assert_equals(tizen.alarm.getAll().length, 0, "item not removed properly");
- } finally {
- tizen.alarm.removeAll();
- }
+ add_result_callback(function () {
+ try {
+ tizen.alarm.removeAll();
+ } catch (err) {
+ // do nothing in case removeAll throw an exception
+ }
+ });
+
+ var alarm, retVal;
+ tizen.alarm.removeAll();
+ alarm = createRelAlarm();
+ tizen.alarm.add(alarm, APPLICATION_ID);
+ retVal=tizen.alarm.remove(alarm.id);
+ assert_type(retVal, "undefined", "method returned value");
+ assert_throws({name: "NotFoundError"}, function () {
+ tizen.alarm.get(alarm.id);
+ }, "exception wasn't thrown");
+ assert_equals(tizen.alarm.getAll().length, 0, "item not removed properly");
}, "AlarmManager_remove_relative_alarm");
</script>
//==== TEST_CRITERIA MR MNA
test(function () {
- try {
- var alarm, remainingSeconds, delay = 3600;
- alarm = new tizen.AlarmRelative(delay);
- tizen.alarm.add(alarm, APPLICATION_ID);
- remainingSeconds = alarm.getRemainingSeconds();
- assert_type(remainingSeconds, "number", "type of the returned value is not a number");
- assert_approx_equals(remainingSeconds, alarm.delay, 1, "the returned value is not properly");
- } finally {
- tizen.alarm.removeAll();
- }
+ add_result_callback(function () {
+ try {
+ tizen.alarm.removeAll();
+ } catch (err) {
+ // do nothing in case removeAll throw an exception
+ }
+ });
+
+ var alarm, remainingSeconds, delay = 3600;
+ alarm = new tizen.AlarmRelative(delay);
+ tizen.alarm.add(alarm, APPLICATION_ID);
+ remainingSeconds = alarm.getRemainingSeconds();
+ assert_type(remainingSeconds, "number", "type of the returned value is not a number");
+ assert_approx_equals(remainingSeconds, alarm.delay, 1, "the returned value is not properly");
}, "AlarmRelative_getRemainingSeconds");
</script>
//==== TEST_CRITERIA MNAEX MR
test(function () {
- try {
- var i, alarm, remainingSeconds, delay = 3600,
- argumentsList = [null, undefined, "string", 1, false, ["one", "two"], {arg: 1}, function () {}];
- alarm = new tizen.AlarmRelative(delay);
- tizen.alarm.add(alarm, APPLICATION_ID);
- for (i = 0; i < argumentsList.length; i++) {
- remainingSeconds = alarm.getRemainingSeconds(argumentsList[i]);
- assert_type(remainingSeconds, "number", "type of the returned value is not a number");
- assert_approx_equals(remainingSeconds, alarm.delay, 1, "the returned value is not properly");
+ add_result_callback(function () {
+ try {
+ tizen.alarm.removeAll();
+ } catch (err) {
+ // do nothing in case removeAll throw an exception
}
- } finally {
- tizen.alarm.removeAll();
+ });
+
+ var i, alarm, remainingSeconds, delay = 3600,
+ argumentsList = [null, undefined, "string", 1, false, ["one", "two"], {arg: 1}, function () {}];
+ alarm = new tizen.AlarmRelative(delay);
+ tizen.alarm.add(alarm, APPLICATION_ID);
+ for (i = 0; i < argumentsList.length; i++) {
+ remainingSeconds = alarm.getRemainingSeconds(argumentsList[i]);
+ assert_type(remainingSeconds, "number", "type of the returned value is not a number");
+ assert_approx_equals(remainingSeconds, alarm.delay, 1, "the returned value is not properly");
}
}, "AlarmRelative_getRemainingSeconds_extra_argument");
<body>
<div id="log"></div>
<script>
+setup({timeout: 30000});
//==== TEST: AlarmRelative_getRemainingSeconds_return_null
//==== LABEL check using getRemainingSeconds method for null return
//==== PRIORITY P1
//==== TEST_CRITERIA MR MNA
-var t = async_test("AlarmRelative_getRemainingSeconds_return_null"),
- alarm, remainingSeconds, delay = 1, getRemainingSeconds;
+var t = async_test("AlarmRelative_getRemainingSeconds_return_null", {timeout: 30000}),
+ alarm, returnedValue;
t.step(function () {
- tizen.alarm.removeAll();
- alarm = new tizen.AlarmRelative(delay);
+ alarm = new tizen.AlarmRelative(5);
+
tizen.alarm.add(alarm, APPLICATION_ID);
- getRemainingSeconds = t.step_func(function () {
- try {
- remainingSeconds = alarm.getRemainingSeconds();
- assert_equals(remainingSeconds, null, "getRemainingSeconds do not returns null");
- t.done();
- } finally {
- tizen.alarm.removeAll();
- }
- });
-
- setTimeout(getRemainingSeconds, 1300);
+ setTimeout(t.step_func(function () {
+ returnedValue = alarm.getRemainingSeconds();
+ assert_equals(returnedValue, null, "getRemainingSeconds do not returns null");
+ t.done();
+ }), 10000);
});
</script>
//==== TEST_CRITERIA AE AT ARO
test(function () {
- try {
- var alarm, date = new Date();
- date.setFullYear(date.getFullYear() + 1);
- alarm = new tizen.AlarmAbsolute(date);
- assert_true("id" in alarm, "attribute id doesn't exist in provided object");
- assert_type(alarm.id, "null", "default value should be null");
- tizen.alarm.add(alarm, APPLICATION_ID);
- check_readonly(alarm, "id", alarm.id, "string", "dummyValue");
- } finally {
- cleanAlarms();
- }
+ add_result_callback(function () {
+ try {
+ tizen.alarm.removeAll();
+ } catch (err) {
+ // do nothing in case removeAll throw an exception
+ }
+ });
+
+ var alarm, date = new Date();
+ date.setFullYear(date.getFullYear() + 1);
+ alarm = new tizen.AlarmAbsolute(date);
+ assert_true("id" in alarm, "attribute id doesn't exist in provided object");
+ assert_type(alarm.id, "null", "default value should be null");
+ tizen.alarm.add(alarm, APPLICATION_ID);
+ check_readonly(alarm, "id", alarm.id, "string", "dummyValue");
}, "Alarm_id_attribute_absolute_alarm");
</script>
//==== TEST_CRITERIA AE AT ARO
test(function () {
- try {
- var alarm, delay = 3600;
- alarm = new tizen.AlarmRelative(delay);
- assert_true("id" in alarm, "attribute id doesn't exist in provided object");
- assert_type(alarm.id, "null", "default value should be null");
- tizen.alarm.add(alarm, APPLICATION_ID);
- check_readonly(alarm, "id", alarm.id, "string", "dummyValue");
- } finally {
- cleanAlarms();
- }
+ add_result_callback(function () {
+ try {
+ tizen.alarm.removeAll();
+ } catch (err) {
+ // do nothing in case removeAll throw an exception
+ }
+ });
+
+ var alarm, delay = 3600;
+ alarm = new tizen.AlarmRelative(delay);
+ assert_true("id" in alarm, "attribute id doesn't exist in provided object");
+ assert_type(alarm.id, "null", "default value should be null");
+ tizen.alarm.add(alarm, APPLICATION_ID);
+ check_readonly(alarm, "id", alarm.id, "string", "dummyValue");
}, "Alarm_id_attribute_relative_alarm");
</script>
<icon src="icon.png"/>
<content src="index.html"/>
- <tizen:application id="testalar00.alarmTestApp" package="testalar00" required_version="2.1"/>
+ <tizen:application id="testalar00.alarmTestApp" package="testalar00" required_version="2.2"/>
</widget>
</spec>
</specs>
</testcase>
- <testcase purpose="check using getRemainingSeconds method for null return" type="compliance" status="approved" component="TizenAPI/Application/Alarm" execution_type="auto" priority="P1" id="AlarmRelative_getRemainingSeconds_return_null">
+ <testcase purpose="check using getRemainingSeconds method for null return" type="compliance" onload_delay="30" status="approved" component="TizenAPI/Application/Alarm" execution_type="auto" priority="P1" id="AlarmRelative_getRemainingSeconds_return_null">
<description>
<test_script_entry>/opt/tct-alarm-tizen-tests/alarm/AlarmRelative_getRemainingSeconds_return_null.html</test_script_entry>
</description>
<test_script_entry>/opt/tct-alarm-tizen-tests/alarm/AlarmRelative_getRemainingSeconds_extra_argument.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="check using getRemainingSeconds method for null return" component="TizenAPI/Application/Alarm" execution_type="auto" id="AlarmRelative_getRemainingSeconds_return_null">
+ <testcase purpose="check using getRemainingSeconds method for null return" onload_delay="30" component="TizenAPI/Application/Alarm" execution_type="auto" id="AlarmRelative_getRemainingSeconds_return_null">
<description>
<test_script_entry>/opt/tct-alarm-tizen-tests/alarm/AlarmRelative_getRemainingSeconds_return_null.html</test_script_entry>
</description>