avk_other_uriagent.cpp
16.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
#ifdef __MMI_URI_AGENT__
extern "C"
{
#include "UriAgentSrvGprot.h"
}
extern "C"
{
void dummy_scheme_uri_request_hdlr(srv_uriagent_appid_enum ura_appid, char *url, char *param,
srv_uriagent_options_enum options,
srv_uriagent_uri_request_hdlr_cb cb)
{
}
void dummy_prefix_hdlr(srv_uriagent_appid_enum ura_appid, char *url, char *param,
srv_uriagent_options_enum options,
srv_uriagent_uri_request_hdlr_cb cb)
{
}
void brwapp_uri_request_cb(srv_uriagent_appid_enum ura_appid, srv_uriagent_appid_enum uha_appid,
S32 result)
{}
void mmsapp_uri_request_cb(srv_uriagent_appid_enum ura_appid, srv_uriagent_appid_enum uha_appid,
S32 result)
{}
void smsapp_uri_request_cb(srv_uriagent_appid_enum ura_appid, srv_uriagent_appid_enum uha_appid,
S32 result)
{}
void unused_uri_request_cb(srv_uriagent_appid_enum ura_appid, srv_uriagent_appid_enum uha_appid,
S32 result)
{}
}
AVK_CASE(AVK_OTHER_URI_001, AVK_OTHER_URI)
{
AVK_LOG_EX(SRV_URIAGENT_ERR_OK == srv_uriagent_register_hdlr_by_prefix("wtai://wp/er", dummy_prefix_hdlr, MMI_FALSE));
AVK_LOG_EX(SRV_URIAGENT_ERR_OK == srv_uriagent_register_hdlr_by_scheme("scheme1", dummy_scheme_uri_request_hdlr, MMI_FALSE));
}
AVK_CASE(AVK_OTHER_URI_002, AVK_OTHER_URI)
{
U32 err_code = 0;
/* TC-URIAgent-D000: Success to dispatch URI request "scheme:ThisIsURL" from URA to UHA (callback is NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_SMS, "scheme:ThisIsURL", SRV_URIAGENT_OPTION_UNSPECIFIED, NULL);
/* TC-URIAgent-D001: Success to dispatch URI request "scheme:ThisIsURL" from URA to UHA (callback is not NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_SMS, "scheme:ThisIsURL", SRV_URIAGENT_OPTION_UNSPECIFIED, smsapp_uri_request_cb);
/* TC-URIAgent-D002: Success to dispatch URI request "schemeA:ThisIsURL" from URA to UHA (callback is NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_MMS, "schemeA:ThisIsURL", SRV_URIAGENT_OPTION_NEED_CONFIRM_POPUP, NULL);
/* TC-URIAgent-D003: Success to dispatch URI request "schemeA:ThisIsURL" from URA to UHA (callback is not NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_MMS, "schemeA:ThisIsURL", SRV_URIAGENT_OPTION_NEED_CONFIRM_POPUP, mmsapp_uri_request_cb);
/* TC-URIAgent-D004: Success to dispatch URI request "schemeB:ThisIsURL" from URA to UHA (callback is NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_BRW, "schemeB:ThisIsURL", SRV_URIAGENT_OPTION_UNSPECIFIED, NULL);
/* TC-URIAgent-D005: Success to dispatch URI request "schemeB:ThisIsURL" from URA to UHA (callback is not NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_BRW, "schemeB:ThisIsURL", SRV_URIAGENT_OPTION_UNSPECIFIED, brwapp_uri_request_cb);
/* TC-URIAgent-D006: Success to dispatch URI request "scheme:formatThisIsURL" from URA to UHA (callback is NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_SMS, "scheme:formatThisIsURL", SRV_URIAGENT_OPTION_UNSPECIFIED,NULL);
/* TC-URIAgent-D007: Success to dispatch URI request "scheme:formatThisIsURL" from URA to UHA (callback is not NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_SMS, "scheme:formatThisIsURL", SRV_URIAGENT_OPTION_UNSPECIFIED, smsapp_uri_request_cb);
/* TC-URIAgent-D008: Success to dispatch URI request "scheme:formatAThisIsURL" from URA to UHA (callback is NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_MMS, "scheme:formatAThisIsURL", SRV_URIAGENT_OPTION_UNSPECIFIED, NULL);
/* TC-URIAgent-D009: Success to dispatch URI request "scheme:formatAThisIsURL" from URA to UHA (callback is not NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_MMS, "scheme:formatAThisIsURL", SRV_URIAGENT_OPTION_UNSPECIFIED, mmsapp_uri_request_cb);
/* TC-URIAgent-D010: Success to dispatch URI request "scheme:formatBThisIsURL" from URA to UHA (callback is NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_BRW, "scheme:formatBThisIsURL", SRV_URIAGENT_OPTION_UNSPECIFIED, NULL);
/* TC-URIAgent-D011: Success to dispatch URI request "scheme:formatBThisIsURL" from URA to UHA (callback is not NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_BRW, "scheme:formatBThisIsURL", SRV_URIAGENT_OPTION_UNSPECIFIED, brwapp_uri_request_cb);
/* TC-URIAgent-D012: Success to dispatch URI request "scheme:formatC This Is URL" from URA to UHA (callback is NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_MMS, "scheme:formatC This Is URL", SRV_URIAGENT_OPTION_UNSPECIFIED, NULL);
/* TC-URIAgent-D013: Success to dispatch URI request "scheme:formatC This Is URL" from URA to UHA (callback is not NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_MMS, "scheme:formatC This Is URL", SRV_URIAGENT_OPTION_UNSPECIFIED, mmsapp_uri_request_cb);
/* TC-URIAgent-D014: Success to dispatch URI request "scheme::format This Is URL With Double :" from URA to UHA (callback is NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_SMS, "scheme::format This Is URL With Double :", SRV_URIAGENT_OPTION_UNSPECIFIED, NULL);
/* TC-URIAgent-D015: Success to dispatch URI request "scheme::format This Is URL With Double :" from URA to UHA (callback is not NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_SMS, "scheme::format This Is URL With Double :", SRV_URIAGENT_OPTION_UNSPECIFIED, smsapp_uri_request_cb);
/* TC-URIAgent-D100: Fail to dispatch URI request because URL is NULL (callback is NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_SMS, NULL, SRV_URIAGENT_OPTION_NEED_CONFIRM_POPUP, NULL);
/* TC-URIAgent-D101: Fail to dispatch URI request beacause URL is NULL (callback is not NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_MMS, NULL, SRV_URIAGENT_OPTION_NEED_CONFIRM_POPUP, unused_uri_request_cb);
/* TC-URIAgent-D102: Fail to dispatch URI request due to unsupported URL "unsupportedscheme:ThisIsURL" (callback is NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_BRW, "unsupportedscheme:ThisIsURL", SRV_URIAGENT_OPTION_UNSPECIFIED,NULL);
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_BRW, "unsupportedscheme:ThisIsURL", SRV_URIAGENT_OPTION_UNSPECIFIED,unused_uri_request_cb);
/* TC-URIAgent-D104: Fail to dispatch URI request due to unsupported URL " scheme:ThisIsURL" (callback is NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_EMAIL, " scheme:ThisIsURL", SRV_URIAGENT_OPTION_UNSPECIFIED, NULL);
/* TC-URIAgent-D105: Fail to dispatch URI request due to unsupported URL " scheme:ThisIsURL" (callback is not NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_EMAIL, " scheme:ThisIsURL", SRV_URIAGENT_OPTION_UNSPECIFIED, unused_uri_request_cb);
/* TC-URIAgent-D200: Success to dispatch URI request "SCHEME:ThisIsURL" from URA to UHA (callback is NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_SMS, "SCHEME:ThisIsURL", SRV_URIAGENT_OPTION_UNSPECIFIED, NULL);
/* TC-URIAgent-D201: Success to dispatch URI request "SCHEMEA:ThisIsURL" from URA to UHA (callback is NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_MMS, "SCHEMEA:ThisIsURL", SRV_URIAGENT_OPTION_NEED_CONFIRM_POPUP, NULL);
/* TC-URIAgent-D202: Success to dispatch URI request "schemeb:ThisIsURL" from URA to UHA (callback is NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_BRW, "schemeb:ThisIsURL", SRV_URIAGENT_OPTION_UNSPECIFIED, NULL);
/* TC-URIAgent-D203: Success to dispatch URI request "SCHEME:FORMATThisIsURL" from URA to UHA (callback is NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_SMS, "SCHEME:FORMATThisIsURL", SRV_URIAGENT_OPTION_UNSPECIFIED, NULL);
/* TC-URIAgent-D204: Success to dispatch URI request "SCHEME:FORMATAThisIsURL" from URA to UHA (callback is NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_MMS, "SCHEME:FORMATAThisIsURL",SRV_URIAGENT_OPTION_UNSPECIFIED, NULL);
/* TC-URIAgent-D205: Success to dispatch URI request "scheme:formatbThisIsURL" from URA to UHA (callback is NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_BRW, "scheme:formatbThisIsURL", SRV_URIAGENT_OPTION_UNSPECIFIED,NULL);
/* TC-URIAgent-D206: Success to dispatch URI request "SCHEME:formatC This Is URL" from URA to UHA (callback is NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_MMS, "SCHEME:formatC This Is URL",SRV_URIAGENT_OPTION_UNSPECIFIED,NULL);
/* TC-URIAgent-D207: Success to dispatch URI request "SCHEME::format This Is URL With Double :" from URA to UHA (callback is NULL) */
err_code |= srv_uriagent_dispatch_uri_request(SRV_URIAGENT_APPID_SMS, "SCHEME::format This Is URL With Double :", SRV_URIAGENT_OPTION_UNSPECIFIED, NULL);
AVK_LOG_FUN(srv_uriagent_dispatch_uri_request, SRV_URIAGENT_ERR_OK != err_code);
}
AVK_CASE(AVK_OTHER_URI_003, AVK_OTHER_URI)
{
// srv_uriagent_has_registered_hdlr
U32 retVal = 0;
U32 retVal1 = 0;
U32 retVal2 = 0;
U32 retVal3 = 0;
/* TC-URIAgent-C000: Check if any handler is registered to process this URI request: URL is "scheme:ThisIsURL" */
retVal |= srv_uriagent_has_registered_hdlr("scheme:ThisIsURL");
/* TC-URIAgent-C001: Check if any handler is registered to process this URI request: URL is "scheme: This Is URL With Space " */
retVal |= srv_uriagent_has_registered_hdlr("scheme: This Is URL With Space ");
/* TC-URIAgent-C002: Check if any handler is registered to process this URI request: URL is "scheme: This Is URL With : And Space" */
retVal |= srv_uriagent_has_registered_hdlr("scheme: This Is URL With : And Space");
/* TC-URIAgent-C003: Check if any handler is registered to process this URI request: URL is "scheme: This Is URL With ^_^" */
retVal |= srv_uriagent_has_registered_hdlr("scheme: This Is URL With ^_^");
/* TC-URIAgent-C004: Check if any handler is registered to process this URI request: URL is "scheme: This Is URL With %" */
retVal |= srv_uriagent_has_registered_hdlr("scheme: This Is URL With %");
/* TC-URIAgent-C005: Check if any handler is registered to process this URI request: URL is "scheme::This Is URL With Double :" */
retVal |= srv_uriagent_has_registered_hdlr("scheme::This Is URL With Double :");
/* TC-URIAgent-C006: Check if any handler is registered to process this URI request: URL is "schemeA:ThisIsURL" */
retVal |= srv_uriagent_has_registered_hdlr("schemeA:ThisIsURL");
/* TC-URIAgent-C007: Check if any handler is registered to process this URI request: URL is "schemeB:ThisIsURL" */
retVal |= srv_uriagent_has_registered_hdlr("schemeB:ThisIsURL");
/* TC-URIAgent-C008: Check if any handler is registered to process this URI request: URL is "scheme:formatThisIsURL" */
retVal |= srv_uriagent_has_registered_hdlr("scheme:formatThisIsURL");
/* TC-URIAgent-C009: Check if any handler is registered to process this URI request: URL is "scheme:formatAThisIsURL" */
retVal |= srv_uriagent_has_registered_hdlr("scheme:formatAThisIsURL");
/* TC-URIAgent-C010: Check if any handler is registered to process this URI request: URL is "scheme:formatBThisIsURL" */
retVal |= srv_uriagent_has_registered_hdlr("scheme:formatBThisIsURL");
/* TC-URIAgent-C011: Check if any handler is registered to process this URI request: URL is "scheme:formatCThisIsURL" */
retVal |= srv_uriagent_has_registered_hdlr("scheme:formatCThisIsURL");
/* TC-URIAgent-C100: Check if any handler is registered to process this URI request: URL is "schemeC:ThisIsURL" */
retVal |= srv_uriagent_has_registered_hdlr("schemeC:ThisIsURL");
/* TC-URIAgent-C101: Check if any handler is registered to process this URI request: URL is "schemeAB:ThisIsURL" */
retVal |= srv_uriagent_has_registered_hdlr("schemeAB:ThisIsURL");
/* TC-URIAgent-C102: Check if any handler is registered to process this URI request: URL is "schemeBB:ThisIsURL" */
retVal |= srv_uriagent_has_registered_hdlr("schemeBB:ThisIsURL");
/* TC-URIAgent-C103: Check if any handler is registered to process this URI request: URL is "unsupportedscheme:ThisIsURL" */
retVal |= srv_uriagent_has_registered_hdlr("unsupportedscheme:ThisIsURL");
/* TC-URIAgent-C104: Check if any handler is registered to process this URI request: URL is "schemeThisIsURL" */
retVal |= srv_uriagent_has_registered_hdlr("schemeThisIsURL");
/* TC-URIAgent-C105: Check if any handler is registered to process this URI request: URL is " " */
retVal |= srv_uriagent_has_registered_hdlr(" ");
/* TC-URIAgent-C106: Check if any handler is registered to process this URI request: URL is NULL */
retVal |= srv_uriagent_has_registered_hdlr(NULL);
/* TC-URIAgent-C200: Check if any handler is registered to process this URI request: URL is "SCHEME:ThisIsURL" */
retVal |= srv_uriagent_has_registered_hdlr("SCHEME:ThisIsURL");
/* TC-URIAgent-C201: Check if any handler is registered to process this URI request: URL is "sChEmE: This Is URL With Space " */
retVal |= srv_uriagent_has_registered_hdlr("sChEmE: This Is URL With Space ");
/* TC-URIAgent-C202: Check if any handler is registered to process this URI request: URL is "SCHEME:FORMATThisIsURL" */
retVal |= srv_uriagent_has_registered_hdlr("SCHEME:FORMATThisIsURL");
/* TC-URIAgent-C203: Check if any handler is registered to process this URI request: URL is "scheme:FORMATAThisIsURL" */
retVal |= srv_uriagent_has_registered_hdlr("scheme:FORMATAThisIsURL");
/* TC-URIAgent-C204: Check if any handler is registered to process this URI request: URL is "scheme:formatbThisIsURL" */
retVal |= srv_uriagent_has_registered_hdlr("scheme:formatbThisIsURL");
/* TC-URIAgent-C205: Check if any handler is registered to process this URI request: URL is "SCHEME:formatCThisIsURL" */
retVal |= srv_uriagent_has_registered_hdlr("SCHEME:formatCThisIsURL");
// set scheme and prefix
retVal1 |= srv_uriagent_register_hdlr_by_scheme("scheme99", dummy_scheme_uri_request_hdlr, MMI_FALSE);
retVal1 |= srv_uriagent_register_hdlr_by_scheme("scheme88", dummy_scheme_uri_request_hdlr, MMI_FALSE);
retVal1 |= srv_uriagent_register_hdlr_by_scheme("scheme77", dummy_scheme_uri_request_hdlr, MMI_FALSE);
retVal1 |= srv_uriagent_register_hdlr_by_prefix("wtai://wp/cm", dummy_prefix_hdlr, MMI_FALSE);
retVal1 |= srv_uriagent_register_hdlr_by_prefix("wtai://wp/ds", dummy_prefix_hdlr, MMI_FALSE);
retVal1 |= srv_uriagent_register_hdlr_by_prefix("wtai://wp/pa", dummy_prefix_hdlr, MMI_FALSE);
retVal2 |= srv_uriagent_has_registered_hdlr("scheme77:1234567");
retVal2 |= srv_uriagent_has_registered_hdlr("scheme88:1234567");
retVal2 |= srv_uriagent_has_registered_hdlr("scheme99:1234567");
retVal3 |= srv_uriagent_has_registered_hdlr("wtai://wp/cm");
retVal3 |= srv_uriagent_has_registered_hdlr("wtai://wp/ds");
retVal3 |= srv_uriagent_has_registered_hdlr("wtai://wp/pa");
AVK_LOG_FUN(srv_uriagent_has_registered_hdlr,
(MMI_FALSE == retVal) &&( SRV_URIAGENT_ERR_OK == retVal1) && ( MMI_FALSE != retVal2 ) &&(MMI_FALSE != retVal3));
}
AVK_CASE(AVK_OTHER_URI_004, AVK_OTHER_URI)
{
AVK_LOG_EX(srv_uriagent_get_num_of_registered_schemes()>0);
AVK_LOG_EX(srv_uriagent_get_num_of_registered_prefixes()>0);
AVK_LOG_EX(NULL != srv_uriagent_get_registered_scheme_by_index(0));
AVK_LOG_EX(NULL != srv_uriagent_get_registered_prefix_by_index(0));
}
#endif /*__MMI_URI_AGENT__*/