[Calendar] various fixes, part 4
authorAndrzej Krolikowski <a.krolikowsk@samsung.com>
Mon, 14 Oct 2013 15:17:40 +0000 (17:17 +0200)
committerAndrzej Krolikowski <a.krolikowsk@samsung.com>
Mon, 14 Oct 2013 15:17:40 +0000 (17:17 +0200)
Change-Id: I9dab46b242269210610c380e9f249b9e6d42c76e

35 files changed:
tct-calendar-tizen-tests/calendar/CalendarAlarm_constructor_TZDate.html
tct-calendar-tizen-tests/calendar/CalendarAlarm_constructor_TimeDuration.html
tct-calendar-tizen-tests/calendar/CalendarAttendee_attribute_valid_value_CalendarEvent.html
tct-calendar-tizen-tests/calendar/CalendarAttendee_constructor_valid_argument.html
tct-calendar-tizen-tests/calendar/CalendarEvent_constructor_valid_argument.html
tct-calendar-tizen-tests/calendar/CalendarEvent_expandRecurrence_endDate_TypeMismatch.html
tct-calendar-tizen-tests/calendar/CalendarEvent_expandRecurrence_endDate_invalid_obj.html
tct-calendar-tizen-tests/calendar/CalendarEvent_expandRecurrence_errorCallback_TypeMismatch.html
tct-calendar-tizen-tests/calendar/CalendarEvent_expandRecurrence_errorCallback_invalid_cb.html
tct-calendar-tizen-tests/calendar/CalendarEvent_expandRecurrence_missarg.html
tct-calendar-tizen-tests/calendar/CalendarEvent_expandRecurrence_startDate_TypeMismatch.html
tct-calendar-tizen-tests/calendar/CalendarEvent_expandRecurrence_startDate_invalid_obj.html
tct-calendar-tizen-tests/calendar/CalendarManager_getCalendars_errorCallback_invalid_cb.html
tct-calendar-tizen-tests/calendar/CalendarManager_getCalendars_missarg.html
tct-calendar-tizen-tests/calendar/CalendarManager_getCalendars_missarg_TASK.html
tct-calendar-tizen-tests/calendar/Calendar_CalendarManager_getCalendars_successcallback_invalid.html
tct-calendar-tizen-tests/calendar/Calendar_CalendarManager_getDefaultCalendar_CalendarType_error.html
tct-calendar-tizen-tests/calendar/Calendar_CalendarManager_getDefaultCalendar_null.html
tct-calendar-tizen-tests/calendar/Calendar_Calendar_addBatch_error_events.html
tct-calendar-tizen-tests/calendar/Calendar_addBatch_errorCallback_TypeMismatch.html
tct-calendar-tizen-tests/calendar/Calendar_addBatch_errorCallback_invalid_cb.html
tct-calendar-tizen-tests/calendar/Calendar_addBatch_items_TypeMismatch.html
tct-calendar-tizen-tests/calendar/Calendar_addBatch_successCallback_TypeMismatch.html
tct-calendar-tizen-tests/calendar/Calendar_find_event_usage.html
tct-calendar-tizen-tests/calendar/Calendar_find_sortMode_TypeMismatch.html
tct-calendar-tizen-tests/calendar/Calendar_get_NotFoundError.html
tct-calendar-tizen-tests/calendar/Calendar_removeBatch_errorCallback_invalid_cb.html
tct-calendar-tizen-tests/calendar/Calendar_removeChangeListener.html
tct-calendar-tizen-tests/calendar/Calendar_removeChangeListener_valid_argument.html
tct-calendar-tizen-tests/calendar/Calendar_updateBatch_eventType_with_optional_null.html
tct-calendar-tizen-tests/calendar/Calendar_updateBatch_missarg.html
tct-calendar-tizen-tests/calendar/Calendar_updateBatch_taskType_with_optional_null.html
tct-calendar-tizen-tests/calendar/support/calendar_common.js
tct-calendar-tizen-tests/tests.full.xml
tct-calendar-tizen-tests/tests.xml

index bdecf2bb9f1ba5f2e77269106abbbb6863c65e3c..c2e5e4b8da5c9acedbc7a7c1f335aa4fbc1a3330 100644 (file)
@@ -32,8 +32,6 @@ Authors:
 <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
