urlmon/tests: Check that .Net is present in the user-agent string.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Francois Gouget 2021-05-07 15:20:01 +02:00 committed by Alexandre Julliard
parent ac39b313b6
commit 516a6f7317
1 changed files with 13 additions and 5 deletions

View File

@ -1529,6 +1529,8 @@ static void test_user_agent(void)
if(i < 8 && i != 1) if(i < 8 && i != 1)
ok(!strcmp(ua, str2), "unexpected UA for version %u %s, expected %s\n", ok(!strcmp(ua, str2), "unexpected UA for version %u %s, expected %s\n",
i, wine_dbgstr_a(ua), wine_dbgstr_a(str2)); i, wine_dbgstr_a(ua), wine_dbgstr_a(str2));
if (winetest_debug > 1)
trace("version=%u user-agent=%s\n", i, wine_dbgstr_a(ua));
p += check_prefix(p, "Mozilla/"); p += check_prefix(p, "Mozilla/");
p += check_prefix(p, i < 9 ? "4.0 (" : "5.0 ("); p += check_prefix(p, i < 9 ? "4.0 (" : "5.0 (");
@ -1544,6 +1546,7 @@ static void test_user_agent(void)
}else if(sizeof(void*) == 8) { }else if(sizeof(void*) == 8) {
p += check_prefix(p, "Win64; "); p += check_prefix(p, "Win64; ");
#ifdef __x86_64__ #ifdef __x86_64__
todo_wine
p += check_prefix(p, "x64; "); p += check_prefix(p, "x64; ");
#endif #endif
} }
@ -1559,12 +1562,17 @@ static void test_user_agent(void)
} }
if(i == 11) { if(i == 11) {
p += check_prefix(p, "; rv:11.0) like Gecko"); p += check_prefix(p, "; rv:11.0) like Gecko");
}else if (i >= 9) {
p += check_prefix(p, ")");
}else { }else {
if(i != 1) #ifdef __x86_64__
ok(*p == ';' || *p == ')', "unexpected suffix %s for version %u\n", todo_wine
wine_dbgstr_a(p), i); #endif
if(i < 9) /* This assumes that either p points at some property before
p = strchr(p, ')'); * '; .NET', or that there is more than one such occurence.
*/
ok(strstr(p, "; .NET") != NULL, "no '; .NET' in %s\n", wine_dbgstr_a(p));
p = strchr(p, ')');
p += check_prefix(p, ")"); p += check_prefix(p, ")");
} }