var t = async_test(document.title, {timeout: 30000}), globalDataControl, globalReqId = generateGlobalReqId(), watchId, currentDate = new Date().getTime().toString(),
rowData, descriptionToSet = currentDate + "_desc", returnedValue = null, dataChangeSuccessCallback;
+
t.step(function () {
+ add_result_callback(function (res) {
+ try {
+ globalDataControl.removeChangeListener(returnedValue);
+ } catch (err) {
+ // do nothing in case removeChangeListener throw an exception
+ }
+ });
rowData = {
columns: ["WORD", "WORD_DESC"],
};
dataChangeSuccessCallback = t.step_func(function (eventType, rowData) {
- assert_equals(returnedValue, undefined, "Incorrect returned value");
+ assert_type(returnedValue, "long", "Incorrect returned value");
assert_equals(eventType, "SQL_INSERT", "incorrect request eventType");
assert_type(rowData, "object", "rowData is not object");
- globalDataControl.removeChangeListener(watchId);
t.done();
});
globalDataControl = tizen.datacontrol.getDataControlConsumer(PROVIDER_ID, DATA_ID, TYPE_SQL);
returnedValue = globalDataControl.addChangeListener(dataChangeSuccessCallback);
- alert(returnedValue);
globalReqId++;
globalDataControl.insert(globalReqId, rowData);
});
var t = async_test(document.title, {timeout: 30000}), globalDataControl, globalReqId = generateGlobalReqId(), watchId, currentDate = new Date().getTime().toString(),
rowData, descriptionToSet = currentDate + "_desc", returnedValue = null, dataChangeSuccessCallback;
+
t.step(function () {
+ add_result_callback(function (res) {
+ try {
+ globalDataControl.removeChangeListener(returnedValue);
+ } catch (err) {
+ // do nothing in case removeChangeListener throw an exception
+ }
+ });
rowData = {
columns: ["WORD", "WORD_DESC"],
};
dataChangeSuccessCallback = t.step_func(function (eventType, rowData) {
- globalDataControl.removeChangeListener(watchId);
+ assert_type(returnedValue, "long", "Incorrect returned value");
t.done();
});
var t = async_test(document.title, {timeout: 30000}), globalDataControl, globalReqId = generateGlobalReqId(), currentDate = new Date().getTime().toString(),
rowData, descriptionToSet = currentDate + "_desc", returnedValue = null, dataChangeSuccessCallback, errorCallback;
+
t.step(function () {
+ add_result_callback(function (res) {
+ try {
+ globalDataControl.removeChangeListener(returnedValue);
+ } catch (err) {
+ // do nothing in case removeChangeListener throw an exception
+ }
+ });
rowData = {
columns: ["WORD", "WORD_DESC"],
});
dataChangeSuccessCallback = t.step_func(function (eventType, rowData) {
- assert_equals(returnedValue, undefined, "Incorrect returned value");
+ assert_type(returnedValue, "long", "Incorrect returned value");
assert_equals(eventType, "SQL_INSERT", "incorrect request eventType");
assert_type(rowData, "object", "rowData is not object");
+ t.done();
});
globalDataControl = tizen.datacontrol.getDataControlConsumer(PROVIDER_ID, DATA_ID, TYPE_SQL);