index 6c47168650238017d6202d4b68e67a832607aa6b..9cacddc1404333e1e60c488aba4f9e0d723d7dc7 100644 (file)
@@ -32,8 +32,6 @@ Authors:
 <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
index 97c22026654e7a7d3df4582f26c2f32245b298b1..ab82f24622f6e06380511d656d7cfce39c95c5eb 100644 (file)
@@ -32,8 +32,6 @@ Authors:
 <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
index 847797c7810df2394f58fcc94c3e3905e99cc51d..35a0ef1f3fb50930484e2c4f8bff1ee5dc106d84 100644 (file)
@@ -32,8 +32,6 @@ Authors:
 <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
index c354e33ce3e12967ab6d625a99b7d430a18daa68..0631c9aad76ea00e91ecd73392e4840e37519caf 100644 (file)
@@ -32,8 +32,6 @@ Authors:
 <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
index 6f4ba700c2f5ac92596082451aa08cfeab4038e7..038eaab55bf6a4aa471625d09bc00b9a6e024b91 100644 (file)
@@ -40,7 +40,8 @@ Authors:
 //==== 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({
@@ -53,9 +54,9 @@ t.step(function () {
         })
     });
 
-    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++) {
@@ -68,7 +69,7 @@ t.step(function () {
         }, exceptionName + " should be thrown - given incorrect.");
     }
 
-    this.done();
+    t.done();
 });
 
 </script>
index 1c300ad44551eb35fb8d039587b7efc6d60c583b..6f4b5a9ef646b53cd02b5c3adfce258b46783054 100644 (file)
@@ -40,7 +40,7 @@ Authors:
 //==== 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({
@@ -53,9 +53,9 @@ t.step(function () {
         })
     });
 
-    function expandSuccessCB(events) {
+    expandSuccessCB = t.step_func(function (events) {
         assert_unreached("expandRecurrence() success callback");
-    }
+    });
 
     endDate = {
         year: 2013,
@@ -66,7 +66,7 @@ t.step(function () {
         ev.expandRecurrence(startDate, endDate, expandSuccessCB);
     });
 
-    this.done();
+    t.done();
 });
 
 </script>
index 70582a39907b5eeb5d259d8d47cc4b6f68bebbcb..e0ad718e253a59c4404ae072f427d78856ca82b6 100644 (file)
@@ -69,7 +69,7 @@ t.step(function () {
         }, exceptionName + " should be thrown - given incorrect.");
     }
 
-    this.done();
+    t.done();
 });
 
 </script>
index 0436caeffbf38da445716f3e569fbded630741a5..9dc9669703e2e68012dbcf69c1d69ad0a9b0e707 100644 (file)
@@ -40,7 +40,8 @@ Authors:
 //==== 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);
@@ -54,15 +55,15 @@ t.step(function () {
         })
     });
 
-    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>
index 84ebda3a0fd1dda5d40b10ca3f66dc4d29dfcff3..733cf258e4c66c4def2f229dfa501a4f55083a62 100644 (file)
@@ -39,7 +39,7 @@ Authors:
 //==== 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);
@@ -53,9 +53,9 @@ t.step(function () {
         })
     });
 
-    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);
@@ -100,7 +100,8 @@ t.step(function () {
     assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
         ev.expandRecurrence(1, 2);
     });
-    this.done();
+
+    t.done();
 });
 
 </script>
index d207459912b3087bad34f46394f1886ef8699f6c..963a0c60bca86ff0c862f4e202e4d2a46fef76d1 100644 (file)
@@ -40,7 +40,8 @@ Authors:
 //==== 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({
@@ -53,9 +54,9 @@ t.step(function () {
         })
     });
 
-    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++) {
@@ -68,7 +69,7 @@ t.step(function () {
         }, exceptionName + " should be thrown - given incorrect.");
     }
 
-    this.done();
+    t.done();
 });
 
 </script>
index e110b3b6487fe4b903fe941f396a6935a829b77d..a1ac027b542e5f9856b1a3d6f7597522187e8880 100644 (file)
@@ -40,7 +40,7 @@ Authors:
 //==== 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({
