[Contact] AddressBook.removeBatch() return value check change
authorPiotr Szydelko <p.szydelko@samsung.com>
Mon, 16 Sep 2013 10:49:41 +0000 (12:49 +0200)
committerPiotr Szydelko <p.szydelko@samsung.com>
Mon, 16 Sep 2013 12:41:55 +0000 (14:41 +0200)
Change-Id: I2ae30fb06360a6dde2c25fa948a0c8eb0868372f

tct-contact-tizen-tests/contact/AddressBook_removeBatch_with_errorCallback.html
tct-contact-tizen-tests/contact/AddressBook_removeBatch_with_successCallback.html

index 58edba8c577b520bcb238512cb54aa83928402cb..ae4a15e4fa9e671a4cbb7a475ed01874fc4add40 100644 (file)
@@ -37,7 +37,7 @@ Authors:
 
 var t = async_test("AddressBook_removeBatch_with_errorCallback");
 t.step(function () {
-    var contact_1, contact_2, addressbook, removeBatchError, removeBatchSuccess, returnedValue;
+    var contact_1, contact_2, addressbook, removeBatchError, removeBatchSuccess, returnedValue = null;
     addressbook = tizen.contact.getDefaultAddressBook();
     contact_1 = new tizen.Contact({
         name: new tizen.ContactName({
@@ -58,6 +58,7 @@ t.step(function () {
     });
 
     removeBatchSuccess = t.step_func(function () {
+        assert_equals(returnedValue, undefined, "Incorrect value returned.");
         t.done();
     });
     removeBatchError = t.step_func(function (error) {
@@ -67,7 +68,6 @@ t.step(function () {
     addressbook.add(contact_2);
 
     returnedValue = addressbook.removeBatch([contact_1.id, contact_2.id], removeBatchSuccess, removeBatchError);
-    assert_equals(returnedValue, undefined, "Incorrect value returned.");
 });
 
 </script>
index ce517228be192f90edd078970612645ca5c34015..4dcf2a46681507274b5710bf72e016d5c21262bb 100644 (file)
@@ -37,7 +37,7 @@ Authors:
 
 var t = async_test("AddressBook_removeBatch_with_successCallback");
 t.step(function () {
-    var contact_1, contact_2, addressbook, removeBatchSuccess, returnedValue;
+    var contact_1, contact_2, addressbook, removeBatchSuccess, returnedValue = null;
     addressbook = tizen.contact.getDefaultAddressBook();
     contact_1 = new tizen.Contact({
         name: new tizen.ContactName({
@@ -58,6 +58,7 @@ t.step(function () {
     });
 
     removeBatchSuccess = t.step_func(function () {
+        assert_equals(returnedValue, undefined, "Incorrect value returned.");
         t.done();
     });
 
@@ -65,7 +66,6 @@ t.step(function () {
     addressbook.add(contact_2);
 
     returnedValue = addressbook.removeBatch([contact_1.id, contact_2.id], removeBatchSuccess);
-    assert_equals(returnedValue, undefined, "Incorrect value returned.");
 });
 
 </script>