From: Andrzej Krolikowski Date: Thu, 10 Oct 2013 12:32:14 +0000 (+0200) Subject: [Messaging-email] cleanup X-Git-Tag: 2.2.1_release~87 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=91c0392fbb04bf577bdb4f0b13fb9cccd373d323;p=test%2Ftct%2Fweb%2Fapi.git [Messaging-email] cleanup Change-Id: I119f7909b755cfe17cb110f564dfd8f8f8d8f6a1 --- diff --git a/tct-messaging-email-tizen-tests/messaging/MessageAttachment_constructor_minargs.html b/tct-messaging-email-tizen-tests/messaging/MessageAttachment_constructor_minargs.html index f707409f2..30571b030 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageAttachment_constructor_minargs.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageAttachment_constructor_minargs.html @@ -44,7 +44,8 @@ test(function () { assert_equals(attachment.id, null, "'attachment.id' should be null by default"); assert_equals(attachment.messageId, null, "'attachment.messageId' should be null by default"); assert_equals(attachment.mimeType, null, "'attachment.mimeType' null by default"); - assert_equals(attachment.filePath, MESSAGE_ATTACHMENT_IMAGE_PATH, "'attachment.filePath' should be \""+MESSAGE_ATTACHMENT_IMAGE_PATH+"\" by default"); + assert_equals(attachment.filePath, MESSAGE_ATTACHMENT_IMAGE_PATH, + "'attachment.filePath' should be \""+MESSAGE_ATTACHMENT_IMAGE_PATH+"\" by default"); }, document.title); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageBody_email_plainBody_attribute.html b/tct-messaging-email-tizen-tests/messaging/MessageBody_email_plainBody_attribute.html index b3300709b..075c16e85 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageBody_email_plainBody_attribute.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageBody_email_plainBody_attribute.html @@ -45,7 +45,7 @@ test(function () { check_attribute(messageBody, "plainBody", "", "string", "sampleValue"); messageBody.plainBody = null; - assert_equals(messageBody.plainBody, "null", "null is incorrectly converted to 'null'. plainBody is not nullable string so after set to plainBody null. plainBody should be equals 'null'"); + assert_equals(messageBody.plainBody, "null", "Incorrect plainBody after null assignment"); }, document.title); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageConversation_from_attribute.html b/tct-messaging-email-tizen-tests/messaging/MessageConversation_from_attribute.html index 9728f20b4..0cbbcf1c6 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageConversation_from_attribute.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageConversation_from_attribute.html @@ -41,14 +41,14 @@ setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), serviceSuccess, serviceError, service, message, sendSuccess, sendError, syncSuccess, syncError, - filter, findSuccess, findError; + filter, findSuccess, findError, i; t.step(function () { findSuccess = t.step_func(function (conversations) { assert_type(conversations, "array", "Not an array"); assert_greater_than(conversations.length, 0, "Received empty messages array"); - for (var i in conversations) { + for (i = 0; i < conversations.length; i++) { assert_own_property(conversations[i], "from", "MessageConversation does not own from property."); assert_equals(conversations[i].from, TEST_EMAIL_RECIPIENT_1, "returned from is not equal"); check_readonly(conversations[i], "from", conversations[i].from, "string", "dummyValue"); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageConversationsChangeCallback_conversationsadded.html b/tct-messaging-email-tizen-tests/messaging/MessageConversationsChangeCallback_conversationsadded.html index b3a731ac2..c1d551fe3 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageConversationsChangeCallback_conversationsadded.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageConversationsChangeCallback_conversationsadded.html @@ -50,7 +50,7 @@ Authors: //==== TIMEOUT 180 //==== TEST_CRITERIA CBOA CBT setup({timeout: 180000}); -var t = async_test(document.title, {timeout: 180000}), service, +var t = async_test(document.title, {timeout: 180000}), service, i, serviceSuccess, serviceError, messageService, addDraftError, message, conversationChangeCB, watchId; t.step(function () { @@ -67,7 +67,7 @@ t.step(function () { assert_type(conversations, "array", "type check"); assert_greater_than(conversations.length, 0, "Received empty conversations array"); - for (var i in conversations) { + for (i = 0; i < conversations.length; i++) { assert_own_property(conversations[i], "id", "id not present."); assert_own_property(conversations[i], "type", "type not present."); assert_own_property(conversations[i], "timestamp", "timestamp not present."); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageConversationsChangeCallback_email_conversationsupdated.html b/tct-messaging-email-tizen-tests/messaging/MessageConversationsChangeCallback_email_conversationsupdated.html index dcb18ca20..2e1343d5c 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageConversationsChangeCallback_email_conversationsupdated.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageConversationsChangeCallback_email_conversationsupdated.html @@ -39,7 +39,7 @@ Authors: //==== TEST_CRITERIA CBT CBOA setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), - serviceSuccess, serviceError, messageService, messageStorage, message, + serviceSuccess, serviceError, messageService, messageStorage, message, i, addDraftSuccess, addDraftError, updateError, oldTimestamp, changeCallback, listenerId; t.step(function () { @@ -58,7 +58,7 @@ t.step(function () { assert_type(updatedConversations, "array", "Not an array"); assert_greater_than(updatedConversations.length, 0, "Received empty conversations array"); - for (var i in updatedConversations) { + for (i = 0; i < updatedConversations.length; i++) { if (updatedConversations[i].id === message.conversationId) { check_readonly(updatedConversations[i], "id", updatedConversations[i].id, "string", "dummyValue"); check_readonly(updatedConversations[i], "type", "messaging.email", "string", "dummyValue"); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageService_email_loadMessageAttachment_exist.html b/tct-messaging-email-tizen-tests/messaging/MessageService_email_loadMessageAttachment_exist.html index 91ac88bcd..9ad56d089 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageService_email_loadMessageAttachment_exist.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageService_email_loadMessageAttachment_exist.html @@ -39,16 +39,16 @@ Authors: //==== TEST_CRITERIA ME setup({timeout: 180000}); -var t = async_test(document.title, {timeout: 180000}), message_service, serviceSuccess, serviceError; +var t = async_test(document.title, {timeout: 180000}), service, serviceSuccess, serviceError; t.step(function () { serviceSuccess = t.step_func(function (services) { - assert_true(services.length > 0, "Received empty services array"); - message_service = services[0]; + assert_greater_than(services.length, 0, "Received empty services array"); + service = services[0]; - assert_true("loadMessageAttachment" in message_service, "No loadMessageAttachment method in message_service"); - check_method_exists(message_service, "loadMessageAttachment"); + assert_true("loadMessageAttachment" in service, "No loadMessageAttachment method in service"); + check_method_exists(service, "loadMessageAttachment"); t.done(); }); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageService_sendMessage_emailWithBcc.html b/tct-messaging-email-tizen-tests/messaging/MessageService_sendMessage_emailWithBcc.html index 441432a95..a9795a2c8 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageService_sendMessage_emailWithBcc.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageService_sendMessage_emailWithBcc.html @@ -56,7 +56,7 @@ var t = async_test(document.title, {timeout: 180000}), t.step(function () { messageSent = t.step_func(function (recipients) { - assert_true(recipients.length > 0, "No message sent successfully"); + assert_greater_than(recipients.length, 0, "Received empty recipients array"); t.done(); }); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageService_sync.html b/tct-messaging-email-tizen-tests/messaging/MessageService_sync.html index 05751b9e4..4c3b667b1 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageService_sync.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageService_sync.html @@ -46,7 +46,7 @@ t.step(function () { serviceSuccess = t.step_func(function (service) { returnedValue = service.sync(); - assert_type(returnedValue, "number", "type check"); + assert_type(returnedValue, "long", "type check"); service.stopSync(returnedValue); t.done(); }); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageService_syncFolder_with_errorCallback.html b/tct-messaging-email-tizen-tests/messaging/MessageService_syncFolder_with_errorCallback.html index 9292b3181..be1a34448 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageService_syncFolder_with_errorCallback.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageService_syncFolder_with_errorCallback.html @@ -42,11 +42,11 @@ setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), serviceSuccess, serviceError, service, findFoldersError, findFoldersSuccess, inboxFolder, message, sendError, sendSuccess, syncId = null, - syncFolderSuccess, syncFolderError, findMessageError, findMesageSuccess; + syncFolderSuccess, syncFolderError, findMessageError, findMessageSuccess; t.step(function () { - findMesageSuccess = t.step_func(function (messages) { + findMessageSuccess = t.step_func(function (messages) { assert_inbox_message_equals(t, messages, message, inboxFolder); t.done(); }); @@ -57,7 +57,7 @@ t.step(function () { syncFolderSuccess = t.step_func(function () { assert_type(syncId, "long", "Incorrect returned value"); - findMessages(t, service, inboxFolder, message.subject, findMesageSuccess, findMessageError); + findMessages(t, service, inboxFolder, message.subject, findMessageSuccess, findMessageError); }); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageService_syncFolder_with_successCallback.html b/tct-messaging-email-tizen-tests/messaging/MessageService_syncFolder_with_successCallback.html index 7a6f0f266..4cf985faf 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageService_syncFolder_with_successCallback.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageService_syncFolder_with_successCallback.html @@ -42,11 +42,11 @@ setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), serviceSuccess, serviceError, service, findFoldersError, findFoldersSuccess, inboxFolder, message, sendError, sendSuccess, syncId = null, syncFolderSuccess, - findMessageError, findMesageSuccess; + findMessageError, findMessageSuccess; t.step(function () { - findMesageSuccess = t.step_func(function (messages) { + findMessageSuccess = t.step_func(function (messages) { assert_inbox_message_equals(t, messages, message, inboxFolder); t.done(); }); @@ -57,7 +57,7 @@ t.step(function () { syncFolderSuccess = t.step_func(function () { assert_type(syncId, "long", "Incorrect returned value"); - findMessages(t, service, inboxFolder, message.subject, findMesageSuccess, findMessageError); + findMessages(t, service, inboxFolder, message.subject, findMessageSuccess, findMessageError); }); findFoldersSuccess = t.step_func(function (folders) { diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_addConversationsChangeListener.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_addConversationsChangeListener.html index 129d56d90..9fd069378 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_addConversationsChangeListener.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_addConversationsChangeListener.html @@ -51,7 +51,7 @@ Authors: //==== TEST_CRITERIA MR MMINA MAST setup({timeout: 180000}); -var t = async_test(document.title, {timeout: 180000}), service, +var t = async_test(document.title, {timeout: 180000}), service, i, serviceSuccess, serviceError, messageService, message, addDraftError, conversationChangeCB, returnedValue = null; t.step(function () { @@ -67,7 +67,7 @@ t.step(function () { conversationsadded: t.step_func(function (conversations) { assert_greater_than(conversations.length, 0, "Received empty conversations array"); - for (var i in conversations) { + for (i = 0; i < conversations.length; i++) { if (conversations[i].id === message.conversationId) { t.done(); break; @@ -86,7 +86,7 @@ t.step(function () { message = createSimpleMessageTo(TEST_EMAIL_RECIPIENT_2); returnedValue = messageService.messageStorage.addConversationsChangeListener(conversationChangeCB); - assert_type(returnedValue, "number", "Incorrect returned value type - should be 'number'"); + assert_type(returnedValue, "long", "Incorrect returned value type"); messageService.messageStorage.addDraftMessage(message, null, addDraftError); }); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_addConversationsChangeListener_with_filter.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_addConversationsChangeListener_with_filter.html index f1624d3fe..5314af729 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_addConversationsChangeListener_with_filter.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_addConversationsChangeListener_with_filter.html @@ -38,7 +38,7 @@ Authors: //==== TEST_CRITERIA MOA MAST setup({timeout: 180000}); -var t = async_test(document.title, {timeout: 180000}), addDraftError, +var t = async_test(document.title, {timeout: 180000}), addDraftError, i, service, serviceSuccess, serviceError, message, conversationChangeCB, filter, watchId; t.step(function () { @@ -54,7 +54,7 @@ t.step(function () { conversationsadded: t.step_func(function (conversations) { assert_greater_than(conversations.length, 0, "Received empty conversations array"); - for (var i in conversations) { + for (i = 0; i < conversations.length; i++) { if (conversations[i].id === message.conversationId) { t.done(); break; diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_addConversationsChangeListener_withoutcb.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_addConversationsChangeListener_withoutcb.html index 5368289dd..bd2e651c5 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_addConversationsChangeListener_withoutcb.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_addConversationsChangeListener_withoutcb.html @@ -58,7 +58,7 @@ t.step(function () { serviceSuccess = t.step_func(function (service) { assert_throws(TYPE_MISMATCH_EXCEPTION, function () { service.messageStorage.addConversationsChangeListener(); - }, "TypeMismatchError exception expected but not thrown."); + }, "Missing non-optional argument"); t.done(); }); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_addDraftMessage_errorCallback_invalid_cb.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_addDraftMessage_errorCallback_invalid_cb.html index 9e44866d9..21b4fce2c 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_addDraftMessage_errorCallback_invalid_cb.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_addDraftMessage_errorCallback_invalid_cb.html @@ -50,7 +50,7 @@ t.step(function () { incorrectCallback = { onerror: t.step_func(function (error) { - assert_unreached("addDraftMessage() incorrect error callback invoked: name:" + error.name + ", msg:" + error.message); + assert_unreached("addDraftMessage() incorrect error callback invoked: name:" + error.name + ", msg:" + error.message); }) }; diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_addDraftMessage_missarg.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_addDraftMessage_missarg.html index 4d6407580..ade0c97ef 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_addDraftMessage_missarg.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_addDraftMessage_missarg.html @@ -40,14 +40,13 @@ Authors: setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), - serviceSuccess, serviceError, exceptionName = "TypeMismatchError"; + serviceSuccess, serviceError; t.step(function () { serviceSuccess = t.step_func(function (service) { - assert_throws({name: exceptionName}, - function () { - service.messageStorage.addDraftMessage(); - }, exceptionName + " should be thrown - missing argument"); + assert_throws(TYPE_MISMATCH_EXCEPTION, function () { + service.messageStorage.addDraftMessage(); + }, "Missing argument"); t.done(); }); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_addDraftMessage_successCallback_invalid_cb.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_addDraftMessage_successCallback_invalid_cb.html index a25127978..f4717648f 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_addDraftMessage_successCallback_invalid_cb.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_addDraftMessage_successCallback_invalid_cb.html @@ -40,12 +40,12 @@ Authors: //==== TEST_CRITERIA MTCB setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), - serviceSuccess, serviceError, message, incorrectCallback, addDraftError, exceptionName = "TypeMismatchError"; + serviceSuccess, serviceError, message, incorrectCallback, addDraftError; t.step(function () { incorrectCallback = { onsuccess: t.step_func(function () { - assert_unreached("addDraftMessage() success callback invoked."); + assert_unreached("addDraftMessage() success callback invoked."); }) }; @@ -56,10 +56,9 @@ t.step(function () { serviceSuccess = t.step_func(function (service) { message = createSimpleMessageTo(TEST_EMAIL_RECIPIENT_2); - assert_throws({name: exceptionName}, - function () { - service.messageStorage.addDraftMessage(message, incorrectCallback, addDraftError); - }, exceptionName + " should be thrown - given incorrect success callback - " + incorrectCallback); + assert_throws(TYPE_MISMATCH_EXCEPTION, function () { + service.messageStorage.addDraftMessage(message, incorrectCallback, addDraftError); + }, "Given incorrect success callback - " + incorrectCallback); t.done(); }); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_addFoldersChangeListener_foldersChangeCallback_TypeMismatch.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_addFoldersChangeListener_foldersChangeCallback_TypeMismatch.html index a760dc51b..ad39038d6 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_addFoldersChangeListener_foldersChangeCallback_TypeMismatch.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_addFoldersChangeListener_foldersChangeCallback_TypeMismatch.html @@ -54,10 +54,9 @@ t.step(function () { incorrectCallback = conversionTable[i][0]; exceptionName = conversionTable[i][1]; - assert_throws({name: exceptionName}, - function () { - service.messageStorage.addFoldersChangeListener(incorrectCallback); - }, exceptionName + " should be thrown - given incorrect error callback - " + incorrectCallback); + assert_throws({name: exceptionName}, function () { + service.messageStorage.addFoldersChangeListener(incorrectCallback); + }, "Given incorrect error callback - " + incorrectCallback); } t.done(); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_addMessagesChangeListener_without_filter.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_addMessagesChangeListener_without_filter.html index 81bcaafc6..0ff8e4e23 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_addMessagesChangeListener_without_filter.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_addMessagesChangeListener_without_filter.html @@ -38,7 +38,7 @@ Authors: //==== TIMEOUT 180 //==== TEST_CRITERIA MR MMINA MAST setup({timeout: 180000}); -var t = async_test(document.title, {timeout: 180000}), +var t = async_test(document.title, {timeout: 180000}), i, serviceSuccess, serviceError, service, message, listenerId, addDraftError, changeCallback; t.step(function () { @@ -56,7 +56,7 @@ t.step(function () { assert_type(addedMessages, "array", "Not an array."); assert_greater_than(addedMessages.length, 0, "Received empty messages array"); - for (var i in addedMessages) { + for (i = 0; i < addedMessages.length; i++) { assert_true(addedMessages[i] instanceof tizen.Message, "Not a message."); if (addedMessages[0].id === message.id) { diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findConversations_filter_from.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findConversations_filter_from.html index 0de369500..6e0b315d9 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findConversations_filter_from.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findConversations_filter_from.html @@ -51,14 +51,14 @@ Authors: //==== TIMEOUT 180 setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), - serviceSuccess, serviceError, service, message, filter, + serviceSuccess, serviceError, service, message, filter, i, sendSuccess, sendError, syncSuccess, syncError, findSuccess, findError; t.step(function () { findSuccess = t.step_func(function (conversations) { assert_greater_than(conversations.length, 0, "Received empty conversations array"); - for (var i in conversations) { + for (i = 0; i < conversations.length; i++) { assert_equals(conversations[i].from, TEST_EMAIL_RECIPIENT_1, "from should match"); } diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findConversations_filter_to.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findConversations_filter_to.html index 6eeecea0d..075fbe549 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findConversations_filter_to.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findConversations_filter_to.html @@ -51,14 +51,14 @@ Authors: setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), - serviceSuccess, serviceError, service, message, + serviceSuccess, serviceError, service, message, i, addDraftSuccess, addDraftError, filter, findSuccess, findError; t.step(function () { findSuccess = t.step_func(function (conversations) { assert_greater_than(conversations.length, 0, "Received empty conversations array"); - for (var i in conversations) { + for (i = 0; i < conversations.length; i++) { assert_array_equals(conversations[i].to, [TEST_EMAIL_RECIPIENT_2], "to should match"); } diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findConversations_without_errorCallback.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findConversations_without_errorCallback.html index 678ee2eb8..f45cc2ee7 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findConversations_without_errorCallback.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findConversations_without_errorCallback.html @@ -50,7 +50,7 @@ Authors: //==== TEST_CRITERIA MMINA setup({timeout: 180000}); -var t = async_test(document.title, {timeout: 180000}), +var t = async_test(document.title, {timeout: 180000}), i, serviceSuccess, serviceError, service, message, filter, addDraftError, findConversationsSuccess; t.step(function () { @@ -58,7 +58,7 @@ t.step(function () { assert_type(conversations, "array", "Not an array"); assert_greater_than(conversations.length, 0, "Received empty messages array"); - for (var i in conversations) { + for (i = 0; i < conversations.length; i++) { assert_equals(conversations[i].type, service.type, "Incorrect service type"); } diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_bcc_with_errorCallback.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_bcc_with_errorCallback.html index f1e754cf8..852ea7e2a 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_bcc_with_errorCallback.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_bcc_with_errorCallback.html @@ -44,14 +44,14 @@ setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), serviceSuccess, serviceError, service, message, filter, messageFound = false, - addDraftSuccess, addDraftError, findSuccess, findError; + addDraftSuccess, addDraftError, findSuccess, findError, i; t.step(function () { findSuccess = t.step_func(function (messages) { assert_type(messages, "array", "Not an array"); assert_greater_than(messages.length, 0, "Received empty messages array"); - for (var i in messages) { + for (i = 0; i < messages.length; i++) { assert_true(messages[i] instanceof tizen.Message, "Not a Message"); assert_in_array(TEST_EMAIL_RECIPIENT_1, messages[i].bcc, "bcc not found"); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_cc_with_errorCallback.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_cc_with_errorCallback.html index 5232eec07..f03efe1f0 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_cc_with_errorCallback.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_cc_with_errorCallback.html @@ -42,14 +42,14 @@ setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), serviceSuccess, serviceError, service, message, filter, messageFound = false, - addDraftSuccess, addDraftError, findSuccess, findError; + addDraftSuccess, addDraftError, findSuccess, findError, i; t.step(function () { findSuccess = t.step_func(function (messages) { assert_type(messages, "array", "Not an array"); assert_greater_than(messages.length, 0, "Received empty messages array"); - for (var i in messages) { + for (i = 0; i < messages.length; i++) { assert_true(messages[i] instanceof tizen.Message, "Not a Message"); assert_in_array(TEST_EMAIL_RECIPIENT_1, messages[i].cc, "cc not found"); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_folderId_with_errorCallback.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_folderId_with_errorCallback.html index d708af0de..325ab6639 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_folderId_with_errorCallback.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_folderId_with_errorCallback.html @@ -41,14 +41,14 @@ setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), serviceSuccess, serviceError, service, message, filter, messageFound = false, - addDraftSuccess, addDraftError, findSuccess, findError; + addDraftSuccess, addDraftError, findSuccess, findError, i; t.step(function () { findSuccess = t.step_func(function (messages) { assert_type(messages, "array", "Not an array"); assert_greater_than(messages.length, 0, "Received empty messages array"); - for (var i in messages) { + for (i = 0; i < messages.length; i++) { assert_true(messages[i] instanceof tizen.Message, "Not a Message"); assert_equals(messages[i].folderId, message.folderId, "returned folderId is not equal"); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_from_with_errorCallback.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_from_with_errorCallback.html index 52e4826df..b16ccff45 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_from_with_errorCallback.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_from_with_errorCallback.html @@ -41,14 +41,14 @@ setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), serviceSuccess, serviceError, service, message, sendSuccess, sendError, syncSuccess, syncError, - filter, findSuccess, findError; + filter, findSuccess, findError, i; t.step(function () { findSuccess = t.step_func(function (messages) { assert_type(messages, "array", "Not an array"); assert_greater_than(messages.length, 0, "Received empty messages array"); - for (var i in messages) { + for (i = 0; i < messages.length; i++) { assert_true(messages[i] instanceof tizen.Message, "Not a Message"); assert_equals(messages[i].from, TEST_EMAIL_RECIPIENT_1, "returned from is not equal"); } diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_hasAttachment_with_errorCallback.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_hasAttachment_with_errorCallback.html index 7a40a3281..b0ec19cdb 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_hasAttachment_with_errorCallback.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_hasAttachment_with_errorCallback.html @@ -41,14 +41,14 @@ setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), serviceSuccess, serviceError, service, message, filter, messageFound = false, - addDraftSuccess, addDraftError, findSuccess, findError; + addDraftSuccess, addDraftError, findSuccess, findError, i; t.step(function () { - findSuccess = t.step_func(function (messages) { + findSuccess = t.step_func(function (messages) { assert_type(messages, "array", "Not an array"); assert_greater_than(messages.length, 0, "Received empty messages array"); - for (var i in messages) { + for (i = 0; i < messages.length; i++) { assert_true(messages[i] instanceof tizen.Message, "Not a Message"); assert_equals(messages[i].hasAttachment, true, "returned hasAttachment is not equal to true"); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_id_with_errorCallback.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_id_with_errorCallback.html index 930532f38..dea973b8c 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_id_with_errorCallback.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_id_with_errorCallback.html @@ -40,11 +40,11 @@ Authors: setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), - serviceSuccess, serviceError, service, message, filter, messageFound = false, + serviceSuccess, serviceError, service, message, filter, addDraftSuccess, addDraftError, findSuccess, findError; t.step(function () { - findSuccess = t.step_func(function (messages) { + findSuccess = t.step_func(function (messages) { assert_draft_message_equals(t, messages, message); t.done(); }); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_isHighPriority_with_errorCallback.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_isHighPriority_with_errorCallback.html index 4fe429736..be1d67a02 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_isHighPriority_with_errorCallback.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_isHighPriority_with_errorCallback.html @@ -41,14 +41,14 @@ setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), serviceSuccess, serviceError, service, message, filter, messageFound = false, - addDraftSuccess, addDraftError, findSuccess, findError; + addDraftSuccess, addDraftError, findSuccess, findError, i; t.step(function () { - findSuccess = t.step_func(function (messages) { + findSuccess = t.step_func(function (messages) { assert_type(messages, "array", "Not an array"); assert_greater_than(messages.length, 0, "Received empty messages array"); - for (var i in messages) { + for (i = 0; i < messages.length; i++) { assert_true(messages[i] instanceof tizen.Message, "Not a Message"); assert_equals(messages[i].isHighPriority, true, "returned isHighPriority is not equal to true"); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_isRead_with_errorCallback.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_isRead_with_errorCallback.html index 1af68553b..faaaff4c1 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_isRead_with_errorCallback.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_isRead_with_errorCallback.html @@ -43,14 +43,14 @@ var t = async_test(document.title, {timeout: 180000}), serviceSuccess, serviceError, service, message, filter, messageFound = false, inboxMessageId, sendSuccess, sendError, syncSuccess, syncError, findFoldersSuccess, findFoldersError, findInboxMessageSuccess, findInboxMessageError, updateSuccess, updateError, - findUpdatedMessagesSuccess, findUpdatedMessagesError, inboxFolder; + findUpdatedMessagesSuccess, findUpdatedMessagesError, inboxFolder, i; t.step(function () { - findUpdatedMessagesSuccess = t.step_func(function (messages) { + findUpdatedMessagesSuccess = t.step_func(function (messages) { assert_type(messages, "array", "Not an array"); assert_greater_than(messages.length, 0, "Received empty messages array"); - for (var i in messages) { + for (i = 0; i < messages.length; i++) { assert_true(messages[i] instanceof tizen.Message, "Not a Message"); assert_equals(messages[i].isRead, true, "returned isRead is not equal to true"); @@ -85,8 +85,6 @@ t.step(function () { inboxMessageId = messages[0].id; service.messageStorage.updateMessages(messages, updateSuccess, updateError); - - t.done(); }); findInboxMessageError = t.step_func(function (error) { diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_plainBody_with_errorCallback.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_plainBody_with_errorCallback.html index 1d03375d9..01735a283 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_plainBody_with_errorCallback.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_plainBody_with_errorCallback.html @@ -41,7 +41,7 @@ Authors: setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), serviceSuccess, serviceError, service, message, addDraftSuccess, - addDraftError, filter, findSuccess, findError, loadMessageBodySuccess, loadMessageBodyError; + addDraftError, filter, findSuccess, findError, loadMessageBodySuccess, loadMessageBodyError, i; t.step(function () { @@ -59,7 +59,7 @@ t.step(function () { assert_type(messages, "array", "Not an array"); assert_greater_than(messages.length, 0, "Received empty messages array"); - for (var i in messages) { + for (i = 0; i < messages.length; i++) { assert_true(messages[i] instanceof tizen.Message, "Not a Message"); if (messages[i].id === message.id) { service.loadMessageBody(messages[i], loadMessageBodySuccess, loadMessageBodyError); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_serviceId_with_errorCallback.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_serviceId_with_errorCallback.html index ffbe16c2f..12c9a45c5 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_serviceId_with_errorCallback.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_serviceId_with_errorCallback.html @@ -41,14 +41,14 @@ setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), serviceSuccess, serviceError, service, message, filter, messageFound = false, - addDraftSuccess, addDraftError, findSuccess, findError; + addDraftSuccess, addDraftError, findSuccess, findError, i; t.step(function () { - findSuccess = t.step_func(function (messages) { + findSuccess = t.step_func(function (messages) { assert_type(messages, "array", "Not an array"); assert_greater_than(messages.length, 0, "Received empty messages array"); - for (var i in messages) { + for (i = 0; i < messages.length; i++) { assert_true(messages[i] instanceof tizen.Message, "Not a Message"); assert_equals(messages[i].type, service.type, "Invalid service type"); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_timestamp_with_errorCallback.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_timestamp_with_errorCallback.html index d9a9dff1c..5dd4a9233 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_timestamp_with_errorCallback.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_timestamp_with_errorCallback.html @@ -39,16 +39,16 @@ Authors: //==== TEST_CRITERIA MOA setup({timeout: 180000}); -var t = async_test(document.title, {timeout: 180000}), +var t = async_test(document.title, {timeout: 180000}), i, serviceSuccess, serviceError, service, message, filter, messageFound = false, addDraftSuccess, addDraftError, findSuccess, findError, timeRange = 180000; t.step(function () { - findSuccess = t.step_func(function (messages) { + findSuccess = t.step_func(function (messages) { assert_type(messages, "array", "Not an array"); assert_greater_than(messages.length, 0, "Received empty messages array"); - for (var i in messages) { + for (i = 0; i < messages.length; i++) { assert_true(messages[i] instanceof tizen.Message, "Not a Message"); if (messages[i].id === message.id) { diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_to_with_errorCallback.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_to_with_errorCallback.html index 9282f902c..1c40ce68c 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_to_with_errorCallback.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_to_with_errorCallback.html @@ -40,14 +40,14 @@ Authors: setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), serviceSuccess, serviceError, service, message, filter, messageFound = false, - addDraftSuccess, addDraftError, findSuccess, findError; + addDraftSuccess, addDraftError, findSuccess, findError, i; t.step(function () { findSuccess = t.step_func(function (messages) { assert_type(messages, "array", "Not an array"); assert_greater_than(messages.length, 0, "Received empty messages array"); - for (var i in messages) { + for (i = 0; i < messages.length; i++) { assert_true(messages[i] instanceof tizen.Message, "Not a Message"); assert_in_array(TEST_EMAIL_RECIPIENT_2, messages[i].to, "to not found"); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_type_with_errorCallback.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_type_with_errorCallback.html index 633d7b56f..cab2fa7d6 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_type_with_errorCallback.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_findMessages_type_with_errorCallback.html @@ -41,14 +41,14 @@ setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), serviceSuccess, serviceError, service, message, filter, messageFound = false, - addDraftSuccess, addDraftError, findSuccess, findError; + addDraftSuccess, addDraftError, findSuccess, findError, i; t.step(function () { findSuccess = t.step_func(function (messages) { assert_type(messages, "array", "Not an array"); assert_greater_than(messages.length, 0, "Received empty messages array"); - for (var i in messages) { + for (i = 0; i < messages.length; i++) { assert_true(messages[i] instanceof tizen.Message, "Not a Message"); assert_equals(messages[i].type, message.type, "returned type is not equal"); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_updateMessages.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_updateMessages.html index bf2972907..abce193a2 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_updateMessages.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_updateMessages.html @@ -42,7 +42,7 @@ setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), serviceSuccess, serviceError, service, mutableMessage, constMessage, - plainBodyToSetForMutableMesage = MESSAGE_BODY_PLAIN + "_mutable", + plainBodyToSetForMutableMessage = MESSAGE_BODY_PLAIN + "_mutable", plainBodyToSetForConstMessage = MESSAGE_BODY_PLAIN + "_const", addDraftSuccess, addDraftError, addDraftSuccessCounter = 0, returnedValue = null, updateSuccess, updateError, mutableMessagefilter, constMessagefilter, @@ -102,7 +102,7 @@ t.step(function () { }); loadConstAttachmentSuccess = t.step_func(function (attachment) { - testAttachment(attachment, consts); + testAttachment(attachment, consts); }); loadConstAttachmentError = t.step_func(function (error) { @@ -126,12 +126,17 @@ t.step(function () { assert_equals(messageToTest.body.plainBody, originalMessage.body.plainBody, type + " body.plainBody attribute."); assert_equals(messageToTest.body.htmlBody, originalMessage.body.htmlBody, type + " body.htmlBody attribute."); - assert_equals(messageToTest.body.inlineAttachments.length, originalMessage.body.inlineAttachments.length, type + " incorrect length of inlineAttachments"); + assert_equals(messageToTest.body.inlineAttachments.length, originalMessage.body.inlineAttachments.length, + type + " incorrect length of inlineAttachments"); for (i = 0; i < originalMessage.body.inlineAttachments.length; i++) { - assert_equals(messageToTest.body.inlineAttachments[i].id, originalMessage.body.inlineAttachments[i].id, type + " message.body.inlineAttachments[" + i + "].id"); - assert_equals(messageToTest.body.inlineAttachments[i].messageId, originalMessage.body.inlineAttachments[i].messageId, type + " message.body.inlineAttachments[" + i + "].messageId"); - assert_equals(messageToTest.body.inlineAttachments[i].messageId, originalMessage.id, type + " message.body.inlineAttachments[" + i + "].messageId - (with message.id)"); - assert_equals(messageToTest.body.inlineAttachments[i].mimeType, originalMessage.body.inlineAttachments[i].mimeType, type + " message.body.inlineAttachments[" + i + "].mimeType"); + assert_equals(messageToTest.body.inlineAttachments[i].id, originalMessage.body.inlineAttachments[i].id, + type + " message.body.inlineAttachments[" + i + "].id"); + assert_equals(messageToTest.body.inlineAttachments[i].messageId, originalMessage.body.inlineAttachments[i].messageId, + type + " message.body.inlineAttachments[" + i + "].messageId"); + assert_equals(messageToTest.body.inlineAttachments[i].messageId, originalMessage.id, + type + " message.body.inlineAttachments[" + i + "].messageId - (with message.id)"); + assert_equals(messageToTest.body.inlineAttachments[i].mimeType, originalMessage.body.inlineAttachments[i].mimeType, + type + " message.body.inlineAttachments[" + i + "].mimeType"); assert_type(messageToTest.body.inlineAttachments[i].filePath, "string", type + " attachment.filePath is not a string"); assert_not_equals(messageToTest.body.inlineAttachments[i].filePath, "", type + " attachment.filePath is empty"); } @@ -230,7 +235,7 @@ t.step(function () { mutableMessage = new tizen.Message("messaging.email", { subject: generateSubject(), to: [TEST_EMAIL_RECIPIENT_2], - plainBody: plainBodyToSetForMutableMesage, + plainBody: plainBodyToSetForMutableMessage, htmlBody: MESSAGE_BODY_HTML, isHighPriority: false }); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_updateMessages_errorCallback_invalid_cb.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_updateMessages_errorCallback_invalid_cb.html index bd52dec5d..7e0201c14 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_updateMessages_errorCallback_invalid_cb.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_updateMessages_errorCallback_invalid_cb.html @@ -42,7 +42,7 @@ setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), serviceSuccess, serviceError, service, message, - addDraftSuccess, addDraftError, exceptionName = "TypeMismatchError", + addDraftSuccess, addDraftError, updateSuccess, incorrectCallback; t.step(function () { @@ -52,15 +52,14 @@ t.step(function () { incorrectCallback = { onerror: t.step_func(function (error) { - assert_unreached("addDraftMessage() incorrect error callback invoked: name:" + error.name + ", msg:" + error.message); + assert_unreached("addDraftMessage() incorrect error callback invoked: name:" + error.name + ", msg:" + error.message); }) }; addDraftSuccess = t.step_func(function () { - assert_throws({name: exceptionName}, - function () { - service.messageStorage.updateMessages([message], updateSuccess, incorrectCallback); - }, exceptionName + " should be thrown - given incorrect error callback - " + incorrectCallback); + assert_throws(TYPE_MISMATCH_EXCEPTION, function () { + service.messageStorage.updateMessages([message], updateSuccess, incorrectCallback); + }, "Given invalid error callback"); t.done(); }); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_updateMessages_successCallback_invalid_cb.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_updateMessages_successCallback_invalid_cb.html index cf9533cdf..de6aac303 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_updateMessages_successCallback_invalid_cb.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_updateMessages_successCallback_invalid_cb.html @@ -52,7 +52,7 @@ t.step(function () { incorrectCallback = { onsuccess: t.step_func(function () { - assert_unreached("addDraftMessage() incorrect success callback invoked"); + assert_unreached("addDraftMessage() incorrect success callback invoked"); }) }; diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_updateMessages_without_errorCallback.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_updateMessages_without_errorCallback.html index 2ae111245..1e71e73e3 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_updateMessages_without_errorCallback.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_updateMessages_without_errorCallback.html @@ -43,7 +43,7 @@ var t = async_test(document.title, {timeout: 180000}); t.step(function () { var serviceSuccess, serviceError, service, mutableMessage, constMessage, - plainBodyToSetForMutableMesage = MESSAGE_BODY_PLAIN + "_mutable", + plainBodyToSetForMutableMessage = MESSAGE_BODY_PLAIN + "_mutable", plainBodyToSetForConstMessage = MESSAGE_BODY_PLAIN + "_const", addDraftSuccess, addDraftError, addDraftSuccessCounter = 0, returnedValue = null, updateSuccess, mutableMessagefilter, constMessagefilter, @@ -102,7 +102,7 @@ t.step(function () { }); loadConstAttachmentSuccess = t.step_func(function (attachment) { - testAttachment(attachment, consts); + testAttachment(attachment, consts); }); loadConstAttachmentError = t.step_func(function (error) { @@ -126,12 +126,17 @@ t.step(function () { assert_equals(messageToTest.body.plainBody, originalMessage.body.plainBody, type + " body.plainBody attribute."); assert_equals(messageToTest.body.htmlBody, originalMessage.body.htmlBody, type + " body.htmlBody attribute."); - assert_equals(messageToTest.body.inlineAttachments.length, originalMessage.body.inlineAttachments.length, type + " incorrect length of inlineAttachments"); + assert_equals(messageToTest.body.inlineAttachments.length, originalMessage.body.inlineAttachments.length, + type + " incorrect length of inlineAttachments"); for (i = 0; i < originalMessage.body.inlineAttachments.length; i++) { - assert_equals(messageToTest.body.inlineAttachments[i].id, originalMessage.body.inlineAttachments[i].id, type + " message.body.inlineAttachments[" + i + "].id"); - assert_equals(messageToTest.body.inlineAttachments[i].messageId, originalMessage.body.inlineAttachments[i].messageId, type + " message.body.inlineAttachments[" + i + "].messageId"); - assert_equals(messageToTest.body.inlineAttachments[i].messageId, originalMessage.id, type + " message.body.inlineAttachments[" + i + "].messageId - (with message.id)"); - assert_equals(messageToTest.body.inlineAttachments[i].mimeType, originalMessage.body.inlineAttachments[i].mimeType, type + " message.body.inlineAttachments[" + i + "].mimeType"); + assert_equals(messageToTest.body.inlineAttachments[i].id, originalMessage.body.inlineAttachments[i].id, + type + " message.body.inlineAttachments[" + i + "].id"); + assert_equals(messageToTest.body.inlineAttachments[i].messageId, originalMessage.body.inlineAttachments[i].messageId, + type + " message.body.inlineAttachments[" + i + "].messageId"); + assert_equals(messageToTest.body.inlineAttachments[i].messageId, originalMessage.id, + type + " message.body.inlineAttachments[" + i + "].messageId - (with message.id)"); + assert_equals(messageToTest.body.inlineAttachments[i].mimeType, originalMessage.body.inlineAttachments[i].mimeType, + type + " message.body.inlineAttachments[" + i + "].mimeType"); assert_type(messageToTest.body.inlineAttachments[i].filePath, "string", type + " attachment.filePath is not a string"); assert_not_equals(messageToTest.body.inlineAttachments[i].filePath, "", type + " attachment.filePath is empty"); } @@ -236,7 +241,7 @@ t.step(function () { mutableMessage = new tizen.Message("messaging.email", { subject: generateSubject(), to: [TEST_EMAIL_RECIPIENT_2], - plainBody: plainBodyToSetForMutableMesage, + plainBody: plainBodyToSetForMutableMessage, htmlBody: MESSAGE_BODY_HTML, isHighPriority: false }); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_updateMessages_without_successCallback.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_updateMessages_without_successCallback.html index 7bc2b405a..da406312b 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_updateMessages_without_successCallback.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_email_updateMessages_without_successCallback.html @@ -40,7 +40,7 @@ Authors: setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), serviceSuccess, serviceError, service, mutableMessage, - constMessage, plainBodyToSetForMutableMesage = MESSAGE_BODY_PLAIN + "_mutable", plainBodyToSetForConstMessage = MESSAGE_BODY_PLAIN + "_const", + constMessage, plainBodyToSetForMutableMessage = MESSAGE_BODY_PLAIN + "_mutable", plainBodyToSetForConstMessage = MESSAGE_BODY_PLAIN + "_const", addDraftSuccess, addDraftError, addDraftSuccessCounter = 0, returnedValue; t.step(function () { @@ -79,7 +79,7 @@ t.step(function () { mutableMessage = new tizen.Message("messaging.email", { subject: generateSubject(), to: [TEST_EMAIL_RECIPIENT_2], - plainBody: plainBodyToSetForMutableMesage, + plainBody: plainBodyToSetForMutableMessage, htmlBody: MESSAGE_BODY_HTML, isHighPriority: false }); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_findFolders_errorCallback_invalid_cb.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_findFolders_errorCallback_invalid_cb.html index c04ffe235..503417ed3 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_findFolders_errorCallback_invalid_cb.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_findFolders_errorCallback_invalid_cb.html @@ -50,19 +50,16 @@ t.step(function () { incorrectCallback = { onerror: t.step_func(function () { - assert_unreached("findFolders() incorrect error callback invoked"); + assert_unreached("findFolders() incorrect error callback invoked"); }) }; serviceSuccess = t.step_func(function (service) { filter = new tizen.AttributeFilter("serviceId", "EXACTLY", service.id); - assert_throws(TYPE_MISMATCH_EXCEPTION, - function () { - service.messageStorage.findFolders(filter, findSuccess, incorrectCallback); - }, - "TypeMismatch expected when invalid error callback given." - ); + assert_throws(TYPE_MISMATCH_EXCEPTION, function () { + service.messageStorage.findFolders(filter, findSuccess, incorrectCallback); + }, "Given invalid error callback"); t.done(); }); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_findFolders_successCallback_invalid_cb.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_findFolders_successCallback_invalid_cb.html index b73c0d711..2b5540836 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_findFolders_successCallback_invalid_cb.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_findFolders_successCallback_invalid_cb.html @@ -46,19 +46,16 @@ var t = async_test(document.title, {timeout: 180000}), t.step(function () { incorrectCallback = { onsuccess: t.step_func(function () { - assert_unreached("findFolders() incorrect error callback invoked"); + assert_unreached("findFolders() incorrect error callback invoked"); }) }; serviceSuccess = t.step_func(function (service) { filter = new tizen.AttributeFilter("serviceId", "EXACTLY", service.id); - assert_throws(TYPE_MISMATCH_EXCEPTION, - function () { - service.messageStorage.findFolders(filter, incorrectCallback); - }, - "TypeMismatch expected when invalid success callback given." - ); + assert_throws(TYPE_MISMATCH_EXCEPTION, function () { + service.messageStorage.findFolders(filter, incorrectCallback); + }, "Given invalid success callback"); t.done(); }); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_removeChangeListener.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_removeChangeListener.html index c8c0a449d..78e7d7906 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_removeChangeListener.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_removeChangeListener.html @@ -40,7 +40,7 @@ Authors: setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), - serviceSuccess, serviceError, service, message1, message2, listenerId, + serviceSuccess, serviceError, service, message1, message2, listenerId, i, addDraftSuccess, addDraftError, messageChangeCallback, returnedValue = null; t.step(function () { @@ -68,7 +68,7 @@ t.step(function () { assert_type(addedMessages, "array", "Not an array"); assert_greater_than(addedMessages.length, 0, "Received empty messages array"); - for (var i in addedMessages) { + for (i = 0; i < addedMessages.length; i++) { if (addedMessages[i].id === message1.id) { returnedValue = service.messageStorage.removeChangeListener(listenerId); assert_equals(returnedValue, undefined, "Incorrect value returned."); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_removeConversations_conversations_TypeMismatch.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_removeConversations_conversations_TypeMismatch.html index 79ed6716d..d4d5ca0b5 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_removeConversations_conversations_TypeMismatch.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_removeConversations_conversations_TypeMismatch.html @@ -49,8 +49,8 @@ message_conversation_test(t, function (service, message, conversation) { exceptionName = conversionTable[i][1]; assert_throws({name: exceptionName}, function () { - service.messageStorage.removeConversations(conversations); - }, exceptionName + " should be thrown - given incorrect successCallback."); + service.messageStorage.removeConversations(conversations); + }, "Given incorrect conversations"); } t.done(); }); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_removeMessages_email_errorCallback_invalid_cb.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_removeMessages_email_errorCallback_invalid_cb.html index c7ce40249..6afe2fe90 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_removeMessages_email_errorCallback_invalid_cb.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_removeMessages_email_errorCallback_invalid_cb.html @@ -42,7 +42,7 @@ setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), serviceSuccess, serviceError, service, message, addDraftSuccess, addDraftError, - successCallback, exceptionName = "TypeMismatchError", incorrectCallback; + successCallback, incorrectCallback; t.step(function () { successCallback = t.step_func(function () { @@ -56,10 +56,9 @@ t.step(function () { }; addDraftSuccess = t.step_func(function () { - assert_throws({name: exceptionName}, - function () { - service.messageStorage.removeMessages([message], successCallback, incorrectCallback); - }, exceptionName + " should be thrown - given incorrect success callback."); + assert_throws(TYPE_MISMATCH_EXCEPTION, function () { + service.messageStorage.removeMessages([message], successCallback, incorrectCallback); + }, "Incorrect error callback."); t.done(); }); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_removeMessages_email_missarg.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_removeMessages_email_missarg.html index 679ac95fc..7132c461e 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_removeMessages_email_missarg.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_removeMessages_email_missarg.html @@ -44,10 +44,9 @@ var t = async_test(document.title, {timeout: 180000}), t.step(function () { addDraftSuccess = t.step_func(function () { - assert_throws(TYPE_MISMATCH_EXCEPTION, - function () { - service.messageStorage.removeMessages(); - }, "TypeMismatchError" + " should be thrown - given incorrect success callback."); + assert_throws(TYPE_MISMATCH_EXCEPTION, function () { + service.messageStorage.removeMessages(); + }, "Missing argument."); t.done(); }); diff --git a/tct-messaging-email-tizen-tests/messaging/MessageStorage_removeMessages_email_successCallback_invalid_cb.html b/tct-messaging-email-tizen-tests/messaging/MessageStorage_removeMessages_email_successCallback_invalid_cb.html index 2e81e5c84..bd0016483 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessageStorage_removeMessages_email_successCallback_invalid_cb.html +++ b/tct-messaging-email-tizen-tests/messaging/MessageStorage_removeMessages_email_successCallback_invalid_cb.html @@ -42,7 +42,7 @@ setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), serviceSuccess, serviceError, service, message, addDraftSuccess, addDraftError, - exceptionName = "TypeMismatchError", incorrectCallback; + incorrectCallback; t.step(function () { incorrectCallback = { @@ -52,10 +52,10 @@ t.step(function () { }; addDraftSuccess = t.step_func(function () { - assert_throws({name: exceptionName}, - function () { - service.messageStorage.removeMessages([message], incorrectCallback); - }, exceptionName + " should be thrown - given incorrect success callback."); + assert_throws(TYPE_MISMATCH_EXCEPTION, function () { + service.messageStorage.removeMessages([message], incorrectCallback); + }, "Given incorrect success callback."); + t.done(); }); diff --git a/tct-messaging-email-tizen-tests/messaging/MessagesChangeCallback_email_messagesadded_without_filter.html b/tct-messaging-email-tizen-tests/messaging/MessagesChangeCallback_email_messagesadded_without_filter.html index 43a0be86b..4758759b6 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessagesChangeCallback_email_messagesadded_without_filter.html +++ b/tct-messaging-email-tizen-tests/messaging/MessagesChangeCallback_email_messagesadded_without_filter.html @@ -40,7 +40,7 @@ Authors: //==== TEST_CRITERIA CBOA CBT setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), serviceSuccess, serviceError, service, watcherId, - message, changeCallback, addDraftError; + message, changeCallback, addDraftError, i; t.step(function () { add_result_callback(function (res) { @@ -56,7 +56,7 @@ t.step(function () { assert_type(addedMessages, "array", "Not an array."); assert_greater_than(addedMessages.length, 0, "Received incorrect number of messages"); - for (var i in addedMessages) { + for (i = 0; i < addedMessages.length; i++) { assert_true(addedMessages[i] instanceof tizen.Message, "Not a message."); assert_equals(addedMessages[i].subject, message.subject, "Incorrect subject."); diff --git a/tct-messaging-email-tizen-tests/messaging/MessagesChangeCallback_email_messagesremoved_with_filter.html b/tct-messaging-email-tizen-tests/messaging/MessagesChangeCallback_email_messagesremoved_with_filter.html index 286c3de45..f859e0207 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessagesChangeCallback_email_messagesremoved_with_filter.html +++ b/tct-messaging-email-tizen-tests/messaging/MessagesChangeCallback_email_messagesremoved_with_filter.html @@ -40,7 +40,7 @@ Authors: //==== TEST_CRITERIA CBOA CBT setup({timeout: 180000}); -var t = async_test(document.title, {timeout: 180000}), +var t = async_test(document.title, {timeout: 180000}), i, serviceSuccess, serviceError, service, watcherId, filter, matchMessage, mismatchMessage, changeCallback, addDraftError, addDraftSuccess, addDraftSuccessCounter = 0, removeError; @@ -58,7 +58,7 @@ t.step(function () { assert_type(removedMessages, "array", "Not an array."); assert_greater_than(removedMessages.length, 0, "Received empty messages array"); - for (var i in removedMessages) { + for (i = 0; i < removedMessages.length; i++) { assert_true(removedMessages[i] instanceof tizen.Message, "Not a message."); if (removedMessages[i].id === matchMessage.id) { diff --git a/tct-messaging-email-tizen-tests/messaging/MessagesChangeCallback_email_messagesremoved_without_filter.html b/tct-messaging-email-tizen-tests/messaging/MessagesChangeCallback_email_messagesremoved_without_filter.html index 701edfc58..0f370b4d5 100644 --- a/tct-messaging-email-tizen-tests/messaging/MessagesChangeCallback_email_messagesremoved_without_filter.html +++ b/tct-messaging-email-tizen-tests/messaging/MessagesChangeCallback_email_messagesremoved_without_filter.html @@ -40,7 +40,7 @@ Authors: //==== TEST_CRITERIA CBOA CBT setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), serviceSuccess, serviceError, messageService, messageStorage, - watcherId, message, changeCallback, addDraftSuccess, addDraftError, removeError; + watcherId, message, changeCallback, addDraftSuccess, addDraftError, removeError, i; t.step(function () { add_result_callback(function (res) { @@ -56,7 +56,7 @@ t.step(function () { assert_type(removedMessages, "array", "Not an array."); assert_greater_than(removedMessages.length, 0, "Received incorrect number of messages"); - for (var i in removedMessages) { + for (i = 0; i < removedMessages.length; i++) { assert_true(removedMessages[i] instanceof tizen.Message, "Not a message."); if (removedMessages[i].id === message.id) {