Mainly related to indentation.
Change-Id: Ie29f3385b533aaeb3dc6880dc972f78371a2c442
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/calendar.html
//==== TEST_CRITERIA CBOA CBT
var t = async_test(document.title, {timeout: 90000}),
- watcher, event_init, calendar, ev;
+ watcher, eventInit, calendar, ev;
setup({timeout: 90000});
t.step(function () {
calendar.addChangeListener(watcher);
- event_init = {
+ eventInit = {
description: "HTML5 Introduction",
summary: "HTML5 Webinar ",
startDate: new tizen.TZDate(2011, 3, 30, 10, 0),
location: "Huesca"
};
- ev = new tizen.CalendarEvent(event_init);
+ ev = new tizen.CalendarEvent(eventInit);
calendar.add(ev);
});
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/calendar.html
//==== TEST_CRITERIA CBOA CBT
var t = async_test(document.title, {timeout: 90000}),
- watcher, event_init, calendar, ev, ev_get;
+ watcher, eventInit, calendar, ev, evGet;
setup({timeout: 90000});
t.step(function () {
watcher = {
onitemsadded: t.step_func(function (items) {
- ev_get = calendar.get(ev.id);
- ev_get.summary = "updated summary";
- calendar.update(ev_get);
+ evGet = calendar.get(ev.id);
+ evGet.summary = "updated summary";
+ calendar.update(evGet);
}),
onitemsupdated: t.step_func(function (items) {
calendar.addChangeListener(watcher);
- event_init = {
+ eventInit = {
description: "HTML5 Introduction",
summary: "HTML5 Webinar ",
startDate: new tizen.TZDate(2011, 3, 30, 10, 0),
location: "Huesca"
};
- ev = new tizen.CalendarEvent(event_init);
+ ev = new tizen.CalendarEvent(eventInit);
calendar.add(ev);
});
test(function () {
var retrievedEvent, originalEvent,
eventCalendar = tizen.calendar.getDefaultCalendar("EVENT");
- originalEvent = new tizen.CalendarEvent({
+ originalEvent = new tizen.CalendarEvent({
description: "Tizen description",
summary: "Tizen summary",
isAllDay: false,
successCallback = t.step_func(function (calendars) {
assert_unreached("TypeMismatchError should be thrown");
});
+
conversionTable = getTypeConversionExceptions("functionObject", true);
for (i = 0; i < conversionTable.length; i++) {
errorCallback = conversionTable[i][0];
exceptionName = conversionTable[i][1];
- assert_throws({name: exceptionName},
- function () {
- calendar = tizen.calendar.getCalendars("EVENT", successCallback, errorCallback);
- }, exceptionName + " should be thrown - given incorrect items.");
+ assert_throws({name: exceptionName}, function () {
+ calendar = tizen.calendar.getCalendars("EVENT", successCallback, errorCallback);
+ }, exceptionName + " should be thrown - given incorrect errorCallback");
}
+
t.done();
});
<div id="log"></div>
<script>
//==== TEST: CalendarManager_getCalendars_errorCallback_invalid_cb
-//==== LABEL Test if putting a user errorCallback object in getCalendars method which was not created through the constructor but has all the properties failes.
+//==== LABEL Check if CalendarManager.getCalendars method throws exception when errorCallback is invalid
//==== PRIORITY: P2
//==== 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 MTCB
var t = async_test(document.title),
- calendar, exceptionName, successCallback, errorCallback, exceptionName = "TypeMismatchError";
+ calendar, successCallback, errorCallback;
t.step(function () {
successCallback = t.step_func(function (calendars) {
assert_unreached("Invalid callback invoked");
});
+
errorCallback = {
onerror: t.step_func(function () {
assert_unreached("Invalid callback invoked");
})
};
- assert_throws({name: exceptionName},
- function () {
- calendar = tizen.calendar.getCalendars("EVENT", successCallback, errorCallback);
- }, exceptionName + " should be thrown - given incorrect items.");
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
+ calendar = tizen.calendar.getCalendars("EVENT", successCallback, errorCallback);
+ }, "Given incorrect errorCallback");
+
t.done();
});
successCallback = conversionTable[i][0];
exceptionName = conversionTable[i][1];
- assert_throws({name: exceptionName},
- function () {
- calendar = tizen.calendar.getCalendars("EVENT", successCallback);
+ assert_throws({name: exceptionName}, function () {
+ calendar = tizen.calendar.getCalendars("EVENT", successCallback);
}, exceptionName + " should be thrown - given incorrect success callback.");
}
+
t.done();
});
<div id="log"></div>
<script>
//==== TEST: CalendarManager_getCalendars_successCallback_invalid_cb
-//==== LABEL Test if putting a user successCallback object in getCalendars method which was not created through the constructor but has all the properties failes.
+//==== LABEL Check if CalendarManager.getCalendars method throws exception when successCallback is invalid
//==== PRIORITY: P2
//==== 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 MTCB
-var t = async_test(document.title),
- calendar, exceptionName, successCallback, exceptionName = "TypeMismatchError";
+var t = async_test(document.title), calendar, successCallback;
t.step(function () {
successCallback = {
onsuccess: t.step_func(function () {
assert_unreached("Invalid callback invoked");
})
};
- assert_throws({name: exceptionName},
- function () {
- calendar = tizen.calendar.getCalendars("EVENT", successCallback);
- }, exceptionName + " should be thrown - given incorrect items.");
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
+ calendar = tizen.calendar.getCalendars("EVENT", successCallback);
+ }, "Given incorrect successCallback");
+
t.done();
});
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/calendar.html
//==== TEST_CRITERIA MMA
test(function () {
- assert_throws(TYPE_MISMATCH_EXCEPTION,
- function () {
- tizen.calendar.getUnifiedCalendar();
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
+ tizen.calendar.getUnifiedCalendar();
});
}, document.title);
<body>
<div id="log"></div>
<script type="text/javascript">
-
-
//==== TEST: CalendarTask_attribute_date_valid_value
//==== LABEL Check various date attributes of CalendarTask
//==== SPEC Tizen Web API:Social:Calendar:CalendarItem:startDate A
test(function () {
var retrievedTask, originalTask,
taskCalendar = tizen.calendar.getDefaultCalendar("TASK");
- originalTask = new tizen.CalendarTask({
- startDate: new tizen.TZDate(2012, 2, 20, 10, 0),
- dueDate: new tizen.TZDate(2012, 2, 25, 10, 0),
- completedDate: new tizen.TZDate(2012, 2, 24, 10, 0),
- progress: 100
- });
+
+ originalTask = new tizen.CalendarTask({
+ startDate: new tizen.TZDate(2012, 2, 20, 10, 0),
+ dueDate: new tizen.TZDate(2012, 2, 25, 10, 0),
+ completedDate: new tizen.TZDate(2012, 2, 24, 10, 0),
+ progress: 100
+ });
taskCalendar.add(originalTask);
retrievedTask = taskCalendar.get(originalTask.id);
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/calendar.html
//==== TEST_CRITERIA
- var description = "set attri value: isAllDay & duration & organizer.";
- test(function () {
- var event_init = {description:"HTML5 Introduction",
- summary:"HTML5 Webinar ",
- startDate: new tizen.TZDate(2011, 3, 30, 10, 0),
- duration: new tizen.TimeDuration(1, "HOURS"),
- location:"Huesca"},
- ev = new tizen.CalendarEvent(event_init);
+test(function () {
+ var event_init = {description:"HTML5 Introduction",
+ summary:"HTML5 Webinar ",
+ startDate: new tizen.TZDate(2011, 3, 30, 10, 0),
+ duration: new tizen.TimeDuration(1, "HOURS"),
+ location:"Huesca"},
+ ev = new tizen.CalendarEvent(event_init);
- ev.isAllDay = false;
- ev.duration = new tizen.TimeDuration(1, "HOURS"),
- ev.organizer = "Mr. Jones";
- assert_equals(ev.isAllDay, false);
- assert_not_equals(ev.duration, null);
- assert_equals(ev.organizer, "Mr. Jones");
+ ev.isAllDay = false;
+ ev.duration = new tizen.TimeDuration(1, "HOURS"),
+ ev.organizer = "Mr. Jones";
+ assert_equals(ev.isAllDay, false, "Incorrect isAllDay");
+ assert_not_equals(ev.duration, null, "Incorrect duration");
+ assert_equals(ev.organizer, "Mr. Jones", "Incorrect organizer");
}, document.title);
</script>
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/calendar.html
//==== TEST_CRITERIA
- var description = "set attri value: summary & geolocation& priority.";
- test(function () {
- var event_init = {description:"HTML5 Introduction",
- summary:"HTML5 Webinar ",
- startDate: new tizen.TZDate(2011, 3, 30, 10, 0),
- duration: new tizen.TimeDuration(1, "HOURS"),
- location:"Huesca"},
- ev = new tizen.CalendarEvent(event_init);
+test(function () {
+ var event_init = {description:"HTML5 Introduction",
+ summary:"HTML5 Webinar ",
+ startDate: new tizen.TZDate(2011, 3, 30, 10, 0),
+ duration: new tizen.TimeDuration(1, "HOURS"),
+ location:"Huesca"},
+ ev = new tizen.CalendarEvent(event_init);
- ev.summary = "check if set attribute value successful after create ev";
- ev.geolocation = new tizen.SimpleCoordinates(60.175, 24.934);
- ev.priority = "HIGH";
- assert_equals(ev.summary, "check if set attribute value successful after create ev");
- assert_not_equals(ev.geolocation, null);
- assert_equals(ev.priority, "HIGH");
+ ev.summary = "check if set attribute value successful after create ev";
+ ev.geolocation = new tizen.SimpleCoordinates(60.175, 24.934);
+ ev.priority = "HIGH";
+ assert_equals(ev.summary, "check if set attribute value successful after create ev", "Incorrect summary");
+ assert_not_equals(ev.geolocation, null, "Incorrect geolocation");
+ assert_equals(ev.priority, "HIGH", "Incorrect priority");
}, document.title);
</script>
//==== TEST_CRITERIA MC
test(function (){
- assert_throws(TYPE_MISMATCH_EXCEPTION, function (){
- tizen.calendar.getCalendars("EVENT", false);
- }, "TypeMismatchError exception.");
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function (){
+ tizen.calendar.getCalendars("EVENT", false);
+ }, "TypeMismatchError exception.");
}, document.title);
</script>
<html>
<head>
<title>Calendar_CalendarManager_getDefaultCalendar_CalendarType_error</title>
- <link rel="author" title="Intel" href="http://www.intel.com/"/>
- <link rel="help" href="https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/calendar.html" />
-<meta name="assert" content="Check that throw an exception"/>
-<meta name="flags" content="" />
<script type="text/javascript" src="support/unitcommon.js"></script>
</head>
<body>
//==== TEST_CRITERIA MC
test(function (){
- assert_throws(TYPE_MISMATCH_EXCEPTION, function (){
- tizen.calendar.getDefaultCalendar("123");
- }, "TypeMismatchError exception.");
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function (){
+ tizen.calendar.getDefaultCalendar("123");
+ }, "TypeMismatchError exception.");
}, document.title);
</script>
<html>
<head>
<title>Calendar_CalendarManager_getDefaultCalendar_null</title>
- <link rel="author" title="Intel" href="http://www.intel.com/"/>
- <link rel="help" href="https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/calendar.html" />
-<meta name="assert" content="Check that throw an exception"/>
-<meta name="flags" content="" />
<script type="text/javascript" src="support/unitcommon.js"></script>
<script src="support/calendar_common.js"></script>
</head>
//==== TEST_CRITERIA MC
test(function (){
- assert_throws(TYPE_MISMATCH_EXCEPTION, function (){
- tizen.calendar.getDefaultCalendar(null);
- }, "TypeMismatchError exception.");
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function (){
+ tizen.calendar.getDefaultCalendar(null);
+ }, "TypeMismatchError exception.");
}, document.title);
</script>
//==== 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,
- calendar, conversionTable, exceptionName = "TypeMismatchError", i, errorCallback;
+ calendar, conversionTable, exceptionName, i, errorCallback;
t.step(function () {
calendar = tizen.calendar.getDefaultCalendar("EVENT");
successCallback = t.step_func(function () {
});
+
conversionTable = getTypeConversionExceptions("functionObject", true);
for (i = 0; i < conversionTable.length; i++) {
errorCallback = conversionTable[i][0];
exceptionName = conversionTable[i][1];
- assert_throws({name: exceptionName},
- function () {
- calendar.find(successCallback, errorCallback);
- }, exceptionName + " should be thrown - given incorrect successCallback.");
+ assert_throws({name: exceptionName}, function () {
+ calendar.find(successCallback, errorCallback);
+ }, exceptionName + " should be thrown - given incorrect errorCallback.");
}
+
t.done();
});
//==== 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), eventSearchSuccessCallback,
- errorCallback, ev1, event1, calendar, filter,
- exceptionName = "TypeMismatchError";
+ errorCallback, ev1, event1, calendar, filter;
t.step(function (){
eventSearchSuccessCallback = t.step_func(function (events) {
- assert_unreached("Invalid callback invoked: ");
+ assert_unreached("Success callback invoked");
});
+
errorCallback = {
onerror: t.step_func(function (items) {
- assert_unreached("Invalid callback invoked: ");
+ assert_unreached("Invalid error callback invoked");
})
};
event1 = {description: "HTML5 Introduction",
calendar = tizen.calendar.getDefaultCalendar("EVENT");
calendar.add(ev1);
filter = {attributeName: "summary", matchFlag: "CONTAINS", matchValue: "Tizen"};
- assert_throws({name: exceptionName},
- function () {
- calendar.find(eventSearchSuccessCallback, errorCallback);
- }, exceptionName + " should be thrown - given incorrect sortMode.");
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
+ calendar.find(eventSearchSuccessCallback, errorCallback);
+ }, "Given incorrect errorCallback.");
+
cleanup(calendar);
t.done();
});
//==== SPEC Tizen Web API:Social:Calendar:Calendar:find 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), successCallback, event_init,
- calendar, ev, conversionTable, exceptionName = "TypeMismatchError", i, errorCallback,
+var t = async_test(document.title), successCallback, eventInit,
+ calendar, ev, conversionTable, exceptionName, i, errorCallback,
filter;
t.step(function () {
- event_init = {description:"HTML5 Introduction",
+ eventInit = {description:"HTML5 Introduction",
summary:"HTML5 Webinar ",
startDate: new tizen.TZDate(2011, 3, 30, 10, 0),
duration: new tizen.TimeDuration(1, "HOURS"),
location:"Huesca"};
calendar = tizen.calendar.getDefaultCalendar("EVENT");
- ev = new tizen.CalendarEvent(event_init);
+ ev = new tizen.CalendarEvent(eventInit);
calendar.add(ev);
successCallback = t.step_func(function () {
});
+
errorCallback = t.step_func(function () {
});
+
conversionTable = getTypeConversionExceptions("object", true);
for (i = 0; i < conversionTable.length; i++) {
filter = conversionTable[i][0];
exceptionName = conversionTable[i][1];
- assert_throws({name: exceptionName},
- function () {
- calendar.find(successCallback, errorCallback, filter);
+ assert_throws({name: exceptionName}, function () {
+ calendar.find(successCallback, errorCallback, filter);
}, exceptionName + " should be thrown - given incorrect filter. " + format_value(filter));
}
+
cleanup(calendar);
t.done();
});
//==== SPEC Tizen Web API:Social:Calendar:Calendar:find 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), successCallback, event_init,
+var t = async_test(document.title), successCallback, eventInit,
calendar, ev, conversionTable, exceptionName = "TypeMismatchError", i, errorCallback,
filter, sortMode;
t.step(function () {
- event_init = {description:"HTML5 Introduction",
+ eventInit = {description:"HTML5 Introduction",
summary:"HTML5 Webinar ",
startDate: new tizen.TZDate(2011, 3, 30, 10, 0),
duration: new tizen.TimeDuration(1, "HOURS"),
location:"Huesca"};
calendar = tizen.calendar.getDefaultCalendar("EVENT");
- ev = new tizen.CalendarEvent(event_init);
+ ev = new tizen.CalendarEvent(eventInit);
calendar.add(ev);
+
successCallback = t.step_func(function () {
});
+
errorCallback = t.step_func(function () {
});
+
filter = new tizen.AttributeFilter("summary", "CONTAINS", "Webinar");
conversionTable = getTypeConversionExceptions("object", true);
for (i = 0; i < conversionTable.length; i++) {
sortMode = conversionTable[i][0];
exceptionName = conversionTable[i][1];
- assert_throws({name: exceptionName},
- function () {
- calendar.find(successCallback, errorCallback, filter, sortMode);
+ assert_throws({name: exceptionName}, function () {
+ calendar.find(successCallback, errorCallback, filter, sortMode);
}, exceptionName + " should be thrown - given incorrect sortMode. " + format_value(sortMode));
}
+
cleanup(calendar);
t.done();
});
calendar.add(ev1);
calendar.add(ev2);
filter = new tizen.AttributeFilter("summary", "CONTAINS", "Tizen");
- assert_throws({name: exceptionName},
- function () {
- calendar.find(eventSearchSuccessCallback, errorCallback,
- filter, sortMode);
+ assert_throws({name: exceptionName}, function () {
+ calendar.find(eventSearchSuccessCallback, errorCallback, filter, sortMode);
}, exceptionName + " should be thrown - given incorrect sortMode.");
+
cleanup(calendar);
t.done();
});
//==== 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,
- calendar, conversionTable, exceptionName = "TypeMismatchError", i;
+ calendar, conversionTable, exceptionName, i;
t.step(function () {
calendar = tizen.calendar.getDefaultCalendar("EVENT");
conversionTable = getTypeConversionExceptions("functionObject", false);
successCallback = conversionTable[i][0];
exceptionName = conversionTable[i][1];
- assert_throws({name: exceptionName},
- function () {
- calendar.find(successCallback);
+ assert_throws({name: exceptionName}, function () {
+ calendar.find(successCallback);
}, exceptionName + " should be thrown - given incorrect successCallback.");
}
+
t.done();
});
//==== SPEC Tizen Web API:Social:Calendar:Calendar:find 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), successCallback,
- calendar, exceptionName = "TypeMismatchError";
+var t = async_test(document.title), successCallback, calendar;
t.step(function () {
successCallback = {
onsuccess: t.step_func(function (items) {
- assert_unreached("Invalid callback invoked: ");
+ assert_unreached("Invalid success callback invoked");
})
};
+
calendar = tizen.calendar.getDefaultCalendar("EVENT");
- assert_throws({name: exceptionName},
- function () {
- calendar.find(successCallback);
- }, exceptionName + " should be thrown - given incorrect successCallback.");
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
+ calendar.find(successCallback);
+ }, "Given incorrect successCallback");
+
t.done();
});
t.step(function () {
-
taskSearchSuccessCallback = t.step_func(function (events) {
- assert_equals(returnedValue, undefined, "Incorect returned value from remove()");
+ assert_equals(returnedValue, undefined, "Incorect returned value from remove()");
assert_equals(events.length, 0, "Task should not be found.");
+
t.done();
});
+
taskSearchErrorCallback = t.step_func(function (error) {
assert_unreached("find() error callaback invoked: " + error.name + ": " + error.message);
});
//==== 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), i,
- calendar, ev1, ev_1, successCallback, conversionTable, errorCallback, exceptionName;
+ calendar, eventInit, calendarEvent, successCallback, conversionTable, errorCallback, exceptionName;
t.step(function () {
successCallback = t.step_func(function () {
});
- ev1 = {description:"HTML5 Introduction",
+ eventInit = {description:"HTML5 Introduction",
summary:"HTML5 Webinar ",
startDate: new tizen.TZDate(2011, 3, 30, 10, 0),
duration: new tizen.TimeDuration(1, "HOURS"),
location:"Huesca"};
calendar = tizen.calendar.getDefaultCalendar("EVENT");
- ev_1 = new tizen.CalendarEvent(ev1);
- calendar.add(ev_1);
+ calendarEvent = new tizen.CalendarEvent(eventInit);
+ calendar.add(calendarEvent);
conversionTable = getTypeConversionExceptions("functionObject", true);
for (i = 0; i < conversionTable.length; i++) {
errorCallback = conversionTable[i][0];
exceptionName = conversionTable[i][1];
- assert_throws({name: exceptionName},
- function () {
- calendar.removeBatch([ev_1.id, 123], successCallback, errorCallback);
- }, exceptionName + " should be thrown - given incorrect id.");
+ assert_throws({name: exceptionName}, function () {
+ calendar.removeBatch([calendarEvent.id, 123], successCallback, errorCallback);
+ }, exceptionName + " should be thrown - given incorrect ids.");
}
cleanup(calendar);
t.done();
<script>
//==== TEST: Calendar_removeBatch_errorCallback_invalid_cb
-//==== LABEL Test if putting a user errorCallback object in removeBatch which was not created through the constructor but has all the properties failes.
+//==== LABEL Check if Calendar.removeBatch method throws exception when errorCallback is invalid
//==== PRIORITY: P2
//==== SPEC Tizen Web API:Social:Calendar:Calendar:removeBatch M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/calendar.html
t.step(function () {
successCallback = t.step_func(function () {
});
+
calendar = tizen.calendar.getDefaultCalendar("EVENT");
- assert_throws(TYPE_MISMATCH_EXCEPTION,
- function () {
- calendar.removeBatch([123], successCallback, {onerror:function (){}});
- }, "TypeMismatchError should be thrown - given incorrect id.");
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
+ calendar.removeBatch([123], successCallback, {onerror:function (){}});
+ }, "TypeMismatchError should be thrown - given incorrect ids.");
t.done();
});
//==== SPEC Tizen Web API:Social:Calendar:Calendar:removeBatch 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), i, id, exceptionName,
+var t = async_test(document.title), i, ids, exceptionName,
calendar, conversionTable;
t.step(function () {
conversionTable = getTypeConversionExceptions("array", false);
calendar = tizen.calendar.getDefaultCalendar("EVENT");
for (i = 0; i < conversionTable.length; i++) {
- id = conversionTable[i][0];
+ ids = conversionTable[i][0];
exceptionName = conversionTable[i][1];
- assert_throws({name: exceptionName},
- function () {
- calendar.removeBatch(id);
- }, exceptionName + " should be thrown - given incorrect id.");
+ assert_throws({name: exceptionName}, function () {
+ calendar.removeBatch(ids);
+ }, exceptionName + " should be thrown - given incorrect ids.");
}
t.done();
});
//==== 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), i,
- calendar, ev1, ev2, ev_1, ev_2, successCallback, conversionTable, exceptionName;
+ calendar, eventInit1, eventInit2, calendarEvent1, calendarEvent2, successCallback, conversionTable, exceptionName;
t.step(function () {
successCallback = t.step_func(function () {
});
- ev1 = {description:"HTML5 Introduction",
+ eventInit1 = {description:"HTML5 Introduction",
summary:"HTML5 Webinar ",
startDate: new tizen.TZDate(2011, 3, 30, 10, 0),
duration: new tizen.TimeDuration(1, "HOURS"),
location:"Huesca"};
- ev2 = {description:"HTML5 Introduction",
+ eventInit2 = {description:"HTML5 Introduction",
summary:"HTML5 Webinar ",
startDate: new tizen.TZDate(2011, 3, 30, 10, 0),
duration: new tizen.TimeDuration(1, "HOURS"),
location:"Huesca"};
calendar = tizen.calendar.getDefaultCalendar("EVENT");
- ev_1 = new tizen.CalendarEvent(ev1);
- calendar.add(ev_1);
- ev_2 = new tizen.CalendarEvent(ev2);
- calendar.add(ev_2);
+ calendarEvent1 = new tizen.CalendarEvent(eventInit1);
+ calendar.add(calendarEvent1);
+ calendarEvent2 = new tizen.CalendarEvent(eventInit2);
+ calendar.add(calendarEvent2);
conversionTable = getTypeConversionExceptions("functionObject", true);
for (i = 0; i < conversionTable.length; i++) {
successCallback = conversionTable[i][0];
exceptionName = conversionTable[i][1];
- assert_throws({name: exceptionName},
- function () {
- calendar.removeBatch([ev_1.id, ev_2.id], successCallback);
- }, exceptionName + " should be thrown - given incorrect id.");
+ assert_throws({name: exceptionName}, function () {
+ calendar.removeBatch([calendarEvent1.id, calendarEvent2.id], successCallback);
+ }, exceptionName + " should be thrown - given incorrect successCallback.");
}
+
cleanup(calendar);
t.done();
});
<script>
//==== TEST: Calendar_removeBatch_successCallback_invalid_cb
-//==== LABEL Test if putting a user successCallback object in removeBatch which was not created through the constructor but has all the properties failes.
+//==== LABEL Check if Calendar.removeBatch method throws exception when successCallback is invalid
//==== PRIORITY: P2
//==== SPEC Tizen Web API:Social:Calendar:Calendar:removeBatch 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),
- calendar, ev1, ev_1;
+ calendar, eventInit, calendarEvent;
t.step(function () {
- ev1 = {description:"HTML5 Introduction",
+ eventInit = {description:"HTML5 Introduction",
summary:"HTML5 Webinar ",
startDate: new tizen.TZDate(2011, 3, 30, 10, 0),
duration: new tizen.TimeDuration(1, "HOURS"),
location:"Huesca"};
calendar = tizen.calendar.getDefaultCalendar("EVENT");
- ev_1 = new tizen.CalendarEvent(ev1);
- calendar.add(ev_1);
- assert_throws(TYPE_MISMATCH_EXCEPTION,
- function () {
- calendar.removeBatch([ev_1.id], {onsuccess:function (){}});
- }, "TypeMismatchError should be thrown - given incorrect id.");
+ calendarEvent = new tizen.CalendarEvent(eventInit);
+ calendar.add(calendarEvent);
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
+ calendar.removeBatch([calendarEvent.id], {onsuccess:function (){}});
+ }, "Given incorrect id.");
+
cleanup(calendar);
t.done();
});
Tomasz Kusmierz <t.kusmierz@samsung.com>
-->
+<html>
<head>
<title>Calendar_updateBatch</title>
<meta charset="utf-8">
Beata Koziarek <b.koziarek@samsung.com>
-->
+<html>
<head>
<title>Calendar_updateBatch_errorCallback_TypeMismatch</title>
<meta charset="utf-8">
errorCB = conversionTable[i][0];
exceptionName = conversionTable[i][1];
- assert_throws({name: exceptionName},
- function () {
- calendar.updateBatch([], successCB, errorCB);
- }, exceptionName + " should be thrown - given incorrect successCallback.");
+ assert_throws({name: exceptionName}, function () {
+ calendar.updateBatch([], successCB, errorCB);
+ }, exceptionName + " should be thrown - given incorrect errorCallback.");
}
t.done();
});
Beata Koziarek <b.koziarek@samsung.com>
-->
+<html>
<head>
<title>Calendar_updateBatch_errorCallback_invalid_cb</title>
<meta charset="utf-8">
//==== 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),
- calendar, successCB, errorCB, exceptionName = "TypeMismatchError";
+ calendar, successCB, errorCB;
t.step(function (){
successCB = t.step_func(function (events) {
assert_unreached("Mismatcherror should be called");
});
+
errorCB = {
onerror: t.step_func(function (e) {
assert_unreached("Mismatcherror should be called");
})
};
+
calendar = tizen.calendar.getDefaultCalendar("EVENT");
- assert_throws({name: exceptionName},
- function () {
- calendar.updateBatch([], successCB, errorCB);
- }, exceptionName + " should be thrown - given incorrect error vallback.");
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
+ calendar.updateBatch([], successCB, errorCB);
+ }, "Given incorrect errorCallback.");
+
cleanup(calendar);
t.done();
});
Beata Koziarek <b.koziarek@samsung.com>
-->
+<html>
<head>
<title>Calendar_updateBatch_items_TypeMismatch</title>
<meta charset="utf-8">
events = conversionTable[i][0];
exceptionName = conversionTable[i][1];
- assert_throws({name: exceptionName},
- function () {
- calendar.updateBatch(events);
+ assert_throws({name: exceptionName}, function () {
+ calendar.updateBatch(events);
}, exceptionName + " should be thrown - given incorrect items.");
}
cleanup(calendar);
Beata Koziarek <b.koziarek@samsung.com>
-->
+<html>
<head>
<title>Calendar_updateBatch_successCallback_TypeMismatch</title>
<meta charset="utf-8">
successCB = conversionTable[i][0];
exceptionName = conversionTable[i][1];
- assert_throws({name: exceptionName},
- function () {
- calendar.updateBatch(events, successCB);
+ assert_throws({name: exceptionName}, function () {
+ calendar.updateBatch(events, successCB);
}, exceptionName + " should be thrown - given incorrect successCallback.");
}
t.done();
Beata Koziarek <b.koziarek@samsung.com>
-->
+<html>
<head>
<title>Calendar_updateBatch_successCallback_invalid_cb</title>
<meta charset="utf-8">
<div id="log"></div>
<script>
//==== TEST: Calendar_updateBatch_successCallback_invalid_cb
-//==== LABEL Test if putting a user successCallback object which was not created through the constructor but has all the properties failes in updateBatch method.
+//==== LABEL Check if Calendar.updateBatch method throws exception when successCallback is invalid
//==== PRIORITY: P2
//==== SPEC Tizen Web API:Social:Calendar:Calendar:updateBatch 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), events = [],
- exp_location = "Shanghai", ev, event_init, calendar, successCB,
- exceptionName = "TypeMismatchError";
+ expLocation = "Shanghai", ev, eventInit, calendar, successCB;
t.step(function () {
successCB = {
onsuccess: t.step_func(function () {
assert_unreached("Invalid callback invoked.");
})
};
- event_init = {description:"HTML5 Introduction",
+ eventInit = {description:"HTML5 Introduction",
summary:"HTML5 Webinar ",
startDate: new tizen.TZDate(2011, 3, 30, 10, 0),
duration: new tizen.TimeDuration(1, "HOURS"),
location:"Huesca"};
calendar = tizen.calendar.getDefaultCalendar("EVENT");
- ev = new tizen.CalendarEvent(event_init);
+ ev = new tizen.CalendarEvent(eventInit);
events = [ev];
calendar.add(events[0]);
- events[0].location = exp_location;
- assert_throws({name: exceptionName},
- function () {
- calendar.updateBatch(events, successCB);
- }, exceptionName + " should be thrown - given incorrect sortMode.");
+ events[0].location = expLocation;
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
+ calendar.updateBatch(events, successCB);
+ }, "Given incorrect successCallback");
cleanup(calendar);
t.done();
});
Karol Surma <k.surma@samsung.com>
-->
+<html>
<head>
<title>Calendar_updateBatch_with_successCallback</title>
<meta charset="utf-8">
<div id="log"></div>
<script>
//==== TEST: Calendar_updateBatch_with_successCallback
-//==== LABEL Check whether 'updateBatch' method with successCallback works correctly updates several task items from the CalendarTask object asynchronously
+//==== LABEL Check if Calendar.updateBatch method works correctly with successCallback
//==== SPEC Tizen Web API:Social:Calendar:Calendar:updateBatch M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/calendar.html
//==== TEST_CRITERIA MOA
var t = async_test(document.title), events = [],
- exp_location = "Shanghai", ev, event_init, calendar, successCB;
+ expLocation = "Shanghai", ev, eventInit, calendar, successCB;
t.step(function (){
successCB = t.step_func(function (events) {
cleanup(calendar);
t.done();
});
- event_init = {description:"HTML5 Introduction",
+
+ eventInit = {description:"HTML5 Introduction",
summary:"HTML5 Webinar ",
startDate: new tizen.TZDate(2011, 3, 30, 10, 0),
duration: new tizen.TimeDuration(1, "HOURS"),
location:"Huesca"};
calendar = tizen.calendar.getDefaultCalendar("EVENT");
- ev = new tizen.CalendarEvent(event_init);
+ ev = new tizen.CalendarEvent(eventInit);
events = [ev];
calendar.add(events[0]);
- events[0].location = exp_location;
+ events[0].location = expLocation;
calendar.updateBatch(events, successCB);
});
Beata Koziarek <b.koziarek@samsung.com>
-->
+<html>
<head>
<title>Calendar_updateBatch_with_updateAllInstances</title>
<meta charset="utf-8">
<div id="log"></div>
<script>
//==== TEST: Calendar_updateBatch_with_updateAllInstances
-//==== LABEL Check whether 'updateBatch' method with updateAllInstances works correctly deletes several task items from the CalendarTask object asynchronously
+//==== LABEL Check if Calendar.updateBatch method works correctly
//==== SPEC Tizen Web API:Social:Calendar:Calendar:updateBatch M
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/calendar.html
//==== TEST_CRITERIA MOA
var t = async_test(document.title), events = [],
- exp_location = "Shanghai", ev, event_init, calendar, successCB, errorCB;
+ expLocation = "Shanghai", ev, eventInit, calendar, successCB, errorCB;
t.step(function (){
successCB = t.step_func(function (events){
cleanup(calendar);
t.done();
});
- errorCB = t.step_func(function (err){
+
+ errorCB = t.step_func(function (err) {
assert_unreached("errorCB should be called");
});
- event_init = {description:"HTML5 Introduction",
+
+ eventInit = {description:"HTML5 Introduction",
summary:"HTML5 Webinar ",
startDate: new tizen.TZDate(2011, 3, 30, 10, 0),
duration: new tizen.TimeDuration(1, "HOURS"),
location:"Huesca"};
calendar = tizen.calendar.getDefaultCalendar("EVENT");
- ev = new tizen.CalendarEvent(event_init);
+ ev = new tizen.CalendarEvent(eventInit);
events = [ev];
calendar.add(events[0]);
- events[0].location = exp_location;
+ events[0].location = expLocation;
calendar.updateBatch(events, successCB, errorCB, false);
});
Beata Koziarek <b.koziarek@samsung.com>
-->
+<html>
<head>
<title>Calendar_update_item_TypeMismatch</title>
<meta charset="utf-8">
badEvent = conversionTable[i][0];
exceptionName = conversionTable[i][1];
- assert_throws({name: exceptionName},
- function () {
- calendar.update(badEvent);
- }, exceptionName + " should be thrown - given incorrect items.");
+ assert_throws({name: exceptionName}, function () {
+ calendar.update(badEvent);
+ }, exceptionName + " should be thrown - given incorrect item");
}
cleanup(calendar);
t.done();
</spec>
</specs>
</testcase>
- <testcase purpose="Test if putting a user errorCallback object in getCalendars method which was not created through the constructor but has all the properties failes." type="compliance" status="approved" component="TizenAPI/Social/Calendar" execution_type="auto" priority="P2" id="CalendarManager_getCalendars_errorCallback_invalid_cb">
+ <testcase purpose="Check if CalendarManager.getCalendars method throws exception when errorCallback is invalid" type="compliance" status="approved" component="TizenAPI/Social/Calendar" execution_type="auto" priority="P2" id="CalendarManager_getCalendars_errorCallback_invalid_cb">
<description>
<test_script_entry>/opt/tct-calendar-tizen-tests/calendar/CalendarManager_getCalendars_errorCallback_invalid_cb.html</test_script_entry>
</description>
</spec>
</specs>
</testcase>
- <testcase purpose="Test if putting a user successCallback object in getCalendars method which was not created through the constructor but has all the properties failes." type="compliance" status="approved" component="TizenAPI/Social/Calendar" execution_type="auto" priority="P2" id="CalendarManager_getCalendars_successCallback_invalid_cb">
+ <testcase purpose="Check if CalendarManager.getCalendars method throws exception when successCallback is invalid" type="compliance" status="approved" component="TizenAPI/Social/Calendar" execution_type="auto" priority="P2" id="CalendarManager_getCalendars_successCallback_invalid_cb">
<description>
<test_script_entry>/opt/tct-calendar-tizen-tests/calendar/CalendarManager_getCalendars_successCallback_invalid_cb.html</test_script_entry>
</description>
</spec>
</specs>
</testcase>
- <testcase purpose="Test if putting a user errorCallback object in removeBatch which was not created through the constructor but has all the properties failes." type="compliance" status="approved" component="TizenAPI/Social/Calendar" execution_type="auto" priority="P2" id="Calendar_removeBatch_errorCallback_invalid_cb">
+ <testcase purpose="Check if Calendar.removeBatch method throws exception when errorCallback is invalid" type="compliance" status="approved" component="TizenAPI/Social/Calendar" execution_type="auto" priority="P2" id="Calendar_removeBatch_errorCallback_invalid_cb">
<description>
<test_script_entry>/opt/tct-calendar-tizen-tests/calendar/Calendar_removeBatch_errorCallback_invalid_cb.html</test_script_entry>
</description>
</spec>
</specs>
</testcase>
- <testcase purpose="Test if putting a user successCallback object in removeBatch which was not created through the constructor but has all the properties failes." type="compliance" status="approved" component="TizenAPI/Social/Calendar" execution_type="auto" priority="P2" id="Calendar_removeBatch_successCallback_invalid_cb">
+ <testcase purpose="Check if Calendar.removeBatch method throws exception when successCallback is invalid" type="compliance" status="approved" component="TizenAPI/Social/Calendar" execution_type="auto" priority="P2" id="Calendar_removeBatch_successCallback_invalid_cb">
<description>
<test_script_entry>/opt/tct-calendar-tizen-tests/calendar/Calendar_removeBatch_successCallback_invalid_cb.html</test_script_entry>
</description>
</spec>
</specs>
</testcase>
- <testcase purpose="Test if putting a user successCallback object which was not created through the constructor but has all the properties failes in updateBatch method." type="compliance" status="approved" component="TizenAPI/Social/Calendar" execution_type="auto" priority="P2" id="Calendar_updateBatch_successCallback_invalid_cb">
+ <testcase purpose="Check if Calendar.updateBatch method throws exception when successCallback is invalid" type="compliance" status="approved" component="TizenAPI/Social/Calendar" execution_type="auto" priority="P2" id="Calendar_updateBatch_successCallback_invalid_cb">
<description>
<test_script_entry>/opt/tct-calendar-tizen-tests/calendar/Calendar_updateBatch_successCallback_invalid_cb.html</test_script_entry>
</description>
</spec>
</specs>
</testcase>
- <testcase purpose="Check whether 'updateBatch' method with successCallback works correctly updates several task items from the CalendarTask object asynchronously" type="compliance" status="approved" component="TizenAPI/Social/Calendar" execution_type="auto" priority="P1" id="Calendar_updateBatch_with_successCallback">
+ <testcase purpose="Check if Calendar.updateBatch method works correctly with successCallback" type="compliance" status="approved" component="TizenAPI/Social/Calendar" execution_type="auto" priority="P1" id="Calendar_updateBatch_with_successCallback">
<description>
<test_script_entry>/opt/tct-calendar-tizen-tests/calendar/Calendar_updateBatch_with_successCallback.html</test_script_entry>
</description>
</spec>
</specs>
</testcase>
- <testcase purpose="Check whether 'updateBatch' method with updateAllInstances works correctly deletes several task items from the CalendarTask object asynchronously" type="compliance" status="approved" component="TizenAPI/Social/Calendar" execution_type="auto" priority="P1" id="Calendar_updateBatch_with_updateAllInstances">
+ <testcase purpose="Check if Calendar.updateBatch method works correctly" type="compliance" status="approved" component="TizenAPI/Social/Calendar" execution_type="auto" priority="P1" id="Calendar_updateBatch_with_updateAllInstances">
<description>
<test_script_entry>/opt/tct-calendar-tizen-tests/calendar/Calendar_updateBatch_with_updateAllInstances.html</test_script_entry>
</description>
<test_script_entry>/opt/tct-calendar-tizen-tests/calendar/CalendarManager_getCalendars_errorCallback_TypeMismatch.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="Test if putting a user errorCallback object in getCalendars method which was not created through the constructor but has all the properties failes." component="TizenAPI/Social/Calendar" execution_type="auto" id="CalendarManager_getCalendars_errorCallback_invalid_cb">
+ <testcase purpose="Check if CalendarManager.getCalendars method throws exception when errorCallback is invalid" component="TizenAPI/Social/Calendar" execution_type="auto" id="CalendarManager_getCalendars_errorCallback_invalid_cb">
<description>
<test_script_entry>/opt/tct-calendar-tizen-tests/calendar/CalendarManager_getCalendars_errorCallback_invalid_cb.html</test_script_entry>
</description>
<test_script_entry>/opt/tct-calendar-tizen-tests/calendar/CalendarManager_getCalendars_successCallback_TypeMismatch.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="Test if putting a user successCallback object in getCalendars method which was not created through the constructor but has all the properties failes." component="TizenAPI/Social/Calendar" execution_type="auto" id="CalendarManager_getCalendars_successCallback_invalid_cb">
+ <testcase purpose="Check if CalendarManager.getCalendars method throws exception when successCallback is invalid" component="TizenAPI/Social/Calendar" execution_type="auto" id="CalendarManager_getCalendars_successCallback_invalid_cb">
<description>
<test_script_entry>/opt/tct-calendar-tizen-tests/calendar/CalendarManager_getCalendars_successCallback_invalid_cb.html</test_script_entry>
</description>
<test_script_entry>/opt/tct-calendar-tizen-tests/calendar/Calendar_removeBatch_errorCallback_TypeMismatch.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="Test if putting a user errorCallback object in removeBatch which was not created through the constructor but has all the properties failes." component="TizenAPI/Social/Calendar" execution_type="auto" id="Calendar_removeBatch_errorCallback_invalid_cb">
+ <testcase purpose="Check if Calendar.removeBatch method throws exception when errorCallback is invalid" component="TizenAPI/Social/Calendar" execution_type="auto" id="Calendar_removeBatch_errorCallback_invalid_cb">
<description>
<test_script_entry>/opt/tct-calendar-tizen-tests/calendar/Calendar_removeBatch_errorCallback_invalid_cb.html</test_script_entry>
</description>
<test_script_entry>/opt/tct-calendar-tizen-tests/calendar/Calendar_removeBatch_successCallback_TypeMismatch.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="Test if putting a user successCallback object in removeBatch which was not created through the constructor but has all the properties failes." component="TizenAPI/Social/Calendar" execution_type="auto" id="Calendar_removeBatch_successCallback_invalid_cb">
+ <testcase purpose="Check if Calendar.removeBatch method throws exception when successCallback is invalid" component="TizenAPI/Social/Calendar" execution_type="auto" id="Calendar_removeBatch_successCallback_invalid_cb">
<description>
<test_script_entry>/opt/tct-calendar-tizen-tests/calendar/Calendar_removeBatch_successCallback_invalid_cb.html</test_script_entry>
</description>
<test_script_entry>/opt/tct-calendar-tizen-tests/calendar/Calendar_updateBatch_successCallback_TypeMismatch.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="Test if putting a user successCallback object which was not created through the constructor but has all the properties failes in updateBatch method." component="TizenAPI/Social/Calendar" execution_type="auto" id="Calendar_updateBatch_successCallback_invalid_cb">
+ <testcase purpose="Check if Calendar.updateBatch method throws exception when successCallback is invalid" component="TizenAPI/Social/Calendar" execution_type="auto" id="Calendar_updateBatch_successCallback_invalid_cb">
<description>
<test_script_entry>/opt/tct-calendar-tizen-tests/calendar/Calendar_updateBatch_successCallback_invalid_cb.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="Check whether 'updateBatch' method with successCallback works correctly updates several task items from the CalendarTask object asynchronously" component="TizenAPI/Social/Calendar" execution_type="auto" id="Calendar_updateBatch_with_successCallback">
+ <testcase purpose="Check if Calendar.updateBatch method works correctly with successCallback" component="TizenAPI/Social/Calendar" execution_type="auto" id="Calendar_updateBatch_with_successCallback">
<description>
<test_script_entry>/opt/tct-calendar-tizen-tests/calendar/Calendar_updateBatch_with_successCallback.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="Check whether 'updateBatch' method with updateAllInstances works correctly deletes several task items from the CalendarTask object asynchronously" component="TizenAPI/Social/Calendar" execution_type="auto" id="Calendar_updateBatch_with_updateAllInstances">
+ <testcase purpose="Check if Calendar.updateBatch method works correctly" component="TizenAPI/Social/Calendar" execution_type="auto" id="Calendar_updateBatch_with_updateAllInstances">
<description>
<test_script_entry>/opt/tct-calendar-tizen-tests/calendar/Calendar_updateBatch_with_updateAllInstances.html</test_script_entry>
</description>