@@ -53,9 +53,9 @@ t.step(function () {
         })
     });
 
-    function expandSuccessCB(events) {
+    expandSuccessCB = t.step_func(function (events) {
         assert_unreached("expandRecurrence() success callback");
-    }
+    });
 
     startDate = {
         year: 2013,
@@ -66,7 +66,7 @@ t.step(function () {
         ev.expandRecurrence(startDate, endDate, expandSuccessCB);
     });
 
-    this.done();
+    t.done();
 });
 
 </script>
index bbd571c839f3af97844c797bc71ece5607e72ecf..48194d9ea2ef051b7a2d70720f1c55f805c9b503 100644 (file)
@@ -39,7 +39,7 @@ var t = async_test(document.title),
     calendar, successCallback, errorCallback;
 t.step(function () {
     successCallback = t.step_func(function (calendars) {
-        assert_unreached("Invalid callback invoked");
+        assert_unreached("Success callback invoked");
     });
 
     errorCallback = {
index 644c73185c0b095c2931e451d6cfc1d87ecb5f94..e280c41997e737e344e82bb04ed3dfe2bf303064 100644 (file)
@@ -32,22 +32,19 @@ Authors:
 <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);
     });
 
@@ -95,7 +92,7 @@ t.step(function () {
         tizen.calendar.getCalendars();
     });
 
-    this.done();
+    t.done();
 
 });
 
index 5fbbae737d044195d51623d71ba3fdd3b5dd6cd5..b0555d01d18b0b9ddfa550fb121083631954e900 100644 (file)
@@ -32,8 +32,6 @@ Authors:
 <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
@@ -42,11 +40,11 @@ Authors:
 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);
     });
 
@@ -66,7 +64,7 @@ t.step(function () {
         tizen.calendar.getCalendars("TASK", onGetCalendarsSuccessCB, 1);
     });
 
-    this.done();
+    t.done();
 });
 
 </script>
index 020622983491d7e193fa649b9fc097eccb2f69cb..d064b315e9ecb8dfed1ace8f024c0d929bfc48ce 100644 (file)
@@ -49,7 +49,7 @@ Authors:
 test(function (){
     assert_throws(TYPE_MISMATCH_EXCEPTION, function (){
         tizen.calendar.getCalendars("EVENT", false);
-    }, "TypeMismatchError exception.");
+    }, "Given incorrect successCallback");
 }, document.title);
 
 </script>
index 73fbe171b66eebd39c58562ff22eaec36ddd09b7..5b08db47c9fbc8a0420293f3abc7aa40d856664e 100644 (file)
@@ -47,7 +47,7 @@ Authors:
 test(function (){
     assert_throws(TYPE_MISMATCH_EXCEPTION, function (){
         tizen.calendar.getDefaultCalendar("123");
-    }, "TypeMismatchError exception.");
+    }, "Given incorrect type");
 }, document.title);
 
 </script>
index 8ce64e59b1bc7fd7bd34d2d2fd8a95209d88625b..67f9977918d625ae41b507e21e194db40ca9a9da 100644 (file)
@@ -48,7 +48,7 @@ Authors:
 test(function (){
     assert_throws(TYPE_MISMATCH_EXCEPTION, function (){
         tizen.calendar.getDefaultCalendar(null);
-    }, "TypeMismatchError exception.");
+    }, "Given incorrect type");
 }, document.title);
 
 </script>
index 8bb016784e13323b14a1e93dcb13cc5bea21ca3a..1855ce02c2ec8bf297bf81dd81e876233d282375 100644 (file)
@@ -41,18 +41,17 @@ Authors:
 <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>
index 1fefc55f43d9452ba558b33f19795617ebc22d68..34e3ca001d3f354bc10ad58025eae681d07e6fdc 100644 (file)
@@ -44,7 +44,7 @@ setup({timeout: 10000});
 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");
index ed9edb7916be6062975d1d1ac91e048248536209..da04299ef50bbc7e5464191c9b2aab302d0a65ad 100644 (file)
@@ -32,28 +32,34 @@ Authors:
 <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>
