Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblinphone
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
10
Issues
10
List
Board
Labels
Milestones
Merge Requests
22
Merge Requests
22
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BC
public
liblinphone
Commits
18d0c4ad
Commit
18d0c4ad
authored
Mar 07, 2018
by
jehan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve message tester for file transfer
parent
b6496cbf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
2 deletions
+32
-2
file-transfer-chat-message-modifier.cpp
src/chat/modifier/file-transfer-chat-message-modifier.cpp
+2
-2
message_tester.c
tester/message_tester.c
+30
-0
No files found.
src/chat/modifier/file-transfer-chat-message-modifier.cpp
View file @
18d0c4ad
...
...
@@ -361,8 +361,8 @@ void FileTransferChatMessageModifier::processResponseFromPostFile (const belle_h
fileTransferContent
->
setContentType
(
ContentType
::
FileTransfer
);
fileTransferContent
->
setFileContent
(
fileContent
);
message
->
removeContent
(
*
fileContent
);
message
->
addContent
(
*
fileTransferContent
);
message
->
getPrivate
()
->
removeContent
(
*
fileContent
);
message
->
getPrivate
()
->
addContent
(
*
fileTransferContent
);
message
->
getPrivate
()
->
setState
(
ChatMessage
::
State
::
FileTransferDone
);
releaseHttpRequest
();
...
...
tester/message_tester.c
View file @
18d0c4ad
...
...
@@ -533,6 +533,7 @@ void transfer_message_base2(LinphoneCoreManager* marie, LinphoneCoreManager* pau
/* wait for a long time in case the DNS SRV resolution takes times - it should be immediate though */
if
(
BC_ASSERT_TRUE
(
wait_for_until
(
pauline
->
lc
,
marie
->
lc
,
&
marie
->
stat
.
number_of_LinphoneFileTransferDownloadSuccessful
,
1
,
55000
)))
{
compare_files
(
send_filepath
,
receive_filepath
);
}
}
}
...
...
@@ -1587,6 +1588,8 @@ void crash_during_file_transfer(void) {
/* Create a new core and check that the message stored in the saved database is in the not delivered state */
linphone_core_manager_restart
(
pauline
,
TRUE
);
linphone_core_set_file_transfer_server
(
pauline
->
lc
,
"https://www.linphone.org:444/lft.php"
);
//BC_ASSERT_TRUE(wait_for(pauline->lc, pauline->lc, &pauline->stat.number_of_LinphoneRegistrationOk, 1));
chat_room
=
linphone_core_get_chat_room
(
pauline
->
lc
,
marie
->
identity
);
...
...
@@ -1596,9 +1599,36 @@ void crash_during_file_transfer(void) {
msg_list
=
linphone_chat_room_get_history
(
chat_room
,
0
);
LinphoneChatMessage
*
sent_msg
=
(
LinphoneChatMessage
*
)
bctbx_list_get_data
(
msg_list
);
BC_ASSERT_EQUAL
((
int
)
linphone_chat_message_get_state
(
sent_msg
),
(
int
)
LinphoneChatMessageStateNotDelivered
,
int
,
"%d"
);
//resend
LinphoneChatMessageCbs
*
cbs
=
linphone_chat_message_get_callbacks
(
sent_msg
);
linphone_chat_message_cbs_set_file_transfer_send
(
cbs
,
tester_file_transfer_send
);
linphone_chat_message_cbs_set_msg_state_changed
(
cbs
,
liblinphone_tester_chat_message_msg_state_changed
);
linphone_chat_message_cbs_set_file_transfer_progress_indication
(
cbs
,
file_transfer_progress_indication
);
linphone_chat_message_send
(
sent_msg
);
if
(
BC_ASSERT_TRUE
(
wait_for_until
(
pauline
->
lc
,
marie
->
lc
,
&
marie
->
stat
.
number_of_LinphoneMessageReceivedWithFile
,
1
,
60000
)))
{
linphone_core_manager_stop
(
marie
);
/* Create a new core and check that the message stored in the saved database is in the not delivered state */
linphone_core_manager_restart
(
marie
,
TRUE
);
LinphoneChatRoom
*
marie_room
=
linphone_core_get_chat_room
(
marie
->
lc
,
pauline
->
identity
);
bctbx_list_t
*
msg_list_2
=
linphone_chat_room_get_history
(
marie_room
,
1
);
BC_ASSERT_PTR_NOT_NULL
(
msg_list_2
);
LinphoneChatMessage
*
recv_msg
=
(
LinphoneChatMessage
*
)
msg_list_2
->
data
;
LinphoneChatMessageCbs
*
cbs
=
linphone_chat_message_get_callbacks
(
recv_msg
);
linphone_chat_message_cbs_set_msg_state_changed
(
cbs
,
liblinphone_tester_chat_message_msg_state_changed
);
linphone_chat_message_cbs_set_file_transfer_recv
(
cbs
,
file_transfer_received
);
linphone_chat_message_cbs_set_file_transfer_progress_indication
(
cbs
,
file_transfer_progress_indication
);
linphone_chat_message_download_file
(
recv_msg
);
/* wait for a long time in case the DNS SRV resolution takes times - it should be immediate though */
if
(
BC_ASSERT_TRUE
(
wait_for_until
(
pauline
->
lc
,
marie
->
lc
,
&
marie
->
stat
.
number_of_LinphoneFileTransferDownloadSuccessful
,
1
,
55000
)))
{
BC_ASSERT_PTR_NULL
(
linphone_chat_message_get_external_body_url
(
recv_msg
));
}
bctbx_list_free_with_data
(
msg_list_2
,
(
bctbx_list_free_func
)
linphone_chat_message_unref
);
}
}
bctbx_list_free_with_data
(
msg_list
,
(
bctbx_list_free_func
)
linphone_chat_message_unref
);
linphone_core_manager_destroy
(
pauline
);
linphone_core_manager_destroy
(
marie
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment