From: Piotr Szydelko
Date: Thu, 26 Sep 2013 14:01:20 +0000 (+0200)
Subject: [tizen-tests] improved returned value check of async methods
X-Git-Tag: 2.2.1_release~105^2~59
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ea1dc842328ae5100191ea9039b75ad5ff12ac9e;p=test%2Ftct%2Fweb%2Fapi.git
[tizen-tests] improved returned value check of async methods
Change-Id: I4a555a5d44fc12c3232d6338d122c8da32dd9fa4
---
diff --git a/tct-application-tizen-tests/application/ApplicationManager_addAppInfoEventListener_oninstalled.html b/tct-application-tizen-tests/application/ApplicationManager_addAppInfoEventListener_oninstalled.html
index edfd3930b..f7300ec85 100644
--- a/tct-application-tizen-tests/application/ApplicationManager_addAppInfoEventListener_oninstalled.html
+++ b/tct-application-tizen-tests/application/ApplicationManager_addAppInfoEventListener_oninstalled.html
@@ -67,7 +67,7 @@ this_test.step(function () {
};
watchId = tizen.application.addAppInfoEventListener(appEventCallback);
- assert_type(watchId, "number", "wrong listener ID");
+ assert_type(watchId, "long", "wrong listener ID");
});
diff --git a/tct-application-tizen-tests/application/ApplicationManager_addAppInfoEventListener_onuninstalled.html b/tct-application-tizen-tests/application/ApplicationManager_addAppInfoEventListener_onuninstalled.html
index 3a679e637..cb75cf45d 100644
--- a/tct-application-tizen-tests/application/ApplicationManager_addAppInfoEventListener_onuninstalled.html
+++ b/tct-application-tizen-tests/application/ApplicationManager_addAppInfoEventListener_onuninstalled.html
@@ -67,7 +67,7 @@ this_test.step(function () {
};
watchId = tizen.application.addAppInfoEventListener(appEventCallback);
- assert_type(watchId, "number", "wrong listener ID");
+ assert_type(watchId, "long", "wrong listener ID");
});
diff --git a/tct-application-tizen-tests/application/ApplicationManager_addAppInfoEventListener_onupdated.html b/tct-application-tizen-tests/application/ApplicationManager_addAppInfoEventListener_onupdated.html
index 6edcc0a83..a05ac6c12 100644
--- a/tct-application-tizen-tests/application/ApplicationManager_addAppInfoEventListener_onupdated.html
+++ b/tct-application-tizen-tests/application/ApplicationManager_addAppInfoEventListener_onupdated.html
@@ -67,7 +67,7 @@ this_test.step(function () {
};
watchId = tizen.application.addAppInfoEventListener(appEventCallback);
- assert_type(watchId, "number", "wrong listener ID");
+ assert_type(watchId, "long", "wrong listener ID");
});
diff --git a/tct-application-tizen-tests/application/ApplicationManager_launch.html b/tct-application-tizen-tests/application/ApplicationManager_launch.html
index 2a22fec0c..bc17be831 100644
--- a/tct-application-tizen-tests/application/ApplicationManager_launch.html
+++ b/tct-application-tizen-tests/application/ApplicationManager_launch.html
@@ -46,7 +46,7 @@ Authors:
//==== TEST_CRITERIA MMINA MAST MR
setup({timeout: 30000});
-var t = async_test("ApplicationManager_launch", { timeout : 30000 }), retVal;
+var t = async_test("ApplicationManager_launch", { timeout : 30000 }), retVal = null;
setup_launch(t, TCT_APPCONTROL_APPID, function () {
retVal = tizen.application.launch(TCT_APPCONTROL_APPID);
diff --git a/tct-calendar-tizen-tests/calendar/Calendar_addBatch_with_errorCallback.html b/tct-calendar-tizen-tests/calendar/Calendar_addBatch_with_errorCallback.html
index defbc04c4..ad46b61a3 100644
--- a/tct-calendar-tizen-tests/calendar/Calendar_addBatch_with_errorCallback.html
+++ b/tct-calendar-tizen-tests/calendar/Calendar_addBatch_with_errorCallback.html
@@ -41,7 +41,7 @@ Authors:
var t = async_test("Calendar_addBatch_with_errorCallback", {timeout: 5000});
t.step(function () {
- var events, eventCalendar, returnedValue, onAddBatchErrorCB, onAddBatchSuccessCB;
+ var events, eventCalendar, returnedValue = null, onAddBatchErrorCB, onAddBatchSuccessCB;
eventCalendar = tizen.calendar.getDefaultCalendar("EVENT");
events = createTestEvents();
diff --git a/tct-calendar-tizen-tests/calendar/Calendar_addBatch_with_successCallback.html b/tct-calendar-tizen-tests/calendar/Calendar_addBatch_with_successCallback.html
index 0bd0070fd..35341f0c6 100644
--- a/tct-calendar-tizen-tests/calendar/Calendar_addBatch_with_successCallback.html
+++ b/tct-calendar-tizen-tests/calendar/Calendar_addBatch_with_successCallback.html
@@ -41,7 +41,7 @@ Authors:
var t = async_test("Calendar_addBatch_with_successCallback", {timeout: 5000});
t.step(function () {
- var events, eventCalendar, onAddBatchSuccessCB, returnedValue;
+ var events, eventCalendar, onAddBatchSuccessCB, returnedValue = null;
eventCalendar = tizen.calendar.getDefaultCalendar("EVENT");
events = createTestEvents();
diff --git a/tct-calendar-tizen-tests/calendar/Calendar_updateBatch.html b/tct-calendar-tizen-tests/calendar/Calendar_updateBatch.html
index 86501f3f5..89dd6ec83 100644
--- a/tct-calendar-tizen-tests/calendar/Calendar_updateBatch.html
+++ b/tct-calendar-tizen-tests/calendar/Calendar_updateBatch.html
@@ -34,7 +34,6 @@ Authors:
//==== 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 MAST MR
-// check whether
var t = async_test("Calendar_updateBatch"), addBatchSuccessCB, addBatchErrorCB,
events = [], beforeValues = [], expected = [], returnedValue = null,
calendar, updateBatchErrorCB, findSuccessCB, findErrorCB;
@@ -70,12 +69,12 @@ t.step(function (){
events[1].description = Math.random().toFixed(5);
expected[events[1].id.uid] = events[1].description;
- returnedValue = calendar.updateBatch(events, function () {
+ returnedValue = calendar.updateBatch(events, t.step_func(function () {
var filter1 = new tizen.AttributeFilter("id.uid", "EXACTLY", events[0].id.uid),
filter2 = new tizen.AttributeFilter("id.uid", "EXACTLY", events[1].id.uid),
filter = new tizen.CompositeFilter("UNION", [filter1, filter2]);
calendar.find(findSuccessCB, findErrorCB, filter);
- }, updateBatchErrorCB);
+ }), updateBatchErrorCB);
});
addBatchErrorCB = t.step_func(function (error) {
assert_unreached("addBatch() error callaback invoked: " + error.name + ": " + error.message);
diff --git a/tct-callhistory-tizen-tests/callhistory/CallHistory_addChangeListener.html b/tct-callhistory-tizen-tests/callhistory/CallHistory_addChangeListener.html
index 3fea94fff..b4f961327 100644
--- a/tct-callhistory-tizen-tests/callhistory/CallHistory_addChangeListener.html
+++ b/tct-callhistory-tizen-tests/callhistory/CallHistory_addChangeListener.html
@@ -57,7 +57,7 @@ test(function () {
try {
handle = tizen.callhistory.addChangeListener(listener);
- assert_type(handle, "number", "handle should be a number");
+ assert_type(handle, "long", "handle should be a number");
} finally {
tizen.callhistory.removeChangeListener(handle);
}
diff --git a/tct-callhistory-tizen-tests/callhistory/CallHistory_addChangeListener_onadded.html b/tct-callhistory-tizen-tests/callhistory/CallHistory_addChangeListener_onadded.html
index 2f5376dc6..89f6b9383 100644
--- a/tct-callhistory-tizen-tests/callhistory/CallHistory_addChangeListener_onadded.html
+++ b/tct-callhistory-tizen-tests/callhistory/CallHistory_addChangeListener_onadded.html
@@ -42,7 +42,7 @@ test(function () {
handle = tizen.callhistory.addChangeListener(listener);
try {
- assert_type(handle, "number", "handle should be a number");
+ assert_type(handle, "long", "handle should be a number");
} finally {
tizen.callhistory.removeChangeListener(handle);
}
diff --git a/tct-callhistory-tizen-tests/callhistory/CallHistory_find_errorCallback_null.html b/tct-callhistory-tizen-tests/callhistory/CallHistory_find_errorCallback_null.html
index 627f44a4a..b449f866d 100644
--- a/tct-callhistory-tizen-tests/callhistory/CallHistory_find_errorCallback_null.html
+++ b/tct-callhistory-tizen-tests/callhistory/CallHistory_find_errorCallback_null.html
@@ -39,16 +39,16 @@ Authors:
setup({timeout: 90000});
var t = async_test("CallHistory_find_errorCallback_null", { timeout: 90000 }),
- findSuccess, returnedValue;
+ findSuccess, returnedValue = null;
t.step(function () {
findSuccess = t.step_func(function (results) {
assert_type(results, "array", "Checking type of result");
+ assert_equals(returnedValue, undefined, "Incorrect returned value");
t.done();
});
returnedValue = tizen.callhistory.find(findSuccess, null);
- assert_equals(returnedValue, undefined, "Incorrect returned value");
});