From 5dd483dcb59a94f4fb87130958b74a48d0739c4e Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Wed, 25 May 2016 14:28:38 +0200 Subject: [PATCH] TestsUI: fix notification test --- Classes/LinphoneManager.m | 3 +++ TestsUI/LinphoneTestCase.m | 11 +++++++---- TestsUI/NotificationTester.m | 2 +- submodules/bctoolbox | 2 +- submodules/linphone | 2 +- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 184f94dd6..329030439 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -2075,9 +2075,12 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) { @"call-snd=%@;pn-msg-snd=msg.caf", [[NSBundle mainBundle] bundleIdentifier], APPMODE_SUFFIX, tokenString, ring]; + LOGI(@"Proxy config %s configured for push notifications with contact: %@", + linphone_proxy_config_get_identity(proxyCfg), params); linphone_proxy_config_set_contact_uri_parameters(proxyCfg, [params UTF8String]); linphone_proxy_config_set_contact_parameters(proxyCfg, NULL); } else { + LOGI(@"Proxy config %s NOT configured for push notifications", linphone_proxy_config_get_identity(proxyCfg)); // no push token: linphone_proxy_config_set_contact_uri_parameters(proxyCfg, NULL); linphone_proxy_config_set_contact_parameters(proxyCfg, NULL); diff --git a/TestsUI/LinphoneTestCase.m b/TestsUI/LinphoneTestCase.m index a99e6c221..2f75e3fc1 100644 --- a/TestsUI/LinphoneTestCase.m +++ b/TestsUI/LinphoneTestCase.m @@ -71,6 +71,10 @@ return @"test.linphone.org"; } +- (NSString *)accountProxyRoute { + return [[self accountDomain] stringByAppendingString:@";transport=tcp"]; +} + - (NSString *)getUUID { return [[[NSUUID UUID] UUIDString] substringToIndex:8].lowercaseString; } @@ -122,10 +126,9 @@ LinphoneProxyConfig *testProxy = linphone_proxy_config_new(); linphone_proxy_config_set_identity_address(testProxy, testAddr); - char *server_addr = ms_strdup_printf("%s;transport=tcp", linphone_address_get_domain(testAddr)); - linphone_proxy_config_set_server_addr(testProxy, server_addr); - linphone_proxy_config_set_route(testProxy, server_addr); - ms_free(server_addr); + linphone_proxy_config_set_server_addr(testProxy, [self accountProxyRoute].UTF8String); + linphone_proxy_config_set_route(testProxy, [self accountProxyRoute].UTF8String); + linphone_proxy_config_set_ref_key(testProxy, "push_notification"); LinphoneAuthInfo *testAuth = linphone_auth_info_new(linphone_address_get_username(testAddr), NULL, linphone_address_get_username(testAddr), NULL, NULL, diff --git a/TestsUI/NotificationTester.m b/TestsUI/NotificationTester.m index 889c9cfee..dd9abe439 100644 --- a/TestsUI/NotificationTester.m +++ b/TestsUI/NotificationTester.m @@ -30,7 +30,7 @@ [tester tapViewWithAccessibilityLabel:@"Chat"]; // it can take several seconds to receive the remote push notification... - int timeout = 5; + int timeout = 15; while (timeout > 0) { [tester tryFindingViewWithAccessibilityLabel:@"Contact name, Message" error:nil]; timeout--; diff --git a/submodules/bctoolbox b/submodules/bctoolbox index e654c0082..9e9857e10 160000 --- a/submodules/bctoolbox +++ b/submodules/bctoolbox @@ -1 +1 @@ -Subproject commit e654c008283c942345ac20540981ba854d9138ba +Subproject commit 9e9857e103d22a4995970133bc2866befadcd198 diff --git a/submodules/linphone b/submodules/linphone index 36fd57c45..9eb98a78f 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 36fd57c45b9b6ebbafbe57e5be4c5e2120a281cf +Subproject commit 9eb98a78f9f44a5506d7ca627aaf5e6bbec3f0db