index 04e07a25a4a96523f5de4fe38c6e1e77f0f9d373..28e0a8b898bf679bc7aae539ee9bb28e03297a19 100644 (file)
@@ -43,12 +43,12 @@ setup({timeout: 10000});
 
 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");
index 8f518f5a5efc44d9df5c083eac6d41dc6b3c2e39..780d955180ccfe01aef593c77f7215ab59cea463 100644 (file)
@@ -44,7 +44,7 @@ setup({timeout: 10000});
 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");
index 5a38b43623bac2a33cfd0ce877a74abf68ec349a..0d7fe63fefefcb7b16d726da6b7f24a091682a0b 100644 (file)
@@ -46,8 +46,6 @@ var t = async_test(document.title, {"timeout": 30000}), succCount = 10,
     firstFilter, secondFilter, eventCalendar = tizen.calendar.getDefaultCalendar("EVENT");
 
 t.step(function () {
-
-
     onFindSuccessCB = t.step_func(function (items) {
         succCount--;
         if (succCount === 0) {
index ba08bbf38acd3ba3815db0a314b927ebbbda504e..5b9dab7677346f54822c38bb45f6dda83384e56a 100644 (file)
@@ -36,7 +36,7 @@ Authors:
 //==== 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",
index b82e8d5541e6c04b7c6cce562375bc91b467877a..85bc24d92ad86ca837e8bea71f899d8145f0a36a 100644 (file)
@@ -63,7 +63,7 @@ test(function () {
 
     assert_throws(NOT_FOUND_EXCEPTION, function () {
         calendar.get(ev1.id);
-    }, "NotFoundError exception should be thrown.");
+    }, "Trying to get removed id");
 }, document.title);
 
 </script>
index 6f4b9f162928604e02d2fced5ad3bea95cf9d7b7..b1a17b47cde72c93825e3e90eb585196f9151b6d 100644 (file)
@@ -48,7 +48,7 @@ t.step(function () {
     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();
 });
 
index 31b776445e6afd65c50fa7083d3dee15df313086..d1bd2e9c24a6bbcbdae53a13ceb5de56a91bf22b 100644 (file)
@@ -36,32 +36,38 @@ Authors:
 //==== 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);
         })
     };
 
index 1724861c04db133589402dec5eb3f141f7db0cf5..a86dec19219f3378db2e6c3e180c16a9f9714ecf 100644 (file)
@@ -37,43 +37,39 @@ Authors:
 //==== 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);
 
index e3b0770a9db48d83869d76a3ecd01151f6cb424e..8db2daeacdd37216afb3c9330eca3800200aa55e 100644 (file)
@@ -40,8 +40,8 @@ Authors:
 //==== 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) {
@@ -49,7 +49,8 @@ t.step(function () {
     });
 
     onUpdateBatchSuccessCB = t.step_func(function () {
-        if (--succCount === 0) {
+        succCount--;
+        if (succCount === 0) {
             t.done();
         }
     });
index 3eae6ffa7a1ae2307e0c718664d6d14088af34ce..b5da170c71211a2c0b7b316602ab1fcd012ec9ab 100644 (file)
@@ -69,7 +69,7 @@ t.step(function () {
         eventCalendar.updateBatch();
     });
 
-    this.done();
+    t.done();
 });
 
 </script>
index 2a0990066e28d61046932f267e9fed7a877b6c79..386b41f2b7218ca046bfd3784450e6c32c3219c9 100644 (file)
@@ -53,7 +53,8 @@ t.step(function () {
     });
 
     onUpdateBatchSuccessCB = t.step_func(function () {
-        if (--succCount === 0) {
+        succCount--;
+        if (succCount === 0) {
             t.done();
         }
     });
index cdda81dd19837dd316999d7d9de1968bb9d10fde..c5ddaaf3fc78c2b378e6ab13597f5cf13ba3d271 100644 (file)
@@ -29,25 +29,10 @@ Authors:
 
 */
 
-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++) {
index dadea644fa361ffd218bc3f8c5851c3714c8f183..3c30bcf18bed8c9ffde2cdb4790d9cbc8c3b0d52 100644 (file)
           </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>
index b4cceb88bf9c2e99aff5cb93bf865fd57f6b7645..65edeb98046e22c670594a44c6fe1fd55ebd9574 100644 (file)
           <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>