<body>
<div id="log"></div>
<script type="text/javascript">
-
-
//==== TEST: CalendarAlarm_constructor_TZDate
//==== LABEL Check various arguments for CalendarAlarm constructor TZDate
//==== SPEC Tizen Web API:Social:Calendar:CalendarAlarm:constructor C
<body>
<div id="log"></div>
<script type="text/javascript">
-
-
//==== TEST: CalendarAlarm_constructor_TimeDuration
//==== LABEL Check various arguments for CalendarAlarm constructor TimeDuration
//==== SPEC Tizen Web API:Social:Calendar:CalendarAlarm:constructor C
<body>
<div id="log"></div>
<script type="text/javascript">
-
-
//==== TEST: CalendarAttendee_attribute_valid_value_CalendarEvent
//==== LABEL Check various attributes of CalendarAttendee used in CalendarEvent
//==== SPEC Tizen Web API:Social:Calendar:CalendarAttendee:type A
<body>
<div id="log"></div>
<script type="text/javascript">
-
-
//==== TEST: CalendarAttendee_constructor_valid_argument
//==== LABEL Check if instance of CalendarAttendee is created correctly by constructor
//==== SPEC Tizen Web API:Social:Calendar:CalendarAttendee:constructor C
<body>
<div id="log"></div>
<script type="text/javascript">
-
-
//==== TEST: CalendarEvent_constructor_valid_argument
//==== LABEL Check if instance of CalendarEvent is created correctly by the constructor (use init dictionary)
//==== SPEC Tizen Web API:Social:Calendar:CalendarEvent:constructor C
//==== SPEC Tizen Web API:Social:Calendar:CalendarEvent:expandRecurrence M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/calendar.html
//==== TEST_CRITERIA MC
-var t = async_test(document.title), startDate, ev, i, param, exceptionName, conversionTable;
+var t = async_test(document.title), startDate, ev, i, param, exceptionName, conversionTable,
+ expandSuccessCB;
t.step(function () {
startDate = new tizen.TZDate(2012, 0, 31);
ev = new tizen.CalendarEvent({
})
});
- function expandSuccessCB(events) {
+ expandSuccessCB = t.step_func(function (events) {
assert_unreached("expandRecurrence() success callback");
- }
+ });
conversionTable = getTypeConversionExceptions("object", false);
for (i = 0; i < conversionTable.length; i++) {
}, exceptionName + " should be thrown - given incorrect.");
}
- this.done();
+ t.done();
});
</script>
//==== SPEC Tizen Web API:Social:Calendar:CalendarEvent:expandRecurrence M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/calendar.html
//==== TEST_CRITERIA MTO
-var t = async_test(document.title), startDate, endDate, ev;
+var t = async_test(document.title), startDate, endDate, ev, expandSuccessCB;
t.step(function () {
startDate = new tizen.TZDate(2012, 0, 31);
ev = new tizen.CalendarEvent({
})
});
- function expandSuccessCB(events) {
+ expandSuccessCB = t.step_func(function (events) {
assert_unreached("expandRecurrence() success callback");
- }
+ });
endDate = {
year: 2013,
ev.expandRecurrence(startDate, endDate, expandSuccessCB);
});
- this.done();
+ t.done();
});
</script>
}, exceptionName + " should be thrown - given incorrect.");
}
- this.done();
+ t.done();
});
</script>
//==== SPEC Tizen Web API:Social:Calendar:CalendarEvent:expandRecurrence M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/calendar.html
//==== TEST_CRITERIA MTCB
-var t = async_test(document.title), startDate, endDate, ev;
+var t = async_test(document.title), startDate, endDate, ev,
+ expandSuccessCB;
t.step(function () {
startDate = new tizen.TZDate(2012, 0, 31);
endDate = new tizen.TZDate(2012, 4, 31);
})
});
- function expandSuccessCB(events) {
+ expandSuccessCB = t.step_func(function (events) {
assert_unreached("expandRecurrence() success callback");
- }
+ });
assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
ev.expandRecurrence(startDate, endDate, expandSuccessCB, {onerror:function (){}});
});
- this.done();
+ t.done();
});
</script>
//==== SPEC Tizen Web API:Social:Calendar:CalendarEvent:expandRecurrence M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/calendar.html
//==== TEST_CRITERIA MC MMA
-var t = async_test(document.title), startDate, endDate, ev;
+var t = async_test(document.title), startDate, endDate, ev, expandSuccessCB;
t.step(function () {
startDate = new tizen.TZDate(2012, 0, 1);
endDate = new tizen.TZDate(2012, 0, 31);
})
});
- function expandSuccessCB(events) {
+ expandSuccessCB = t.step_func(function (events) {
assert_unreached("expandRecurrence() success callback");
- }
+ });
assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
ev.expandRecurrence(1, endDate, expandSuccessCB, null);
assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
ev.expandRecurrence(1, 2);
});
- this.done();
+
+ t.done();
});
</script>
//==== SPEC Tizen Web API:Social:Calendar:CalendarEvent:expandRecurrence M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/calendar.html
//==== TEST_CRITERIA MC
-var t = async_test(document.title), endDate, ev, i, param, exceptionName, conversionTable;
+var t = async_test(document.title), endDate, ev, i, param, exceptionName, conversionTable,
+ expandSuccessCB;
t.step(function () {
endDate = new tizen.TZDate(2012, 0, 31);
ev = new tizen.CalendarEvent({
})
});
- function expandSuccessCB(events) {
+ expandSuccessCB = t.step_func(function (events) {
assert_unreached("expandRecurrence() success callback");
- }
+ });
conversionTable = getTypeConversionExceptions("object", false);
for (i = 0; i < conversionTable.length; i++) {
}, exceptionName + " should be thrown - given incorrect.");
}
- this.done();
+ t.done();
});
</script>
//==== SPEC Tizen Web API:Social:Calendar:CalendarEvent:expandRecurrence M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/calendar.html
//==== TEST_CRITERIA MTO
-var t = async_test(document.title), startDate, endDate, ev;
+var t = async_test(document.title), startDate, endDate, ev, expandSuccessCB;
t.step(function () {
endDate = new tizen.TZDate(2012, 0, 31);
ev = new tizen.CalendarEvent({
})
});
- function expandSuccessCB(events) {
+ expandSuccessCB = t.step_func(function (events) {
assert_unreached("expandRecurrence() success callback");
- }
+ });
startDate = {
year: 2013,
ev.expandRecurrence(startDate, endDate, expandSuccessCB);
});
- this.done();
+ t.done();
});
</script>
calendar, successCallback, errorCallback;
t.step(function () {
successCallback = t.step_func(function (calendars) {
- assert_unreached("Invalid callback invoked");
+ assert_unreached("Success callback invoked");
});
errorCallback = {
<body>
<div id="log"></div>
<script type="text/javascript">
-
-
//==== TEST: CalendarManager_getCalendars_missarg
//==== LABEL Check whether getCalendars() method called with invalid arguments throws an exception
//==== SPEC Tizen Web API:Social:Calendar:CalendarManager:getCalendars M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/calendar.html
//==== TEST_CRITERIA MMA MC
-var t = async_test(document.title), self, onGetCalendarsErrorCB, onGetCalendarsSuccessCB;
+var t = async_test(document.title), onGetCalendarsErrorCB, onGetCalendarsSuccessCB;
t.step(function () {
- self = this;
- onGetCalendarsSuccessCB = this.step_func(function (response) {
+ onGetCalendarsSuccessCB = t.step_func(function (response) {
assert_unreached("onGetCalendarsSuccessCB");
});
- onGetCalendarsErrorCB = this.step_func(function (error) {
+ onGetCalendarsErrorCB = t.step_func(function (error) {
assert_unreached("Error: " + error.message);
});
tizen.calendar.getCalendars();
});
- this.done();
+ t.done();
});
<body>
<div id="log"></div>
<script type="text/javascript">
-
-
//==== TEST: CalendarManager_getCalendars_missarg_TASK
//==== LABEL Check whether getCalendars() method called with invalid arguments throws an exception (part 2)
//==== SPEC Tizen Web API:Social:Calendar:CalendarManager:getCalendars M
var t = async_test(document.title), onGetCalendarsSuccessCB, onGetCalendarsErrorCB;
t.step(function () {
- onGetCalendarsSuccessCB = this.step_func(function (response) {
+ onGetCalendarsSuccessCB = t.step_func(function (response) {
assert_unreached("onGetCalendarsSuccessCB");
});
- onGetCalendarsErrorCB = this.step_func(function (error) {
+ onGetCalendarsErrorCB = t.step_func(function (error) {
assert_unreached("Error: " + error.message);
});
tizen.calendar.getCalendars("TASK", onGetCalendarsSuccessCB, 1);
});
- this.done();
+ t.done();
});
</script>
test(function (){
assert_throws(TYPE_MISMATCH_EXCEPTION, function (){
tizen.calendar.getCalendars("EVENT", false);
- }, "TypeMismatchError exception.");
+ }, "Given incorrect successCallback");
}, document.title);
</script>
test(function (){
assert_throws(TYPE_MISMATCH_EXCEPTION, function (){
tizen.calendar.getDefaultCalendar("123");
- }, "TypeMismatchError exception.");
+ }, "Given incorrect type");
}, document.title);
</script>
test(function (){
assert_throws(TYPE_MISMATCH_EXCEPTION, function (){
tizen.calendar.getDefaultCalendar(null);
- }, "TypeMismatchError exception.");
+ }, "Given incorrect type");
}, document.title);
</script>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: Calendar_Calendar_addBatch_error_events
-//==== LABEL Check Calendar addBatch method: error events
+//==== LABEL Check if Calendar.addBatch method throws exception when null given as items
//==== PRIORITY P2
//==== SPEC Tizen Web API:Social:Calendar:Calendar:addBatch M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/calendar.html
//==== TEST_CRITERIA MC
-var events = null;
-var calendar = tizen.calendar.getDefaultCalendar("EVENT");
+var calendar = tizen.calendar.getDefaultCalendar("EVENT"), events = null;
test(function (){
assert_throws(TYPE_MISMATCH_EXCEPTION, function (){
calendar.addBatch(events);
- }, "TypeMismatchError exception.");
+ }, "Given null as items");
}, document.title);
</script>
t.step(function () {
successCallback = t.step_func(function () {
- assert_unreached("addBatch() success callback shoult not be invoked.");
+ assert_unreached("addBatch() success callback invoked.");
});
calendar = tizen.calendar.getDefaultCalendar("EVENT");
<body>
<div id="log"></div>
<script>
-
//==== TEST: Calendar_addBatch_errorCallback_invalid_cb
//==== LABEL Check whether addBatch() method incorrectly with invalid errorCallback
//==== PRIORITY: P2
//==== SPEC Tizen Web API:Social:Calendar:Calendar:addBatch M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/calendar.html
//==== TEST_CRITERIA MTCB
-test(function () {
- var events, eventCalendar;
+var t = async_test(document.title), events, eventCalendar, successCallback, errorCallback;
+t.step(function () {
- eventCalendar = tizen.calendar.getDefaultCalendar("EVENT");
- events = createTestEvents();
-
- function onAddBatchSuccessCB(response) {
+ successCallback = t.step_func(function () {
cleanup(eventCalendar);
- assert_unreached("successCallback invoked");
- }
+ assert_unreached("addBatch() success callback invoked.");
+ });
+ errorCallback = {
+ onerror: t.step_func(function () {
+ assert_unreached("addBatch() invalid error callback invoked.");
+ })
+ };
+
+ eventCalendar = tizen.calendar.getDefaultCalendar("EVENT");
+ events = createTestEvents();
assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
- eventCalendar.addBatch(events, onAddBatchSuccessCB, {onerror: function () {}});
+ eventCalendar.addBatch(events, successCallback, errorCallback);
});
-}, document.title);
+
+ t.done();
+});
</script>
</body>
t.step(function () {
- successCallback = t.step_func(function (value) {
- assert_unreached("addBatch() success callback shoult not be invoked.");
+ successCallback = t.step_func(function (items) {
+ assert_unreached("addBatch() success callback invoked.");
});
errorCallback = t.step_func(function (error) {
- assert_unreached("addBatch() error callback shoult not be invoked: " + error.name + " msg: " + error.message);
+ assert_unreached("addBatch() error callback invoked: " + error.name + " msg: " + error.message);
});
calendar = tizen.calendar.getDefaultCalendar("EVENT");
t.step(function () {
errorCallback = t.step_func(function (error) {
- assert_unreached("addBatch() error callback shoult not be invoked: " + error.name + " msg: " + error.message);
+ assert_unreached("addBatch() error callback invoked: " + error.name + " msg: " + error.message);
});
calendar = tizen.calendar.getDefaultCalendar("EVENT");
firstFilter, secondFilter, eventCalendar = tizen.calendar.getDefaultCalendar("EVENT");
t.step(function () {
-
-
onFindSuccessCB = t.step_func(function (items) {
succCount--;
if (succCount === 0) {
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/calendar.html
//==== TEST_CRITERIA MC
var t = async_test(document.title), successCallback, eventInit,
- calendar, ev, conversionTable, exceptionName = "TypeMismatchError", i, errorCallback,
+ calendar, ev, conversionTable, exceptionName, i, errorCallback,
filter, sortMode;
t.step(function () {
eventInit = {description:"HTML5 Introduction",
assert_throws(NOT_FOUND_EXCEPTION, function () {
calendar.get(ev1.id);
- }, "NotFoundError exception should be thrown.");
+ }, "Trying to get removed id");
}, document.title);
</script>
calendar = tizen.calendar.getDefaultCalendar("EVENT");
assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
calendar.removeBatch([123], successCallback, {onerror:function (){}});
- }, "TypeMismatchError should be thrown - given incorrect ids.");
+ }, "Given incorrect ids.");
t.done();
});
//==== LABEL Check whether removeChangeListener() works correctly
//==== SPEC Tizen Web API:Social:Calendar:Calendar:removeChangeListener M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/calendar.html
+//==== ONLOAD_DELAY 10
//==== TEST_CRITERIA MMINA MAST MR
-var t = async_test(document.title, {timeout: 3000}),
- watcherId = 0, watcher, ev, calendar, start, end, rule, i = 0,
- onError, onsuccess, filter, returnedValue;
+setup({timeout: 10000});
+
+var t = async_test(document.title, {timeout: 10000}),
+ watcherId = 0, watcher, ev, calendar, start, end, rule,
+ findError, findSuccess, filter, returnedValue;
t.step(function () {
- onError = t.step_func(function (events) {
- assert_unreached("removeChangeListener failed");
- });
- onsuccess = t.step_func(function (events) {
- calendar.remove(events[0].id);
+ findSuccess = t.step_func(function (events) {
+ assert_greater_than(events.length, 0, "Received empty events array");
returnedValue = calendar.removeChangeListener(watcherId);
+
+ calendar.remove(events[0].id);
assert_equals(returnedValue, undefined,
"Incorect returned value from removeChangeListener method");
- if (i !== 3) {
+ setTimeout(t.step_func(function () {
t.done();
- }
- assert_unreached("removeChangeListener failed");
+ }, 3000));
+ });
+
+ findError = t.step_func(function (error) {
+ assert_unreached("find() error callback: name:" + error.name + ", msg:" + error.message);
});
+
watcher = {
onitemsadded: t.step_func(function (items) {
- calendar.find(onsuccess, onError, filter);
+ calendar.find(findSuccess, findError, filter);
}),
onitemsremoved: t.step_func( function (ids) {
- i = 3;
+ assert_unreached("onitemsremoved() invoked with ids = " + ids);
})
};
//==== SPEC Tizen Web API:Social:Calendar:Calendar:removeChangeListener M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/calendar.html
//==== TEST_CRITERIA MMINA
-var listenerArrayEvent = [];
-var listenerArrayTask = [];
-var eventWatcher = {
- onitemsadded: function (events) {
- },
- onitemsupdated: function (events) {
- },
- onitemsremoved: function (ids) {
- }
-};
-
-var taskWatcher = {
- onitemsadded: function (tasks) {
- },
- onitemsupdated: function (tasks) {
- },
- onitemsremoved: function (ids) {
- }
-};
test(function () {
- var eventCalendar = tizen.calendar.getDefaultCalendar("EVENT"),
+ var listenerArrayEvent = [], listenerArrayTask = [], eventWatcher, taskWatcher,
+ eventCalendar = tizen.calendar.getDefaultCalendar("EVENT"),
taskCalendar = tizen.calendar.getDefaultCalendar("TASK");
+ eventWatcher = {
+ onitemsadded: function (events) {
+ },
+ onitemsupdated: function (events) {
+ },
+ onitemsremoved: function (ids) {
+ }
+ };
+
+ taskWatcher = {
+ onitemsadded: function (tasks) {
+ },
+ onitemsupdated: function (tasks) {
+ },
+ onitemsremoved: function (ids) {
+ }
+ };
+
if (!listenerArrayTask.length) {
- listenerArrayTask.push(
- taskCalendar.addChangeListener(taskWatcher)
- );
+ listenerArrayTask.push(taskCalendar.addChangeListener(taskWatcher));
}
taskCalendar.removeChangeListener(listenerArrayTask[0]);
listenerArrayEvent.shift();
if (!listenerArrayEvent.length) {
- listenerArrayEvent.push(
- eventCalendar.addChangeListener(eventWatcher)
- );
+ listenerArrayEvent.push(eventCalendar.addChangeListener(eventWatcher));
}
taskCalendar.removeChangeListener(listenerArrayTask[0], 1);
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/calendar.html
//==== PRIORITY P1
//==== TEST_CRITERIA MMINA
-var t = async_test(document.title), succCount = 3, onUpdateBatchErrorCB, onUpdateBatchSuccessCB, i, eventCalendar = tizen.calendar.getDefaultCalendar("EVENT"),
- events, onAddBatchSuccessCB;
+var t = async_test(document.title), succCount = 3, onUpdateBatchErrorCB, onUpdateBatchSuccessCB,
+ i, eventCalendar = tizen.calendar.getDefaultCalendar("EVENT"), events, onAddBatchSuccessCB;
t.step(function () {
onUpdateBatchErrorCB = t.step_func(function (response) {
});
onUpdateBatchSuccessCB = t.step_func(function () {
- if (--succCount === 0) {
+ succCount--;
+ if (succCount === 0) {
t.done();
}
});
eventCalendar.updateBatch();
});
- this.done();
+ t.done();
});
</script>
});
onUpdateBatchSuccessCB = t.step_func(function () {
- if (--succCount === 0) {
+ succCount--;
+ if (succCount === 0) {
t.done();
}
});
*/
-var CalendarType = { "EVENT":2, "TASK":1 };
-var CalendarTextFormat = { "ICALENDAR_20":0, "VCALENDAR_10":1 };
var AlarmMethod = { "SOUND":0, "DISPLAY":1 };
var RecurrenceRuleFrequency = { "DAILY":0, "WEEKLY":1, "MONTHLY":2, "YEARLY":3 };
-var EventAvailability = { "BUSY":0, "FREE":1 };
-var AttendeeType = { "INDIVIDUAL":0, "GROUP":1, "RESOURCE":2, "ROOM":3, "UNKNOWN":4 };
-var AttendeeStatus = { "PENDING":0, "ACCEPTED":1, "DECLINED":2, "TENTATIVE":3, "DELEGATED":4, "COMPLETED":5, "IN_PROCESS":6 };
-var AttendeeRole = { "REQ_PARTICIPANT":0, "OPT_PARTICIPANT":1, "NON_PARTICIPANT":2, "CHAIR":3 };
-var CalendarItemPriority = { "HIGH":0, "MEDIUM":1, "LOW":2 };
-var CalendarItemVisibility = { "PUBLIC":0, "PRIVATE":1, "CONFIDENTIAL":2 };
-var CalendarItemStatus = { "TENTATIVE":0, "CONFIRMED":1, "CANCELLED":2, "NEEDS_ACTION":3, "IN_PROCESS":4, "COMPLETED":5 };
var DAYS = ["MO", "TU", "WE", "TH", "FR", "SA", "SU"];
-var TYPE_MISMATCH_ERR = 'TypeMismatchError';
-var INVALID_VALUES_ERR = 'InvalidValuesError';
-var NOT_SUPPORTED_ERR = 'NotSupportedError';
-var NOT_FOUND_ERR = 'NotFoundError';
-
-
function events_to_ids(events) {
var ids = [];
for (var i=0; i<events.length; i++) {
</spec>
</specs>
</testcase>
- <testcase purpose="Check Calendar addBatch method: error events" type="compliance" status="approved" component="TizenAPI/Social/Calendar" execution_type="auto" priority="P2" id="Calendar_Calendar_addBatch_error_events">
+ <testcase purpose="Check if Calendar.addBatch method throws exception when null given as items" type="compliance" status="approved" component="TizenAPI/Social/Calendar" execution_type="auto" priority="P2" id="Calendar_Calendar_addBatch_error_events">
<description>
<test_script_entry>/opt/tct-calendar-tizen-tests/calendar/Calendar_Calendar_addBatch_error_events.html</test_script_entry>
</description>
</spec>
</specs>
</testcase>
- <testcase purpose="Check whether removeChangeListener() works correctly" type="compliance" status="approved" component="TizenAPI/Social/Calendar" execution_type="auto" priority="P1" id="Calendar_removeChangeListener">
+ <testcase purpose="Check whether removeChangeListener() works correctly" type="compliance" onload_delay="10" status="approved" component="TizenAPI/Social/Calendar" execution_type="auto" priority="P1" id="Calendar_removeChangeListener">
<description>
<test_script_entry>/opt/tct-calendar-tizen-tests/calendar/Calendar_removeChangeListener.html</test_script_entry>
</description>
<test_script_entry>/opt/tct-calendar-tizen-tests/calendar/Calendar_CalendarEvent_attri_id.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="Check Calendar addBatch method: error events" component="TizenAPI/Social/Calendar" execution_type="auto" id="Calendar_Calendar_addBatch_error_events">
+ <testcase purpose="Check if Calendar.addBatch method throws exception when null given as items" component="TizenAPI/Social/Calendar" execution_type="auto" id="Calendar_Calendar_addBatch_error_events">
<description>
<test_script_entry>/opt/tct-calendar-tizen-tests/calendar/Calendar_Calendar_addBatch_error_events.html</test_script_entry>
</description>
<test_script_entry>/opt/tct-calendar-tizen-tests/calendar/Calendar_removeBatch_with_successCallback.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="Check whether removeChangeListener() works correctly" component="TizenAPI/Social/Calendar" execution_type="auto" id="Calendar_removeChangeListener">
+ <testcase purpose="Check whether removeChangeListener() works correctly" onload_delay="10" component="TizenAPI/Social/Calendar" execution_type="auto" id="Calendar_removeChangeListener">
<description>
<test_script_entry>/opt/tct-calendar-tizen-tests/calendar/Calendar_removeChangeListener.html</test_script_entry>
</description>